Skip to Content

PRTF Reports API

Administrative endpoints for generating PRTF (Provider Reporting Template File) reports for ECM patients. PRTF reports are California DHCS-required compliance reports showing ECM patient encounters and activities.

Overview

PRTF reports are generated as CSV files following California DHCS ECM reporting requirements. The reports include patient demographics, engagement status, encounter counts, and outreach information for a specified date range. Generated reports are uploaded to S3 storage and a presigned URL is provided for download.

Generate PRTF Report

Generate a new PRTF report for ECM patients within a specified date range.

Endpoint: POST /v1/admin/clinic/ecm/prtf_reports
Authentication: Required (Admin role)

Request Body Parameters

ParameterTypeRequiredDescription
start_datestringYesStart date for the reporting period (YYYY-MM-DD)
end_datestringYesEnd date for the reporting period (YYYY-MM-DD)
provider_npistringNoFilter by specific provider NPI. If not provided, includes all providers
provider_namestringNoProvider name for the report header
provider_phonestringNoProvider phone number for the report header

Example Request

POST /v1/admin/clinic/ecm/prtf_reports HTTP/1.1 Content-Type: application/json X-User-Token: your_admin_token_here { "start_date": "2024-07-01", "end_date": "2024-07-31", "provider_npi": "1234567890", "provider_name": "Dr. John Smith", "provider_phone": "5551234567" }

Example Request - All Providers

POST /v1/admin/clinic/ecm/prtf_reports HTTP/1.1 Content-Type: application/json X-User-Token: your_admin_token_here { "start_date": "2024-07-01", "end_date": "2024-07-31" }

Success Response

{ "message": "PRTF report generated successfully", "prtf_report": { "id": 1, "filename": "PRTF_1234567890_072024_11242024.csv", "start_date": "2024-07-01", "end_date": "2024-07-31", "provider_npi": "1234567890", "provider_name": "Dr. John Smith", "provider_phone": "5551234567", "patient_count": 45, "url": "https://s3.amazonaws.com/bucket/path/to/file.csv?X-Amz-Algorithm=...", "created_at": "2024-11-24T14:30:00.000Z", "created_by_id": 123 } }

Error Response

{ "errors": [ "start_date and end_date are required", "Invalid date format. Use YYYY-MM-DD" ] }

List PRTF Reports

Retrieve a paginated list of all PRTF reports that have been generated.

Endpoint: GET /v1/admin/clinic/ecm/prtf_reports
Authentication: Required (Admin role)

Query Parameters

ParameterTypeRequiredDescription
per_pageintegerNoNumber of items per page (default: 25)
pageintegerNoPage number (default: 1)

Example Request

GET /v1/admin/clinic/ecm/prtf_reports?per_page=10 HTTP/1.1 Content-Type: application/json X-User-Token: your_admin_token_here

Example Response

{ "prtf_reports": [ { "id": 1, "filename": "PRTF_1234567890_072024_11242024.csv", "start_date": "2024-07-01", "end_date": "2024-07-31", "provider_npi": "1234567890", "provider_name": "Dr. John Smith", "provider_phone": "5551234567", "patient_count": 45, "file_url": "https://s3.amazonaws.com/bucket/path/to/file.csv?X-Amz-Algorithm=...", "created_at": "2024-11-24T14:30:00.000Z", "created_by_id": 123 } ], "pagination": { "current_page": 1, "total_pages": 3, "total_count": 25, "per_page": 10 } }

Response Fields

FieldTypeDescription
idintegerUnique identifier for the PRTF report
filenamestringGenerated filename for the report
start_datestringStart date of the reporting period
end_datestringEnd date of the reporting period
provider_npistringProvider NPI (null if report includes all providers)
provider_namestringProvider name used in the report
provider_phonestringProvider phone number used in the report
patient_countintegerNumber of patients included in the report
file_urlstringPresigned S3 URL to download the report (expires in 30 minutes)
created_atstringTimestamp when the report was generated
created_by_idintegerID of the user who generated the report

Get PRTF Report Details

Retrieve details of a specific PRTF report.

Endpoint: GET /v1/admin/clinic/ecm/prtf_reports/{id}
Authentication: Required (Admin role)

Path Parameters

ParameterTypeRequiredDescription
idintegerYesPRTF report ID

Example Request

GET /v1/admin/clinic/ecm/prtf_reports/1 HTTP/1.1 Content-Type: application/json X-User-Token: your_admin_token_here

