Skip to main content

CCD API

Recommended: Use FHIR DocumentReference $docref Operation

For new integrations, we recommend using the standardized US Core DocumentReference $docref operation instead of this legacy CCD API. The $docref operation provides:

  • Standards-based FHIR approach for on-demand document generation
  • Consistent interface across all FHIR APIs (supports both GET and POST methods)
  • Support for both stable document search and on-demand generation
  • Better integration with FHIR workflows

See DocumentReference $docref documentation for details.

Overview

The CareConnect CCD API enables an application to request the generation of Clinical Document Architecture (CDA) documents for a specific patient. This API supports various document types including Continuity of Care Documents (CCDs), consultation notes, discharge summaries, and other clinical documents.

Key Use Cases:

  • Generate CCD documents for care transitions
  • Create consultation notes for referrals
  • Produce discharge summaries for patient handoffs
  • Support regulatory reporting requirements

Base URLs:

https://fhir.netsmartcloud.com/ccd

Supported CareRecords

The CCD API is supported by the following Netsmart CareRecords:

CareRecordSupport
GEHRIMEDYes
HomecareYes
myAvatarYes
myEvolvYes
myUnityYes
TIERYes

Operations

Generate CDA Document

Generate a Clinical Document Architecture (CDA) document for a specific patient.

Endpoint: GET /ccd

Parameters

NameTypeRequiredDescription
patientstringYesThe Patient ID as assigned by the CareRecord
documentTitlestringNoThe type of CDA document to generate. Default: CCD
startdateNoStart date for data inclusion (YYYY-MM-DD format)
enddateNoEnd date for data inclusion (YYYY-MM-DD format)

Supported Document Types

Document TypedocumentTitle ValueLOINC CodeStatus
Continuity of Care DocumentCCD34133-9Default
Consultation NoteConsultationNote11488-4Available
Discharge SummaryDischargeSummary18842-5Available
Electronic Initial Case ReportEICR55751-2Available
Emergency Healthcare SurveyEmergencyHealthcareSurvey75619-7Available
History and Physical NoteHistoryAndPhysicalNote34117-2Available
Inpatient Healthcare SurveyInpatientHealthcareSurvey75619-7Available
Outpatient Healthcare SurveyOutpatientHealthcareSurvey75619-7Available
Progress NoteProgressNoteDoc11506-3Available
Public Health Case ReportPublicHealthCaseReport34133-9Available
Referral NoteReferralNote57133-1Available
Unstructured DocumentUnstructuredDocument34133-9Available
Transfer of CareTransferOfCare-Reserved for future use

Authentication

The CCD API uses OAuth 2.0 Client Credentials flow for authentication. You must obtain an access token before making API requests.

Required Scope

  • CCD - Required for accessing the CCD API

Request Access Token

Client Credentials Flow with Client Secret
curl -X POST https://oauth.netsmartcloud.com/token \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d grant_type=client_credentials \
-d client_id=YOUR_CLIENT_ID \
-d client_secret=YOUR_CLIENT_SECRET \
-d scope=CCD

Examples

Basic CCD Request

Generate CCD for Patient
curl -X GET 'https://fhir.netsmartcloud.com/ccd?patient=123' \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/xml"

Advanced Examples

Generate Consultation Note with Date Range
curl -X GET 'https://fhir.netsmartcloud.com/ccd?patient=123&documentTitle=ConsultationNote&start=2024-01-01&end=2024-01-31' \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/xml"
Generate Discharge Summary
curl -X GET 'https://fhir.netsmartcloud.com/ccd?patient=456&documentTitle=DischargeSummary' \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/xml"

Response Example

Successful CCD Generation
HTTP/2 200 OK
Date: Mon, 17 Jul 2023 20:31:58 GMT
Content-Type: application/xml;charset=ISO-8859-1
Content-Length: 91096
x-ntst-transaction-id: 755b292f-8a7b-4910-b08d-14cde37e191c

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="NTSTCCDStyles.xsl"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:hl7-org:v3"
xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
<templateId root="2.16.840.1.113883.10.20.22.1.2" extension="2015-08-01"/>
<id extension="CCD-123" root="2.16.840.1.113883.19.5.99999.1"/>
<code code="34133-9" codeSystem="2.16.840.1.113883.6.1"
codeSystemName="LOINC" displayName="Summarization of Episode Note"/>
<title>Continuity of Care Document</title>
<!-- Additional CDA content -->
</ClinicalDocument>

Integration Patterns

Common Workflows

1. Care Transition Documentation

# Step 1: Generate CCD for patient transfer
GET /ccd?patient=123&documentTitle=CCD

# Step 2: Include in care transition workflow
# Use generated CDA document for handoff

2. Consultation Documentation

# Step 1: Generate consultation note
GET /ccd?patient=456&documentTitle=ConsultationNote&start=2024-01-15&end=2024-01-15

# Step 2: Share with referring provider
# Include consultation details and recommendations

Response Formats

  • Content-Type: application/xml;charset=ISO-8859-1
  • Format: HL7 CDA R2 compliant XML
  • Encoding: UTF-8
  • Stylesheet: Includes XSL transformation for browser rendering

Error Handling

Common Error Scenarios

400 Bad Request

Missing Required Parameter
HTTP/2 400 Bad Request
Content-Type: application/json

{
"error": "Bad Request",
"message": "Missing required parameter: patient"
}

401 Unauthorized

Invalid or Missing Token
HTTP/2 401 Unauthorized
Content-Type: application/json

{
"message": "Unauthorized"
}

Common Causes:

  • Missing Authorization header
  • Invalid or expired access token
  • Insufficient scope (missing CCD scope)

404 Not Found

Patient Not Found
HTTP/2 404 Not Found
Content-Type: application/json

{
"error": "Not Found",
"message": "Patient with ID '123' not found"
}

500 Internal Server Error

Document Generation Failed
HTTP/2 500 Internal Server Error
Content-Type: application/json

{
"error": "Internal Server Error",
"message": "Failed to generate CDA document"
}

Troubleshooting Tips

  • Authentication Issues: Verify access token and required CCD scope
  • Patient Not Found: Confirm patient ID exists in target CareRecord
  • Invalid Document Type: Check documentTitle parameter against supported values
  • Date Format Errors: Ensure dates use YYYY-MM-DD format
  • Generation Failures: Contact Netsmart support with transaction ID

Migration to FHIR DocumentReference $docref

For applications currently using the CCD API, we recommend migrating to the US Core DocumentReference $docref operation for on-demand document generation.

Benefits of Migration

  • Standards-Based: Uses HL7 FHIR US Core standard operation
  • Unified API: Single FHIR API for both document search and generation
  • Better Discovery: CapabilityStatement documents available operations
  • Consistent Authentication: Uses same OAuth flows as other FHIR resources
  • Future-Proof: Aligned with industry standards and regulatory requirements

Migration Comparison

FeatureLegacy CCD APIFHIR $docref Operation
EndpointGET /ccd?patient={id}GET or POST /DocumentReference/$docref
Request FormatQuery parametersQuery parameters (GET) or FHIR Parameters (POST)
Response FormatCDA XML documentFHIR Bundle with DocumentReference + Binary
AuthenticationOAuth with CCD scopeOAuth with FHIR scopes
StandardsCustom APIUS Core IG
DiscoveryDocumentation onlyCapabilityStatement

Example Migration

Legacy CCD API:

curl -X GET 'https://fhir.netsmartcloud.com/ccd?patient=123' \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/xml"

FHIR $docref Operation (GET):

curl -X GET 'https://fhir.netsmartcloud.com/provider/system-access/v2/DocumentReference/\$docref?patient=123' \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/fhir+json"

FHIR $docref Operation (POST with type parameter):

curl -X POST https://fhir.netsmartcloud.com/provider/system-access/v2/DocumentReference/\$docref \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/fhir+json" \
-d '{
"resourceType": "Parameters",
"parameter": [
{
"name": "patient",
"valueId": "123"
},
{
"name": "type",
"valueCoding": {
"system": "http://loinc.org",
"code": "34133-9"
}
}
]
}'

Migration Resources

Technical Specifications

Standards Compliance

  • HL7 CDA R2: Full compliance with Clinical Document Architecture Release 2
  • C-CDA: Consolidated Clinical Document Architecture templates
  • LOINC Codes: Standard document type identification
  • XML Schema: Validates against HL7 CDA XSD

Security

  • OAuth 2.0: Client Credentials flow authentication
  • HTTPS: All communications encrypted in transit
  • Access Control: Tenant-based data isolation
  • Audit Logging: All requests logged with transaction IDs