hl7au / au-fhir-test-data

HL7 AU FHIR Test Data
2 stars 6 forks source link

HL7 AU FHIR Test Data

HL7 AU FHIR Test Data contains sample FHIR instances for testing purposes, and to support developers. This repository includes synthetic (realistic but not real) data that conforms to HL7 AU FHIR Implementation Guides (IGs). The synthetic data covers a broader and expanded content scope over that in the FHIR instance examples included in published HL7 AU FHIR IGs.

This repository also contains 'test' data for some HL7 AU IGs, used to test fail cases. This data not conform to HL7 AU FHIR Implementation Guides.

Synthetic Data Properties

How to navigate this repository

Synthetic FHIR test data (JSON) files are located in:

Postman collection import files containing a selection of AU Core and AU eRequesting Test Data are located in the Postman folder

Sample Postman environment import files are also located in the Postman folder:

This repository also contains source code for the command line utilities used to generate the FHIR JSON files and upload them to a FHIR Server. These utilities have been developed using DotNet. For further details see Test Data Command Line Utilities below.

Sparked AU Core Testing

We suggest using the Sparked Test Data Postman collection which contains:

Currently, this Postman collection does not contain non-conformant resources for negative testing.

If you would like to upload the Sparked generated or addition test data sets into your FHIR server by using the FHIR REST updateCreate (PUT) interaction, use the UploadGenerated.bat and UploadDirect.bat batch files (.sh files coming). Refer to the instructions below in the section Upload Data below.

Significant Test Data Test Cases

The following test data files within the direct-fhir-test-resources folder support testing of significant test cases including missing and suppressed data.

File Name Resource Id Test Case Expected Outcome
Patient-italia-sofia-suppressed-birthDate.json italia-sofia-suppressed-birthDate Patient with a suppressed birthDate A Responder SHALL correctly populate a Data Absent Reason extension within a primitate data type extension and a Requester SHALL accept this extension without error.
Patient-italia-sofia-suppressed-gender.json italia-sofia-suppressed-gender Patient with a suppressed gender A Responder SHALL correctly populate using value of 'unknown' and a Requester SHALL accept the 'unknown' value without error.
Patient-italia-sofia-suppressed-identifier.json italia-sofia-suppressed-identifier Patient with suppressed identifiers A Responder SHALL correctly populate a Data Absent Reason extension within Identifier.extension and a Requester SHALL accept this extension without error. Currently validation using the Sparked Reference FHIR Server rejects this instance due to rule au-core-pat-01.
Patient-italia-sofia-suppressed-name.json italia-sofia-suppressed-name Patient with suppressed names A Responder SHALL correctly populate a Data Absent Reason extension within HumanName.extension and a Requester SHALL accept this extension without error. Currently validation using the Sparked Reference FHIR Server rejects this instance due to rules au-core-pat-02 and au-core-pat-04.
Observation-pathresult-missing-effective.json pathresult-missing-effective Pathology Result Observation with missing effectiveDateTime A Responder SHALL correctly populate a Data Absent Reason extension represented using a primitate data type extension, and a Requester SHALL accept this extension without error. Currently validation using the Sparked Reference FHIR Server rejects this instance due to rule Rule au-core-obs-01.
Observation-pathresult-missing-status.json pathresult-missing-status Pathology Result Observation with missing status A Responder SHALL correctly populate using value of 'unknown', and a Requester SHALL accept this value without error.
Observation-pathresult-suppressed-code.json pathresult-suppressed-code Pathology Result Observation with suppressed code A Responder SHALL correctly populate the coding using a code (masked or unknown) from the Data Absent Reason value set, and a Requester SHALL accept this coding without error.
Observation-pathresult-suppressed-dataAbsentReason.json pathresult-suppressed-dataAbsentReason Pathology Result Observation with suppressed value using dataAbsentReason Using dataAbsentReason is NOT the recommended representation of a suppressed test result value in AU Core.
Observation-pathresult-suppressed-subject.json pathresult-suppressed-subject Pathology Result Observation with suppressed subject A Responder SHALL correctly populate a Data Absent Reason extension within Reference.extension and a Requester SHALL accept this extension without error.
Observation-pathresult-suppressed-valueCodeableConcept.json pathresult-suppressed-valueCodeableConcept Pathology Result Observation with suppressed codeable value A Responder SHALL correctly populate the coding with a code (masked or unknown) from the Data Absent Reason value set, and a Requester SHALL accept this coding without error.
Observation-pathresult-suppressed-valueQuantity.json pathresult-suppressed-valueQuantity Pathology Result Observation with suppressed non-coded value (complex data types) A Responder SHALL correctly populate a Data Absent Reason extension within the value[x].extension and a Requester SHALL accept this extension without error.

