Skip to main content

CCD API

https://fhir.netsmartcloud.com/ccd

The CareConnect CCD API enables an application to request the generation of a CDA documents--typically CCDs--for a specific patient.

Supported CareRecords

The CCD API is supported by the following Netsmart CareRecords.

  • GEHRIMED
  • Homecare
  • myAvatar
  • myEvolv
  • myUnity
  • TIER

Parameters

This API supports the following query parameters

NameTypeDescription
patientstringREQUIRED The Patient ID as assigned by the CareRecord.
documentTitlestringCCD | ConsultationNote | DischargeSummary | EICR | EmergencyHealthcareSurvey | HistoryAndPhysicalNote | InpatientHealthcareSurvey | OutpatientHealthcareSurvey | ProgressNoteDoc | PublicHealthCaseReport | ReferralNote | TransferOfCare | UnstructuredDocument
The type of CDA. Default: CCD.
enddateThe end date for the data presented in the CDA. Formatted as YYYY-MM-DD.
startdateThe start date for the data presented in the CDA. Formatted as YYYY-MM-DD.

Supported CDA Types

The following CDA document types are currently supported by this API.

TypedocumentTitle ValueType CodeNote
Consultation NoteConsultationNote11488-4
Continuity of Care DocumentCCD34133-9Defaults to this document type if parameter is not passed or an invalid value is passed.
Discharge SummaryDischargeSummary18842-5
Electronic Initial Case ReportEICR55751-2
Emergency Healthcare SurveyEmergencyHealthcareSurvey75619-7
History and Physical NoteHistoryAndPhysicalNote34117-2
Inpatient Healthcare SurveyInpatientHealthcareSurvey75619-7
Outpatient Healthcare SurveyOutpatientHealthcareSurvey75619-7
Progress NoteProgressNoteDoc11506-3
Public Health Case ReportPublicHealthCaseReport34133-9
Referral NoteReferralNote57133-1
Transfer of CareTransferOfCare-Reserved for future use. This document type is not available currently.
Unstructured DocumentUnstructuredDocument34133-9

Examples

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

Request CDA

Request CCD by Patient
curl -X GET 'https://fhir.netsmartcloud.com/ccd?patient=123' \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json"
Response to Request for CCD by Patient
HTTP/2 200
date: Mon, 17 Jul 2023 20:31:58 GMT
content-type: application/xml;charset=ISO-8859-1
content-length: 91096
x-amzn-requestid: 576c5a95-0aec-4b02-8eca-87c2b36935d3
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubDomains
feature-policy: geolocation none;midi none;notifications none;push none;sync-xhr none;microphone none;camera none;magnetometer none;gyroscope none;speaker self;vibrate none;fullscreen self;payment none;
x-amzn-remapped-connection: keep-alive
x-amz-apigw-id: IObBnGcKiYcFifg=
x-amzn-remapped-server: nginx
x-content-type-options: nosniff
x-ntst-transaction-id: 755b292f-8a7b-4910-b08d-14cde37e191c
x-amzn-remapped-date: Mon, 17 Jul 2023 20:31:58 GMT

<?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">
<!-- Contents of CDA -->
</ClinicalDocument>

Common Errors

By HTTP Status Code

401 Unauthorized

UnauthorizedException
Example: UnauthorizedException
HTTP/2 401 Unauthorized
Date: Fri, 05 May 2023 16:14:14 GMT
Content-Type: application/json
Content-Length: 26
Connection: keep-alive
x-amzn-RequestId: 78531155-b16c-4fcc-b27d-2dee6c9f9fd2
x-amzn-ErrorType: UnauthorizedException
x-amz-apigw-id: EdO1lGPrCYcFdvg=

{"message":"Unauthorized"}

You will typically see this response when one of the following occurs:

No Authorization Header in the request
curl -i https://fhir.netsmartcloud.com/ccd?patient=123 \

No token in the Authorization Header of the request
curl -i https://fhir.netsmartcloud.com/ccd?patient=123 \
-H 'Authorization: '

Access token is missing or invalid

Example: Access token is missing or invalid
HTTP/2 401 Unauthorized
Date: Fri, 05 May 2023 16:14:14 GMT
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 26
Connection: keep-alive
x-amzn-RequestId: 78531155-b16c-4fcc-b27d-2dee6c9f9fd2
x-amz-apigw-id: EdO1lGPrCYcFdvg=

