-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
HAPI JSON parser is adding #
to contained resource IDs.
#6514
Comments
The code that adds the
|
Is this causing an issue somewhere else? This is pretty old behaviour, changing it could be a breaking change for people depending on it |
@jamesagnew you may have broken a record for quick replies. It is, in fact causing an issue. I ran into it while incrementing the core library in HAPI: #6510. hapi-fhir/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/utils/FhirPathEngineR4Test.java Lines 43 to 67 in 59cf44c
Grahame's last updates to FHIRPathEngine now expect resources to match the spec for contained resources: |
@tadgh and I looked into this after I mentioned it, and it's not just reading from JSON that displays odd behaviour. FhirTerser appears to be mutating the contained resources in a multitude of irregular ways. For example: hapi-fhir/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java Lines 1814 to 1816 in 3b85691
I've outlined a few major ones here, with FIXME annotations where the tests are producing unexpected results. |
Having discussed with james, here's what we will do:
|
Describe the bug
HAPI's JSON parser is adding
#
characters to contained resource IDs.To Reproduce
I created a breaking test in a branch:
hapi-fhir/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/JsonParserR4Test.java
Lines 1383 to 1389 in 9e9f1e6
This parses the following JSON:
Expected behavior
The JSON parser should parse the contained specimen ID as is, without adding an additional
#
.Otherwise, the parsed resource is not consistent with the FHIR specification for contained resources: https://hl7.org/fhir/r4/references.html#contained
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: