Bulk Data Capabilities¶
Touchstone has the ability for a user to create and use a Test System that supports the Bulk Data specification. Touchstone provides additional features that provide support for the evaluation and validation of the NDJSON returned files.
NDJSON File Evalutation and Validation¶
The Bulk Data specification defines a new FHIR extended operation $export which generates bulk data output files containing multiple FHIR resources using the NDJSON format for FHIR - application/fhir+ndjson.
Evaluation and validation of this NDJSON format for FHIR requires extended capabilities be implemented on the FHIR Test Engine and extended definitions within the FHIR TestScript resource. Touchstone has implemented these extended capabilities through the use of NDJSON Assertion Prefix syntax within the values of the following TestScript elements:
TestScript.profile.reference
TestScript.test.action.assert.expression
TestScript.test.action.assert.path
TestScript.test.action.assert.resource
NDJSON Assertion Prefix¶
The NDJSON Assertion-Prefix is specified within the curly braces and is composed of 3 parts (highlighted in color):
{ Evaluation-Operator | Filter-Index-Range | Filter-Path} Regular-Assert. All three are optional.
Note: The use of the NDJSON Assertion Prefix syntax within the assert.resource element prevents the containing testscript resource from validating on upload to Touchstone.
NDJSON assertions are applied in 4 stages:
Filter-Path evaluation. Example: .name[?(@.family==’Gracia’)] i.e. all Patients whose family-name is ‘Gracia’. Resource is included in evaluation if JSON-PATH evaluation results to a Truthy value (exists and is not false for our purposes). If no Filter-Path is specified then all resources filter through.
Filter-Index-Range. Example: 1 - 10 i.e. Include resources 1 through 10 in the assertion evaluation. If Filter-Index-Range is not specified then all resources filter through. If Filter-Path was specified then Filter-Index-Range operates on the resources that made it through Filter-Path evaluation and not the original resources.
Regular-Assert :- The Profile/Expression/Path/Resource evaluation on resources that made it past 1 and 2. Example: Patient (if assertion is resource).
Evaluation-Operator (any/all). If ‘any’ operator is used then overall assertion passes if single resource passes. Default is ‘all’.
For examples of the NDJSON Assertion Prefix syntax, visit the Touchstone Testing Implementation Guide.