onfhir icon indicating copy to clipboard operation
onfhir copied to clipboard

Parsing bug in XML formatted responses

Open bunyaminsg opened this issue 1 year ago • 0 comments

When a domain resource has text attribute with div and status (Narrative) is requested by a query with Accept: application/fhir+xml header, it gives error response as described below.

If it's a read request as get fhir/ResourceType/id, the response is:

<OperationOutcome xmlns="http://hl7.org/fhir">
    <issue>
        <severity value="error"/>
        <code value="invalid"/>
        <diagnostics value="Problem while converting JSON to XML:Content is not allowed in prolog."/>
    </issue>
</OperationOutcome>

If it's a search requests (fhir/ResourceType?params) that results in a bundle containing that resource, the response is:

<OperationOutcome xmlns="http://hl7.org/fhir">
    <issue>
        <severity value="error"/>
        <code value="invalid"/>
        <diagnostics value="Problem while converting JSON to XML:null"/>
    </issue>
</OperationOutcome>

bunyaminsg avatar Jan 24 '23 14:01 bunyaminsg