Access token is missing or invalid.
Access Token is too large

You will typically see this response when the access token is too large causing the Authorization header to exceed 2,000 characters.

This can be resolved by one of the following:

  • Include the scope parameter in your token requests. (I.e., too many pre-authorized scopes defaulted into the returned access token)
  • reduces the number of scopes included in your token requests. (I.e., too many scopes requested and authorized for a single access token)

403 Forbidden

AccessDeniedException
Example: AccessDeniedException
HTTP/2 403 Forbidden
Date: Fri, 05 May 2023 16:12:43 GMT
Content-Type: application/json
Content-Length: 82
Connection: keep-alive
x-amzn-RequestId: 27ce6e0d-f2fd-44c4-a165-49c176e2afe3
x-amzn-ErrorType: AccessDeniedException
x-amz-apigw-id: EdOnXGqtCYcF7IA=

{"Message":"User is not authorized to access this resource with an explicit deny"}

You will typically see this response when one of the following occur:

  • An invalid Bearer token is provided with the request.
  • An expired Bearer token is provided with the request.
IncompleteSignatureException
Example: IncompleteSignatureException
HTTP/2 403 Forbidden
Date: Fri, 05 May 2023 16:37:55 GMT
Content-Type: application/json
Content-Length: 2994
Connection: keep-alive
x-amzn-RequestId: 4f29af98-da15-43c9-81ee-2f8984f27d1f
x-amzn-ErrorType: IncompleteSignatureException
x-amz-apigw-id: EdSTiHl0iYcFeCw=

# Possible Payload #1
{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization={malformedBearerToken}"}

# Possible Payload #2
{"message":"'{bearerToken}' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer {bearerToken}'."}

You will typically see this response when one of the following occur:

The request was sent to an invalid path
curl -i https://fhir.netsmartcloud.com/ccd/123 \
-H 'Authorization: Bearer {token}'
The request was sent using an unsupported HTTP Verb
curl -i -X HEAD https://fhir.netsmartcloud.com/ccd?patient=123 \
-H 'Authorization: Bearer {token}'
MissingAuthenticationTokenException
Example: MissingAuthenticationTokenException
HTTP/2 403 Forbidden
Date: Fri, 05 May 2023 16:29:44 GMT
Content-Type: application/json
Content-Length: 42
Connection: keep-alive
x-amzn-RequestId: 5e6e468d-f7a2-4aec-a320-630734e12a6e
x-amzn-ErrorType: MissingAuthenticationTokenException
x-amz-apigw-id: EdRG8Ho1CYcFqUQ=

{"message":"Missing Authentication Token"}

You will typically see this response when the request was sent to an invalid path and without an Authorization Header.

curl -i https://fhir.netsmartcloud.com/ccd/123

500 Internal Server Error

These errors typically indicate an unhandled exception that should be addressed. When addressed, these errors will typically be replaced with either:

  • 200 Success: This means the original request that received this response was valid but our service failed to process it correctly or experienced an unexpected error.
  • 400 Bad Request: This means that the original request that received this response was invalid and the service can not handle that correctly.
Example: Invalid start or end date parameter values
Example: Internal Server Error
HTTP/2 500 Internal Server Error
Date: Fri, 05 May 2023 16:29:44 GMT
Content-Type: text/html;charset=utf-8

<!doctype html>
<html lang="en">

<head>
<title>HTTP Status 500 – Internal Server Error</title>
<style type="text/css">
<!-- style content -->
</style>
</head>

<body>
<h1>HTTP Status 500 – Internal Server Error</h1>
<hr class="line" />
<p><b>Type</b> Exception Report</p>
<p><b>Message</b> HAPI-1882: Invalid date&#47;time format: &quot;A&quot;</p>
<p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.
</p>
<p><b>Exception</b></p>
<pre>ca.uhn.fhir.parser.DataFormatException: HAPI-1882: Invalid date&#47;time format: &quot;A&quot;
<!-- additional content -->
</body>

</html>
Request CCD by Patient
curl -X GET 'https://fhir.netsmartcloud.com/ccd?patient=123&start=A&end=Z' \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json"