Example Response

{ "prtf_report": { "id": 1, "filename": "PRTF_1234567890_072024_11242024.csv", "start_date": "2024-07-01", "end_date": "2024-07-31", "provider_npi": "1234567890", "provider_name": "Dr. John Smith", "provider_phone": "5551234567", "patient_count": 45, "file_url": "https://s3.amazonaws.com/bucket/path/to/file.csv?X-Amz-Algorithm=...", "created_at": "2024-11-24T14:30:00.000Z", "created_by_id": 123, "created_by_name": "Admin User" } }

PRTF Report Contents

The PRTF report is a CSV file containing approximately 50 columns of data for each ECM patient. The report includes:

Patient Demographics

  • Member ID (CIN)
  • Patient name
  • Date of birth
  • Gender
  • Address
  • Phone number

Eligibility Information

  • ECM provider name
  • ECM provider NPI
  • Authorization dates
  • Acuity level
  • Member record status

Engagement Status

  • Enrollment date
  • Current status
  • Status change dates

Encounter Counts

The report tracks encounters within the reporting period:

Encounter TypeDescription
Telehealth EncountersPhone calls and video appointments
In-Person EncountersFace-to-face appointments
Telehealth OutreachPhone calls, SMS, and emails
In-Person OutreachIn-person outreach attempts

Event Type Mapping for PRTF

Events are categorized for PRTF reporting as follows:

Event TypePRTF Category
callTelehealth Encounter, Telehealth Outreach
appointmentTelehealth Encounter, In-Person Encounter
smsTelehealth Outreach
emailTelehealth Outreach
meetingIn-Person Encounter
in_person_appointmentIn-Person Encounter, In-Person Outreach

Lead Care Manager Information

  • oLCM (Outreach Lead Care Manager) name
  • iLCM (Intensive Lead Care Manager) name

Filename Format

The PRTF report filename follows this format:

PRTF_{PROVIDER_NPI or ALL}_{MMYYYY}_{MMDDYYYY}.csv

Examples:

  • PRTF_1234567890_072024_11242024.csv - Report for specific provider
  • PRTF_ALL_072024_11242024.csv - Report for all providers

Report Generation Logic

The PRTF report generation follows these rules:

  1. Patient Selection: Only includes ECM patients who were active during the specified date range
  2. Status History: Only includes patients with status history entries within the date range
  3. Provider Filter: If provider_npi is provided, only patients associated with that provider are included
  4. Event Counting: Counts events (activities) within the date range for each patient
  5. S3 Upload: The generated file is automatically uploaded to S3
  6. URL Generation: A presigned URL is provided for download (expires in 30 minutes)

cURL Example

curl -X POST "https://your-api-domain.com/v1/admin/clinic/ecm/prtf_reports" \ -H "Content-Type: application/json" \ -H "X-User-Token: YOUR_TOKEN" \ -d "{ \"start_date\": \"2024-07-01\", \"end_date\": \"2024-07-31\", \"provider_npi\": \"1234567890\", \"provider_name\": \"Dr. John Smith\", \"provider_phone\": \"5551234567\" }"

JavaScript Example

const generatePrtfReport = async () => { const response = await fetch('/v1/admin/clinic/ecm/prtf_reports', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-User-Token': 'YOUR_TOKEN' }, body: JSON.stringify({ start_date: '2024-07-01', end_date: '2024-07-31', provider_npi: '1234567890', provider_name: 'Dr. John Smith', provider_phone: '5551234567' }) }); const data = await response.json(); if (data.prtf_report && data.prtf_report.url) { // Download the report window.open(data.prtf_report.url, '_blank'); } return data; };

Error Responses

403 Forbidden

{ "errors": ["Admin access required"] }

404 Not Found

{ "errors": ["PRTF report not found"] }

422 Unprocessable Entity

{ "errors": [ "start_date and end_date are required", "Invalid date format. Use YYYY-MM-DD", "end_date must be after start_date" ] }

Best Practices

  1. Date Range: Use monthly date ranges for standard DHCS reporting
  2. Provider Filter: Generate separate reports per provider for easier tracking
  3. Download Promptly: Presigned URLs expire after 30 minutes
  4. Regular Generation: Generate reports on a regular schedule (monthly recommended)
  5. Verification: Review patient counts to ensure all expected patients are included
  6. Activity Tracking: Ensure all patient activities are properly documented before generating reports