hapifhir / hapi-fhir

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

ILS profile is not getting validated properly #6255

Open abhijitjanardantiwari opened 2 weeks ago

abhijitjanardantiwari commented 2 weeks ago

NOTE: Before filing a ticket, please see the following URL: https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help

Describe the bug Different value code system has been defined for different accessory in ILS FHIR profiles. When we run ILS FHIR profile test cases, Its getting validated correctly but not validated with library.

Value code system example:

Here, we can see code has been defined seperatly for Cushion and Headgear Headgear code should not be allowed in Cushion and vice versa and this validation happening correctly with ILS FHIR profile test cases. But with library it allowing to pass code from one accessory to other.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior One accessory code should not be allowed for other accessory.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

jamesagnew commented 2 weeks ago

Can you please provide a complete unit test code example which demonstrates the issue you are having?

abhijitjanardantiwari commented 1 week ago

I am providing you json request here. We have properties field, inside that type and value code is there. If we provide some other device type and value code its not getting validated. I am also providing our FHIR profiles for your reference. Thease are .fsh files. if we provide some other valuecode other than mask like "cushion.size.l" then its not validating. If we provide out side value code which is not defined in codes system file like "mask.size.abc" then its getting validated like "code is not defined"

Profile : Profile: AmpmMaskAccessory Parent: AmpmDeviceAccessory Id: AmpmMaskAccessory Description: "This profile covers the Mask accessory accepted by Ampm."

Invariant: meta.profile.AmpmMaskAccessory Description: "SHOULD claim meta.profile conformance to https://www.fhir.philips.com/4.0/uv/ampm/StructureDefinition/meta.profile.AmpmMaskAccessory ." Severity: #warning Expression: "profile.where($this='https://www.fhir.philips.com/4.0/uv/ampm/StructureDefinition/AmpmMaskAccessory').exists()"

AmpmMaskPropertiesValueSet ValueSet: AmpmMaskPropertiesValueSet Id: AmpmMaskPropertiesValueSet Description: "Valueset containing the allowed porperties"

AmpmDeviceAccessoryPropertiesValuesCodeSystem

CodeSystem: AmpmDeviceAccessoryPropertiesValuesCodeSystem Id: AmpmDeviceAccessoryPropertiesValuesCodeSystem Title: "AmpmDeviceAccessoryPropertiesValuesCodeSystem" Description: "AmpmDeviceAccessoryPropertiesValuesCodeSystem"

JSON Request:

{ "resourceType": "Device", "meta": { "profile": [ "https://www.fhir.philips.com/4.0/uv/ampm/StructureDefinition/AmpmMaskAccessory" ] }, "identifier": [ { "system": "http://hl7.org/fhir/sid/imei", "value": "986278381748783" }, { "system": "http://www.philips.com/myvirtualcare/deviceMaster", "value": "D117929" } ], "status": "active", "manufacturer": "Philips", "manufactureDate": "2000-04-03", "expirationDate": "2022-04-05", "serialNumber": "dsn-22", "deviceName": [ { "name": "Mask", "type": "user-friendly-name" }, { "name": "Mask1", "type": "model-name" }, { "name": "261382003", "type": "other" } ], "modelNumber": "A1-FXAC1193", "type": { "coding": [ { "system": "http://snomed.info/sct", "code": "277973009", "display": "Respiratory Equipment" } ] }, "property": [ { "type": { "coding": [ { "code": "mask.size", "system": "https://www.fhir.philips.com/4.0/uv/ampm/CodeSystem/AmpmDeviceAccessoryPropertiesValuesCodeSystem", "display": "Size" } ] }, "valueCode": [ { "coding": [ { "code": "mask.size.l", "system": "https://www.fhir.philips.com/4.0/uv/ampm/CodeSystem/AmpmDeviceAccessoryPropertiesValuesCodeSystem", "display": "Large" } ] } ] } ], "extension": [ { "url": "https://www.fhir.philips.com/4.0/uv/ampm/StructureDefinition/AmpmAccessoryResupplyEligibilityDateExtension", "valueDateTime": "2022-08-08T02:01:40+00:00" } ] }