hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.04k stars 1.33k forks source link

FHIR R4 structures: wrong datatype used in ElementDefinitionBindingComponent.valueSet #1075

Open ThomK opened 6 years ago

ThomK commented 6 years ago

Describe the bug We are using JPA server from master with FhirVersion R4 and uploaded the profiles from hl7.org in version 3.5.0 (http://hl7.org/fhir/2018Sep/downloads.html). The LenientParser is then saying:

[LenientErrorHandler.java:150] Unknown element 'valueSet' found while parsing

The result is that all the StructureDefinitions are persisted without the ElementDefinition.binding.valueSet properties.

The same behaviour is also with the JPA server in HAPI version 3.4.0 using R4.

After investigation we figured out that:

https://github.com/jamesagnew/hapi-fhir/blob/6e0a1dddd4b1c398b8fa71a041df83d9731cccbf/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/model/ElementDefinition.java#L3305

says that element "valueSet" is of type UriType.class or CanonicalType.class. However in R4 this field is of type canonical(ValueSet) -> http://hl7.org/fhir/2018Sep/elementdefinition-definitions.html#ElementDefinition.binding.valueSet

Also the profiles in hapi-fhir-validation-resources-r4 seem to have wrong valueSet elements (valueSetUri, valueSetCanonical).

To Reproduce Steps to reproduce the behavior:

  1. Go to http://hl7.org/fhir/2018Sep/patient.profile.xml.html and copy R4 profile of Patient
  2. POST http://hapi.fhir.org/baseR4/StructureDefinition with the patient profile
  3. Observe that the returned resource misses the valueSet fields e.g. Patient.gender misses the valueSet field pointing to the administrative-gender ValueSet

Expected behavior The expected behaviour is that the valueSet fields are properly parsed and persisted.

Environment (please complete the following information):

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

flovogt commented 4 years ago

Really sad that this issue is open so long and still no answer...