Examples

Read Receipts: Search for DocumentReference resources sent by your organisation, on a given date, which have been read by the patient

This example demonstrates how to determine which of your documents have been read by the Patient.

This can be achieved by providing your organisation reference, the date of interest, and a status of "READ" as input parameters to the DocumentReference type search.
  1. Generate an access token by following the OAuth2 walkthrough
  2. Confirm the Organization reference of your own organisation
    1. The example below assumes a reference of: Organization/00000000-0000-0000-0000-000000000000
  3. Confirm the date of interest
    1. The example below assumes a date of: 2018-08-01
  4. Make the call as detailed below, replacing the access token and search parameters with your own values
  5. The matching DocumentReference resources will be returned in the search results
ExampleDetails
Relative URL/DocumentReference
Sandbox example 
Absolute URLhttps://sandbox.patientsknowbest.com/fhir/DocumentReference?source-organisation=Organization/00000000-0000-0000-0000-000000000000&indexed=2018-08-01&message-status=http://fhir.patientsknowbest.com/codesystem/message-status|READ
curlcurl -X GET --header "Accept: application/fhir+json" --header "Authorization: Bearer your access token" "https://sandbox.patientsknowbest.com/fhir/DocumentReference?source-organisation=Organization/00000000-0000-0000-0000-000000000000&indexed=2018-08-01&message-status=http://fhir.patientsknowbest.com/codesystem/message-status|READ"

Retrieve DocumentReference resources for a specific Encounter

This example demonstrates how to search for DocumentReference resources for a known Encounter.
  1. Generate an access token by following the OAuth2 walkthrough
  2. Confirm the Encounter reference of interest
    1. The example below assumes a reference of: Encounter/00000000-0000-0000-0000-000000000000
  3. Make the call as detailed below, replacing the access token and search parameters with your own values
  4. The matching DocumentReference resources will be returned in the search results
ExampleDetails
Relative URL/DocumentReference
Sandbox example 
Absolute URLhttps://sandbox.patientsknowbest.com/fhir/DocumentReference?encounter=Encounter/00000000-0000-0000-0000-000000000000
curlcurl -X GET --header "Accept: application/fhir+json" --header "Authorization: Bearer your access token" "https://sandbox.patientsknowbest.com/fhir/DocumentReference?encounter=Encounter/00000000-0000-0000-0000-000000000000"
Comments