NHSDigital / integration-adaptor-lab-results

Integration Adaptor to simplify processing of Pathology and Screening results
Apache License 2.0
0 stars 6 forks source link

Invalid value for intent field causes error when parsing the FHIR output #79

Closed davesmith9088 closed 3 years ago

davesmith9088 commented 3 years ago

In the adapter output the ProcedureRequest resource has the following field:

"intent": "?"

Which causes the following error when parsing: {"While building a POCO: Literal '?' is not a valid value for enumeration 'RequestIntent' (at Bundle.entry[4].resource[0].intent[0])"}

Caused by this line: procedureRequest.setIntent(ProcedureRequestIntent.NULL); in ProcedureRequestMapper.java

andrewwa-kainos commented 3 years ago

This is because we don't know which intent is appropriate, so we are using NULL (from hapifhir), for which ProcedureRequestIntentEnumFactory#toCode returns "?".

The available encodings are: Constant Definition
PROPOSAL The request is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act
PLAN The request represents an intension to ensure something occurs without providing an authorization for others to act
ORDER The request represents a request/demand and authorization for action
ORIGINALORDER The request represents an original authorization for action
REFLEXORDER The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization
FILLERORDER The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order
INSTANCEORDER An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence. E.g. The administration of a single dose of a drug.
OPTION The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests. Refer to [[[RequestGroup]]] for additional information on how this status is used
andrewwa-kainos commented 3 years ago

NIAD-1179 raised to address

andrewwa-kainos commented 3 years ago

83 replaces NULL with ORIGINALORDER (manifesting as "intent":"original-order").

This is expected to be a temporary change to produce valid FHIR output, which may be changed again when we know what we should be using instead.

matthewdoreilly commented 3 years ago

This issue should be resolved now. https://github.com/nhsconnect/integration-adaptor-lab-results/pull/90 has updated the value set for the intent property from ORIGINALORDER to ORDER (which was agreed for pathology and screening messages). It will be represented for the procedure request resource in FHIR as "intent":"order".