How to Query NZHTS Emergency Care Presenting Complaint Reference Set and Save Results in CSV Format Using Postman

Hey everyone!

If you are working with New Zealand’s Health Terminology Services (NZHTS) and need to access the Emergency Care Presenting Complaint Reference Set, here’s a quick guide on how to query the API and save the results in CSV format using Postman.

Note: you would need an API key to make this query and If you would like an NZHTS API key to try out this query, email us at standards@tewhatuora.govt.nz with your choice of API client id.

API Query

To query the reference set, you can use the following API URL:

https://nzhts.digital.health.nz/fhir/ValueSet/$expand?url=http://snomed.info/sct/21000210109?fhir_vs=refset/71000210108&_format=csv

This will return a CSV file with a list of presenting complaints based on SNOMED CT codes in New Zealand’s emergency care refset.

Example API Response:

Once you hit the endpoint, the response will be in this format:

system,version,code,display
http://snomed.info/sct,http://snomed.info/sct/21000210109/version/20240401,21522001,Abdominal pain
http://snomed.info/sct,http://snomed.info/sct/21000210109/version/20240401,25786006,Abnormal behaviour
http://snomed.info/sct,http://snomed.info/sct/21000210109/version/20240401,151271000119102,Abnormal blood test
http://snomed.info/sct,http://snomed.info/sct/21000210109/version/20240401,7973008,Abnormal vision

How to Set Up Postman for This API

  1. Create a New Request:
  • In Postman, create a new request and paste the URL:
https://nzhts.digital.health.nz/fhir/ValueSet/$expand?url=http://snomed.info/sct/21000210109?fhir_vs=refset/71000210108&_format=csv
  1. Set the Method to GET:
  • Ensure the request method is set to GET.
  1. Send the Request:
  • Click on “Send” to execute the request.
  1. Save Response as CSV:
  • After you receive the response in CSV format, click on the “Save Response” dropdown and select Save to File.
  • Save the file with a .csv extension (e.g., emergency_care_presenting_complaints.csv).

I hope this helps! Feel free to ask if you have any questions about setting this up or working with the API!

5 Likes

Not saying this isn’t useful, but _csv isn’t one of the _format type values that’s currently supported in the R4 (or latest) FHIR Specification
If it was supported it would need to be a valid MIME type which, in this case, would be text/csv

3 Likes

Nice tip Evan!

cheers

1 Like

Hi Peter,

Thank you for pointing that out. You are correct that csv isn’t officially supported in the FHIR R4 specification.
However, in this case, we are leveraging a custom feature of Ontoserver/NZHTS, which extends FHIR’s core functionality. Ontoserver allows additional content types, such as CSV, TSV, and SCSV, specifically for ValueSet expansions. This capability provides flexibility for exporting expanded ValueSets in tabular formats, even though it’s not part of the default FHIR specification.

Regards
Evan

2 Likes