nhsconnect / gpconnect

GP Connect API specification
https://digital.nhs.uk/services/gp-connect/gp-connect-specifications-for-developers
Apache License 2.0
34 stars 26 forks source link

HAPI Client Issues #575

Open KevinMayfield opened 6 years ago

KevinMayfield commented 6 years ago

See also https://github.com/nhsconnect/nrls-reference-implementation/issues/4

Core issue is java libraries (HAPI FHIR) is defaulting to _format=xml which causes a 415 error from GP Connect. Have also logged on HAPI FHIR.

xml was supported on older FHIR versions.

jonnyry commented 6 years ago

Is this an issue with the demonstrator? If so could you log in that project?

nhsconnect/gpconnect-demonstrator

KevinMayfield commented 6 years ago

What is the correct behaviour for GP connect? I wasn't able to find an equivalent to this NRLS page https://developer.nhs.uk/apis/nrls/development_general_api_guidance.html

KevinMayfield commented 6 years ago

Can be closed from HAPI client perspective.

The work around for hapi client is to not use the setEncoding method:

clientGPC.setEncoding(EncodingEnum.XML);

jonnyry commented 6 years ago

See here:

https://nhsconnect.github.io/gpconnect/development_general_api_guidance.html#content-types

We don’t have universal support for XML from providing systems, so JSON is the preferred format, though some providers do support XML.

KevinMayfield commented 6 years ago

What I mean is if you support xml then the supported codes should be as per

https://www.hl7.org/fhir/http.html#mime-type

In particular "For the _format parameter, the values xml, text/xml, application/xml, and application/fhir+xml SHALL be interpreted to mean the XML format, the codes json, application/json and application/fhir+json SHALL be interpreted to mean the JSON format"

HAPI client setEncoding method uses xml or json codes which GP Connect doesn't support.

jonnyry commented 6 years ago

Hi Kev, noted.

We currently only support the formal MIME types of "application/fhir+xml" and "application/fhir+json".

Will keep this open for a future iteration.