Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML encoded FHIR resource created with decimal element that has leading plus sign value couldn't be retrieved or modified #5667

Closed
volodymyr-korzh opened this issue Feb 5, 2024 · 0 comments · Fixed by #5670
Assignees

Comments

@volodymyr-korzh
Copy link
Collaborator

It is possible to create resource with decimal element that has leading plus sign using XML encoding.
However, this resource couldn't be modified/retrieved/deleted to fix the leading plus sign.

  1. Start an instance of HAPI-FHIR server with disabled request validation for the FHIR endpoint.
  2. POST an xml bundle with a resource that has a leading plus sign in a decimal element:
Bundle with Observation

POST: http://localhost:8000/
Content-Type : application/xml

<Bundle
	xmlns="http://hl7.org/fhir" >
	<type value="transaction"/>
	<entry>
		<fullUrl value="urn:uuid:d403a26d-d5d3-47a0-8cac-0511757c5f51"/>
		<resource>
			<Observation>
				<identifier>
					<system value="http://test.com/fhir/test"/>
					<value value="o_test"/>
				</identifier>
				<status value="preliminary"/>
				<category>
					<coding>
						<system value="http://terminology.hl7.org/CodeSystem/observation-category"/>
						<code value="vital-signs"/>
						<display value="Vital Signs"/>
					</coding>
				</category>
				<code>
					<coding>
						<system value="http://loinc.org"/>
						<code value="29463-7"/>
						<display value="Body Weight"/>
					</coding>
				</code>
				<referenceRange>
					<low>
						<value value="-3.0"/>
						<unit value="mmol/l"/>
						<system value="http://Home" />
						<code value="mmol/l"/>
					</low>
					<high>
						<value value="+3.0"/>
						<unit value="mmol/l"/>
						<system value="http://Home" />
						<code value="mmol/l"/>
					</high>
					<text value="-3.0 mmol/l - +3.0 mmol/l"/>
				</referenceRange>
			</Observation>
		</resource>
		<request>
			<method value="PUT"/>
			<url value="Observation?identifier=http://test.com/fhir/test|o_test"/>
		</request>
	</entry>
</Bundle>
  1. Execute GET operation for created Observation:
    GET: http://localhost:8000/Observation/3002

Expected behaviour:
Observation successfully retrieved and decimal element referenceRange.high.value has correct value (3.0 instead of +3.0):

	<referenceRange>
		...
		<high>
			<value value="3.0"/>
			<unit value="mmol/l"/>
			<system value="Home"/>
			<code value="mmol/l"/>
		</high>
		<text value="-3.0 mmol/l - +3.0 mmol/l"/>
	</referenceRange>

Actual result:
Observation couldn't be retrieved, error is returned.

<OperationOutcome
	xmlns="http://hl7.org/fhir">
	<issue>
		<severity value="error"/>
		<code value="processing"/>
		<diagnostics value="HAPI-2223: HAPI-0928: Failed to parse database resource[Observation/3002 (pid 3002, version R4): HAPI-1861: Failed to parse JSON encoded FHIR content: Unexpected character ('+' (code 43)) in numeric value: JSON spec does not allow numbers to have plus signs: enable `JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS` to allow&#xa; at [line: 1, column: 472]"/>
	</issue>
</OperationOutcome>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant