FirelyTeam / firely-validator-api

Firely's official FHIR validator API for validating HL7 FHIR resources against profiles.
Other
7 stars 2 forks source link

When evaluating slicing, validator does not recognize subelement as fixed via pattern on parent #336

Open wardweistra opened 1 month ago

wardweistra commented 1 month ago

Describe the bug See https://chat.fhir.org/#narrow/stream/291844-FHIR-Validator/topic/Da.20Vinci.20CRD.20Profile.20Patient.20and.20PatientDeident.20failling/near/451738203

To Reproduce

  1. Validate the below example against hl7.fhir.us.davinci-crd 2.0.1 package, eg with https://simplifier.net/validator

Expected behavior No error

Example:

{
    "resourceType": "Patient",

"meta": {

"lastUpdated": "2024-07-15T00:00:00-07:00",
"profile": "http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-patient",

},

"extension": [{

"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",

"extension": [{

"url": "ombCategory",

"valueCoding": {

"system": "urn:oid:2.16.840.1.113883.6.238",

"code": "2106-3",

"display": "White"

}

}, {

"url": "text",

"valueString": "White"

}

]

}, {

"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",

"extension": [{

"url": "ombCategory",

"valueCoding": {

"system": "urn:oid:2.16.840.1.113883.6.238",

"code": "2135-2",

"display": "Hispanic or Latino"

}

}, {

"url": "text",

"valueString": "Hispanic or Latino"

}

]

}

],

"identifier": [{

"type": {

"coding": [{

"system": "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType",

"code": "um",

"display": "Unique Member ID"

}

]

},

"system": "someOrg.org/med/member-id",

"value": "100"

}, {

"type": {

"coding": [{

"system": "http://terminology.hl7.org/CodeSystem/v2-0203",

"code": "MB",

"display": "Member Number"

}, {

"system": "http://terminology.hl7.org/CodeSystem/v2-0203",

"code": "MR",

"display": "Medical record number"

}

]

},

"system": "someOrg.org/med/member-number",

"value": "60000000000100"

}

],

"active": true,

"name": [{

"family": "Oelkers",

"given": ["Cullin", "Oelkers"],

"prefix": ["Mr."]

}

],

"telecom": [{

"system": "phone",

"value": "1669957156",

"use": "home"

}, {

"system": "phone",

"value": "1688696772",

"use": "home"

}, {

"system": "phone",

"value": "1318468804",

"use": "home"

}, {

"system": "email",

"value": "Cullin.Oelkers999@gxmail.com"

}

],

"gender": "male",

"birthDate": "1933-11-03",

"address": [{

"use": "home",

"type": "both",

"line": ["4538 ARROWROOT"],

"city": "SALTON CITY",

"state": "CA",

"postalCode": "92274",

"period": {

"start": "0001-01-01",

"end": "9999-12-31"

}

}, {

"use": "home",

"type": "both",

"line": ["360 EAST F ST"],

"city": "REDLANDS",

"state": "CA",

"postalCode": "92375",

"period": {

"start": "2020-01-01",

"end": "9999-12-31"

}

}

],

"communication": [{

"language": {

"coding": [{

"system": "urn:ietf:bcp:47",

"code": "en",

"display": "English"

}, {

"system": "urn:ietf:bcp:47",

"code": "es",

"display": "Spanish; Castilian"

}

]

}

}

]

}
wardweistra commented 1 month ago

As commented on Zulip, I think this slicing on two elements is probably a mistake. But the fact that the (old?) validator doesn't seem to recognize that the subelement is fixed when a pattern is set on the parent could be indicative of a real issue.

First steps for someone picking this up:

wardweistra commented 1 month ago

Implementer reported to be encountering this while using firely.fhir.validation.r4 (2.3.0)