DocumentReference
Overview
The DocumentReference resource provides references to documents of any kind and metadata to enable document discovery and management. This resource supports clinical document workflows and document sharing.
Important: Always validate DocumentReference resource support and available operations by retrieving the current CapabilityStatement from /metadata before implementing integrations.
Resource Schema
The DocumentReference resource follows the HL7 FHIR R4 DocumentReference specification.
Key elements include:
masterIdentifier- Master version specific identifieridentifier- Other identifiers for the documentstatus- Current, superseded, entered-in-errordocStatus- Preliminary, final, amended, entered-in-errortype- Kind of document (LOINC if possible)category- Categorization of documentsubject- Who/what is the subject of the documentdate- When this document reference was createdauthor- Who and/or what authored the documentauthenticator- Who/what authenticated the documentcustodian- Organization which maintains the documentrelatesTo- Relationships to other documentsdescription- Human-readable descriptionsecurityLabel- Document security-tagscontent- Document referencedcontext- Clinical context of document
Example DocumentReference Resource
{
"resourceType": "DocumentReference",
"id": "12345",
"masterIdentifier": {
"system": "http://hospital.example.org/documents",
"value": "DOC-2024-001"
},
"status": "current",
"docStatus": "final",
"type": {
"coding": [{
"system": "http://loinc.org",
"code": "18842-5",
"display": "Discharge summary"
}]
},
"category": [{
"coding": [{
"system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category",
"code": "clinical-note",
"display": "Clinical Note"
}]
}],
"subject": {
"reference": "Patient/12345"
},
"date": "2024-01-15T14:30:00Z",
"author": [{
"reference": "Practitioner/67890",
"display": "Dr. John Smith"
}],
"authenticator": {
"reference": "Practitioner/67890"
},
"custodian": {
"reference": "Organization/hospital-123"
},
"description": "Discharge summary for patient admission",
"content": [{
"attachment": {
"contentType": "application/pdf",
"language": "en-US",
"url": "Binary/document-pdf-123",
"size": 104274,
"hash": "SGVsbG8gV29ybGQ=",
"title": "Discharge Summary - John Doe",
"creation": "2024-01-15T14:30:00Z"
},
"format": {
"system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem",
"code": "urn:ihe:pcc:xphr:2007",
"display": "Personal Health Records"
}
}],
"context": {
"encounter": [{
"reference": "Encounter/67890"
}],
"period": {
"start": "2024-01-10T08:00:00Z",
"end": "2024-01-15T14:30:00Z"
},
"facilityType": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "22232009",
"display": "Hospital"
}]
}
}
}
Supported Profiles
This API supports the following FHIR profiles:
Operations
The General Purpose API DocumentReference resources supports the following standard operations. However, support varies by the targeted CareRecord or solution.
| CareRecord / Solution | Create | Read | Update | Search |
|---|---|---|---|---|
| GEHRIMED | - | Yes | - | Yes |
| myAvatar | - | Yes | - | Yes |
| myEvolv | - | Yes | - | Yes |
| myUnity | - | Yes | - | Yes |
| Referral Manager | Yes | - | Yes | - |
Search
Not all Netsmart solutions support DocumentReference search. See supported operations table above and consult your target solution's documentation for more information.
This operation retrieves a list of resources by these query parameters.
Standard Parameters
| Name | Type | Description |
|---|---|---|
| authenticator | reference | Who/what authenticated the document. |
| author | reference | Who and/or what authored the document. |
| custodian | reference | Organization which maintains the document. |
| patient | reference | REQUIRED Who/what is the subject of the document. Not required when searching by _id. |
| period | date | The time of service that is being documented. |
| type | token | Kind of document (LOINC if possible). |
| _id | id | Unique identifier of the DocumentReference. Cannot be used with other search parameters. |
Search Examples
Via POST
The POST method is recommended as it keeps health information out of the URL.
- Production
- Preview
curl -X POST https://fhir.netsmartcloud.com/v4/DocumentReference/_search \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-d "patient=Patient/123" \
-d "type=http://loinc.org|18842-5"
curl -X POST https://fhirtest.netsmartcloud.com/v4/DocumentReference/_search \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-d "patient=Patient/123" \
-d "type=http://loinc.org|18842-5"
Via GET
- Production
- Preview
curl -X GET "https://fhir.netsmartcloud.com/uscore/v1/DocumentReference?patient=Patient/123&type=http://loinc.org%7C18748-4" \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json"
curl -X GET "https://fhirtest.netsmartcloud.com/uscore/v1/DocumentReference?patient=Patient/123&type=http://loinc.org%7C18748-4" \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json"
Generate an Ad-hoc CDA
This customization is expected to be replaced with an extended operation in future API versions.
This resource has been customized the search to allow for the generation of an ad-hoc CDA document similar to our CCD API.
This functionality is initiated by using one of our CCD API documentType values in type search parameter.
Supported CDA Types
The following CDA document types are currently supported by this API.
| Type | type Parameter | Note |
|---|---|---|
| Consultation Note | ConsultationNote | |
| Continuity of Care Document | CCD | |
| Discharge Summary | DischargeSummary | |
| Electronic Initial Case Report | EICR | |
| Emergency Healthcare Survey | EmergencyHealthcareSurvey | |
| History and Physical Note | HistoryAndPhysicalNote | |
| Inpatient Healthcare Survey | InpatientHealthcareSurvey | |
| Outpatient Healthcare Survey | OutpatientHealthcareSurvey | |
| Progress Note | ProgressNoteDoc | |
| Public Health Case Report | PublicHealthCaseReport | |
| Referral Note | ReferralNote | |
| Transfer of Care | TransferOfCare | Reserved for future use. This document type is not available currently. |
| Unstructured Document | UnstructuredDocument |
Parameters
The following search parameters are used to generate the CDA. All other search parameters passed are ignored.
| Name | Type | Description |
|---|---|---|
| patient | reference | REQUIRED Who/what is the subject of the document. |
| period | date | The time of service that is being documented. |
| type | token | CCD | ConsultationNote | DischargeSummary | EICR | EmergencyHealthcareSurvey | HistoryAndPhysicalNote | InpatientHealthcareSurvey | OutpatientHealthcareSurvey | ProgressNoteDoc | PublicHealthCaseReport | ReferralNote | TransferOfCare | UnstructuredDocument REQUIRED The type of CDA. |
Examples
The following examples show how to use the search parameters to generate a CDA.
Via POST
The POST method is recommended as it keeps health information out of the URL.
- Production
- Preview
curl -X POST https://fhir.netsmartcloud.com/v4/DocumentReference/_search \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d "patient=Patient/123" \
-d "type=CCD" \
-d "period=ge2023-07-01" \
-d "period=le2023-07-31"
curl -X POST https://fhirtest.netsmartcloud.com/v4/DocumentReference/_search \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d "patient=Patient/123" \
-d "type=CCD" \
-d "period=ge2023-07-01" \
-d "period=le2023-07-31"
Via GET
- Production
- Preview
curl -X GET "https://fhir.netsmartcloud.com/uscore/v1/DocumentReference?patient=Patient/123&type=CCD&period=ge2023-07-01&period=ge2023-07-31" \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json"
curl -X GET "https://fhirtest.netsmartcloud.com/v4/DocumentReference?patient=Patient/123&type=CCD&period=ge2023-07-01&period=ge2023-07-31" \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json"
Error Handling
For information about error responses when working with DocumentReference resources, see Common Errors.
Common DocumentReference-related errors include:
- Missing required patient reference
- Invalid document type or LOINC codes
- Malformed document dates or periods
- Invalid author or custodian references
Integration Patterns
Document Discovery
Find documents for patients:
# Get all documents for patient
curl -X GET "https://fhir.netsmartcloud.com/v4/DocumentReference?patient=12345" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"
Clinical Document Generation
Generate CDA documents:
# Generate CCD document
curl -X GET "https://fhir.netsmartcloud.com/v4/DocumentReference?patient=12345&type=CCD&period=ge2024-01-01" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"
Document Type Filtering
Filter by document types:
# Get discharge summaries
curl -X GET "https://fhir.netsmartcloud.com/v4/DocumentReference?patient=12345&type=http://loinc.org|18842-5" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"
Relationships to Other Resources
The DocumentReference resource connects to many clinical and administrative resources:
- Patient - The subject of the document
- Practitioner - Authors and authenticators of documents
- Organization - Custodians of documents
- Encounter - Clinical encounters documented
- Binary - Actual document content
- Condition - Health conditions documented
- Procedure - Procedures documented
Support
For questions about DocumentReference resource implementation or clinical document workflows, contact Netsmart support through your designated support channels.