GET
/
medical
/
v1
/
document
curl --request GET \
  --url https://api.sandbox.metriport.com/medical/v1/document \
  --header 'x-api-key: <api-key>'
import { MetriportMedicalApi } from "@metriport/api-sdk";

const metriport = new MetriportMedicalApi("YOUR_API_KEY");

const { documents } = await metriport.listDocuments(
  "2.16.840.1.113883.3.666.777",
  {
    dateFrom: "2023-08-01",
    dateTo: "2023-08-31",
    content: "john",
  }
);

This endpoint returns the document references available at Metriport which are associated with the given Patient and match the provided filters, if any.

To start a new document query, see the Start Document Query endpoint.

Query Params

patientId
string
required

The ID of the Patient for which to list available Documents.

dateFrom
string

The start date (inclusive) for which to filter document references - formatted YYYY-MM-DD as per ISO 8601. If not provided, no start date filter will be applied.

dateTo
string

The end date (inclusive) for which to filter document references - formatted YYYY-MM-DD as per ISO 8601. If not provided, no end date filter will be applied.

content
string

Value to search within the document reference and the actual contents of the document (minimum 3 chars). For more details see the “search syntax” section below.

Response

An array of the DocumentReference available for the Patient matching the provided filters, if any.

documents
DocumentReference[]
required
{
  "documents": [
    {
      "resourceType": "DocumentReference",
      "id": "018a875a-3181-74e8-8aa4-40c59ed7e1b2",
      "meta": {
        "versionId": "1",
        "lastUpdated": "2023-09-01T14:31:57.025+00:00",
        "source": "#vK8lyyAta8eKkbPO"
      },
      "contained": [
        {
          "resourceType": "Organization",
          "id": "org522",
          "name": "Hospital 522"
        },
        {
          "resourceType": "Practitioner",
          "id": "auth925",
          "name": [
            {
              "text": "John Snow",
              "family": "Snow",
              "given": ["John"]
            }
          ]
        }
      ],
      "extension": [
        {
          "url": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
          "valueCoding": {
            "system": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
            "code": "METRIPORT"
          }
        }
      ],
      "masterIdentifier": {
        "system": "urn:ietf:rfc:3986",
        "value": "018a875a-3181-74e8-8aa4-40c59ed7e1b2"
      },
      "identifier": [
        {
          "use": "official",
          "system": "urn:ietf:rfc:3986",
          "value": "018a875a-3181-74e8-8aa4-40c59ed7e1b2"
        }
      ],
      "status": "current",
      "type": {
        "coding": [
          {
            "system": "http://loinc.org/",
            "code": "34133-9",
            "display": "Summarization of episode note"
          }
        ]
      },
      "subject": {
        "reference": "Patient/018a5164-c0ac-79e2-99cc-9cf951c26d94",
        "type": "Patient"
      },
      "date": "2023-08-15T03:05:58.090Z",
      "author": [
        {
          "reference": "#org522",
          "type": "Organization"
        }
      ],
      "description": "C-CDA R2.1 Patient Record",
      "content": [
        {
          "extension": [
            {
              "url": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
              "valueCoding": {
                "system": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
                "code": "METRIPORT"
              }
            }
          ],
          "attachment": {
            "contentType": "application/pdf",
            "url": "http://api.metriport.com/doc-contribution/commonwell/?fileName=965f9957-34ac-442b-9a17-fa09c76c16da/018a5164-c0ac-79e2-99cc-9cf951c26d94/965f9957-34ac-442b-9a17-fa09c76c16da_018a5164-c0ac-79e2-99cc-9cf951c26d94_018a875a-3181-74e8-8aa4-40c59ed7e1b2",
            "size": 1080416,
            "title": "965f9957-34ac-442b-9a17-fa09c76c16da/018a5164-c0ac-79e2-99cc-9cf951c26d94/965f9957-34ac-442b-9a17-fa09c76c16da_018a5164-c0ac-79e2-99cc-9cf951c26d94_018a875a-3181-74e8-8aa4-40c59ed7e1b2",
            "creation": "2023-08-14T22:05:58-05:00"
          },
          "format": {
            "code": "urn:ihe:pcc:xphr:2007"
          }
        }
      ],
      "context": {
        "period": {
          "start": "2023-08-15T02:05:58.090Z",
          "end": "2023-08-15T03:05:58.090Z"
        },
        "sourcePatientInfo": {
          "reference": "Patient/018a5164-c0ac-79e2-99cc-9cf951c26d94",
          "type": "Patient"
        }
      }
    }
  ]
}