medTech IG
0.1.0 - CI Build

medTech IG, published by medtech. This is not an authorized publication; it is the continuous build for version 0.1.0). This version is based on the current content of https://github.com/HL7NZ/medtech/ and changes regularly. See the Directory of published versions

Example Queries

General notes
  • In general, queries will only return 'active' resources. If a resource has been marked as inactive for any reason - eg entered in error or no longer considered current then they will only be returned when the query specifies them (and the syntax will vary for each resource type. See examples below.
  • All queries contain an HTTP header that specifies the Practice that the query will be executed against.

Patient



[host]/Patient/$summary?identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Retrieve a health summary using the patient NHI

[host]/Patient?identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Retrieve the demographics (Patient resource) using the patient NHI. The result will be a bundle with (hopefully) a single resource in it.

[host]/Patient?identifier=https://standards.digital.health.nz/ns/nhi-id|ABC2345&_include=Patient:general-practitioner
Retrieve the demographics (Patient resource) using the patient NHI. Includes the resource linked by the generalPractitioner element

[host]/Patient?family={familyname}&birthdate={birthdate}&telecom={telecom}&_include=Patient:general-practitioner
Return Patients based on family name, birthdate and telecom (eg phone number) details.

[host]/Patient/YYY
Retrieve a single Patient resource with a known id (YYY). Returns a single resource.

[host]/Patient?_id=YYY
Retrieve a single Patient resource with a known id (YYY). Returns a bundle containing a single resource

Condition



[host]/Condition?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Retrieve all the conditions for a patient with the NHI number YYY

[host]/Condition?patient._id=YYY
Retrieve all the conditions for a patient with the id of YYY. This is not the same as the patient NHI which is an identifier.

[host]/Condition/YYY
Retrieve a single condition with a known id (YYY).

[host]/Condition?_id=YYY
Retrieve a single condition with a known id of YYY. This differs from the previous example as it is a search, and so the resource is returned within a bundle

[host]/Condition?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&long-term-condition=true
Return conditions marked as 'long term' within medTech

[host]/Condition?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&clinical-status=inactive
Returns conditions that are marked as inactive. Generally, inactive conditions are not returned in a query

[host]/Condition?patient.identifier=ABC2356&_security=http://terminology.hl7.org/CodeSystem/v3-Confidentiality|R
Returns conditions that are marked as confidential within medTech. Generally, confidential conditions are not returned. Note that there are other security requirements for returning confidential information

MedicationRequest



[host]/MedicationRequest?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Retrieve all the prescriptions for a patient with the NHI number YYY

[host]/MedicationRequest?patient._id=YYY
Retrieve all the prescriptions for a patient with the id of YYY. This is not the same as the patient NHI which is an identifier.

[host]/MedicationRequest/YYY
Retrieve a single prescription with a known id (YYY).

[host]/MedicationRequest?_id=YYY
Retrieve a single prescription with a known id of YYY. This differs from the previous example as it is a search, and so the resource is returned within a bundle

[host]/MedicationRequest?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&long-term-medication=true
Return prescriptions marked as 'long term' within medTech

[host]/MedicationRequest?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&status:not=active
Returns prescriptions that are marked as inactive. Generally, inactive conditions are not returned in a query

[host]/MedicationRequest?patient.identifier=ABC2356&_security=http://terminology.hl7.org/CodeSystem/v3-Confidentiality|R
Returns prescriptions that are marked as confidential within medTech. Generally, confidential conditions are not returned. Note that there are other security requirements for returning confidential information

Screening Observations




These queries are designed to return 'screening' information such as blood pressure. They explicitly exclude laboratory results.

[host]/Observation/YYY
Retrieve a single observation with a known id (YYY).

[host]/Observation?_id=YYY
Retrieve a single observation with a known id of YYY. This differs from the previous example as it is a search, and so the resource is returned within a bundle

[host]/Observation?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Returns all screening observations based on patient identifier (nhi)

[host]/Observation?patient._id=IDYYY
Returns all screening observations based on patient id

[host]/Observation?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&_security=http://terminology.hl7.org/CodeSystem/v3-Confidentiality|R
Returns observations that are marked as confindential within medTech. Generally, confidential resources are not returned. Note that there are other security requirements for returning confidential information

DocumentReference




DocumentReference resources are used for clinical notes (eg consultations) and external documents such as discharge summaries.

[host]/DocumentReference?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Retrieve all the DocumentReference resources for a patient with the NHI number YYY

[host]/DocumentReference?patient._id=YYY
Retrieve all the DocumentReference resources for a patient with the id of YYY. This is not the same as the patient NHI which is an identifier.

[host]/DocumentReference/YYY
Retrieve a single DocumentReference resource with a known id (YYY). Returns a single resource

[host]/DocumentReference?_id=YYY
Retrieve a single DocumentReference resource with a known id of YYY. This differs from the previous example as it is a search, and so the resource is returned within a bundle

[host]/DocumentReference?patient.identifier=ABC2356&_security=http://terminology.hl7.org/CodeSystem/v3-Confidentiality|R
Returns DocumentReference resources that are marked as confidential within medTech. Generally, confidential resources are not returned. Note that there are other security requirements for returning confidential information

[host]/DocumentReference?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&type=http://loinc.org|11488-4
Return all DocumentReference resources for the patient based on NHI that are consultation notes (as opposed to external documents such as Discharge Summaries)

[host]/DocumentReference?patient._id=ID-YYY&type=http://loinc.org|11488-4
Return all DocumentReference resources for the patient based on NHI that are consultation notes (as opposed to external documents such as Discharge Summaries) using the patient id

[host]/DocumentReference?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&type=http://loinc.org|11488-4&_security= https://terminology.hl7.org/CodeSystem/v3-Confidentiality|R
Return all DocumentReference resources for the patient based on NHI that are consultation notes (as opposed to external documents such as Discharge Summaries) which have been marked as confidential. Note that there are other security constraints that need to be satisfied.

Inbox Documents (eg RSD)




DocumentReference resources are used for clinical notes (eg consultations) and external documents such as discharge summaries. These examples are for RSD (Referral/Status/Discharge documents only

[host]/DocumentReference?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&type=http://loinc.org|34109-9
Return all DocumentReference resources for the patient based on NHI that are external documents (not consultation notes)

[host]/DocumentReference?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|ABC2356&_security=http://terminology.hl7.org/CodeSystem/v3-Confidentiality|R&type=http://loinc.org|34109-9
Returns DocumentReference resources for external documents that are marked as confidential within medTech. Generally, confidential resources are not returned. Note that there are other security requirements for returning confidential information

Immunization



[host]/Immunization?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Retrieve all the Immunization resources resources for a patient with the NHI number YYY

[host]/Immunization?patient._id=YYY
Retrieve all the Immunization resources for a patient with the id of YYY. This is not the same as the patient NHI which is an identifier.

[host]/Immunization/YYY
Retrieve a single Immunization resource with a known id (YYY). Returns a single resource

[host]/Immunization?_id=YYY
Retrieve a single Immunization resource with a known id (YYY). Returns a bundle containing a single resource

Lab reports




The actual result is returned as a document in the DiagnosticReport.presentedForm element. Individual results are not supported at this time.

[host]/DiagnosticReport?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&_include=DiagnosticReport.result
Retrieve all the Lab results (DiagnosticReport and references Observations) for a patient with the NHI number YYY

[host]/DiagnosticReport?patient._id=YYY
Retrieve all the Lab results for a patient with the id of YYY. This is not the same as the patient NHI which is an identifier.

[host]/DiagnosticReport/YYY
Retrieve a single Lab report with a known lab id (YYY). Returns a single DiagnosticReport resource but not the referenced Observations. These will need to be retrieved separately with queries against Observation - eg GET [host]/Observation/{obs id}

[host]/DiagnosticReport?_id=YYY&_include=DiagnosticReport.result
Retrieve a single Immunization resource with a known lab id (YYY). Returns a bundle containing a single DiagnosticReport resource and the references Observations

AllergyIntolerance




By default, resources marked as inactive are not included in the query. There is a specific query that will return inactive resources.

[host]/AllergyIntolerance?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY
Retrieve all the allergies for a patient with the NHI number YYY. This includes inactive as well as active.

[host]/AllergyIntolerance?patient._id=YYY
Retrieve all the allergies for a patient with the id of YYY. This is not the same as the patient NHI which is an identifier.

[host]/AllergyIntolerance/YYY
Retrieve a single AllergyIntolerance resource with a known id (YYY). Returns a single resource

[host]/AllergyIntolerance?_id=YYY
Retrieve a single AllergyIntolerance resource with a known id (YYY). Returns a bundle containing a single resource

[host]/AllergyIntolerance?patient.identifier=https://standards.digital.health.nz/ns/nhi-id|YYY&clinical-status=inactive
Retrieve the allergies marked as inactive for a patient with the NHI number YYY. Active are not included.

Appointments



[host]/Slot?schedule.actor.identifier=https://standards.digital.health.nz/ns/hpi-person-id|HPICPNYYYX&start=ge2020-01-21T11:00:00Z
Retrieve all the appointment slots for the provider with the HPI number HPICPNYYYX starting from 11am 21st Januarty 2020. By default one weeks worth will be returned.

[host]/Slot?schedule.actor.identifier=https://standards.digital.health.nz/ns/hpi-person-id|HPICPNYYYX&start=ge2020-01-21T11:00:00Z&start=le2020-01-21T18:00:00Z
Same as the previous query, but the end date is specified

[host]/Slot?schedule.actor.identifier=https://standards.digital.health.nz/ns/hpi-person-id|HPICPNYYYX&start=ge2020-01-21T11:00:00Z&status=free
Return the free appointment slots for one week (default period) from 11am 21st Januarty 2020.

Practitioner



[host]/Practitioner/
Retrieve all the providers known to a practice. (The practice identifier is in an HTTP header for all requests)

[host]/Practitioner?._id=YYY
Return the practitioner that has the given id. There should only be 1.

[host]/Practitioner/YYY
Retrieve a single Practitioner resource with a known id (YYY). Returns a single resource

[host]/Practitioner?identifier=https://standards.digital.health.nz/ns/medical-council-id|YYY
Return the provider with the given medical council number

[host]/Practitioner?identifier=https://standards.digital.health.nz/ns/hpi-person-id|YYY
Return the provider with the given HPI CPN