Did you find an error?

Search the Issues list in GitHub to ensure the error was not already reported.

If you're unable to find an open bug addressing the problem, please create a bug report or issue in this project.

Contributing to HL7 AU Test Data

1. Discuss an issue in chat.fhir.org

If you have a question, feature request, or proposed change, the best place to start is Zulip i.e. the https://chat.fhir.org/#narrow/stream/179173-australia/topic/AU.20FHIR.20Test.20Data topic.

2. Log an issue in GitHub

Search the Issues list in GitHub to check if this has already been reported.

If you're unable to find an open request, please create a GitHub to:

Test Data Command Line Utilities

There are two command line utilities to generate the FHIR JSON files and upload the generated test data to a FHIR Server. These utilites are developed using DotNet.

Sparked.Csv2FhirMapping

The Sparked.Csv2FhirMapping is a utility that maps the CSV files located in the testdata-csv folder and generates the FHIR JSON files. The Sparked.Csv2FhirMapping.sln has a dependency on the fhir-net-mappinglanguage submodule, which needs to be initialised as part of cloning this repo, or if you have already clone this repository you can initialise the submodule retrospectively.

Initialise submodules as part of cloning the repo

$ git clone --recurse-submodules https://github.com/hl7au/au-fhir-test-data.git

Retrospectively initialise submodules after cloning the repo

$ git submodule update --init

After executing the submodule update command, the fhir-net-mappinglanguage will no longer be empty.

Building Sparked.Csv2FhirMapping

  1. Install the dotnet framework in the appropriate version.
  2. Open a Command Prompt cmd (advice)
  3. Type BuildCsvFhirMapping.bat. This will execute a batch file that builds.

Generate data

Generate Specific Data

  1. Open a Command Prompt cmd (advice)
  2. Type GenerateData.bat followed by an output directory and resource type. This will execute a batch file that generates.

Usage:

GenerateData.bat output-folder resource-type

Example with local directory generated and resource type Patient:

GenerateData.bat generated Patient

Generate All Data

  1. Open a Command Prompt cmd (advice)
  2. Type GenerateAll.bat. This will execute a batch file that generates all.

Usage:

GenerateAll.bat

Upload Data

The Sparked.TestDataClient is a command line utility that uploads a batch of FHIR JSON files to a FHIR Server.

Building Sparked.TestDataClient

  1. Install the dotnet framework in the appropriate version.
  2. Open a Command Prompt cmd (advice)
  3. Type BuildTestDataClient.bat. This will execute a batch file that builds.

Uploading

Upload specific data

  1. Open a Command Prompt cmd (advice)
  2. Type UploadData.bat. This will execute a batch file that uploads all to the fhir-server of the specified resource-type located in the input-folder. The FHIR server request's Authorization header is generated using the auth-scheme and auth-parameter arguments.

Usage:

UploadData.bat fhir-server auth-scheme auth-parameter input-folder resource-type

Example:

UploadData.bat https://fhir.hl7.org.au/aucore/fhir/DEFAULT Basic {{base64-encouded-userid:password}} generated Patient

Upload all generated data

  1. Open a Command Prompt cmd (advice)
  2. Type UploadGenerated.bat. This will execute a batch file that uploads all to the fhir-server all data located in the folder generated. The FHIR server request's Authorization header is generated using the auth-scheme and auth-parameter arguments.

Usage:

UploadGenerated.bat fhir-server auth-scheme auth-parameter

Example:

UploadGenerated.bat https://fhir.hl7.org.au/aucore/fhir/DEFAULT Basic {{base64-encouded-userid:password}}

Upload all generated eRequesting data

  1. Open a Command Prompt cmd (advice)
  2. Type UploadERequesting.bat. This will execute a batch file that uploads all to the fhir-server all eRequesting data located in the folder generated. The FHIR server request's Authorization header is generated using the auth-scheme and auth-parameter arguments.

Usage:

UploadERequesting.bat fhir-server auth-scheme auth-parameter

Example:

UploadERequesting.bat https://fhir.hl7.org.au/aucore/fhir/DEFAULT Basic {{base64-encouded-userid:password}}