hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.04k stars 1.33k forks source link

_outputformat does not support "application/ndjson" #5392

Open kiwisky opened 1 year ago

kiwisky commented 1 year ago

_outputformat does not support "application/ndjson" and the ONC INFERNO FHIR Testing tool kit failed with following request for Bulk Data 2.0. Request: get | https://mum8.clinicomp.com:8445/fhir/Group/group.mum.groupyy05/$export?_outputFormat=application/ndjson

Return: { "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">

Operation Outcome

<table border=\"0\"><td style=\"font-weight: bold;\">ERROR[]
HAPI-2039: Failed to validate parameters for job of type BULK_EXPORT: \n  The only allowed format for Bulk Export is currently application/fhir+ndjson
\n\t\t\t\n\t\t\n\t
" }, "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-2039: Failed to validate parameters for job of type BULK_EXPORT: \n The only allowed format for Bulk Export is currently application/fhir+ndjson" } ] }

Additional context I checked the source, it seems we need to pass the format because it is the same as "application/fhir+ndjson"?

dehall commented 7 months ago

I noticed this bug too. For further context, the bulk data spec says that the abbreviation "ndjson" and "application/ndjson" SHALL be accepted the same as "application/fhir+json"

The format for the requested Bulk Data files to be generated as per FHIR Asynchronous Request Pattern. Defaults to application/fhir+ndjson. The server SHALL support Newline Delimited JSON, but MAY choose to support additional output formats. The server SHALL accept the full content type of application/fhir+ndjson as well as the abbreviated representations application/ndjson and ndjson.

https://build.fhir.org/ig/HL7/bulk-data/export.html#query-parameters