FirelyTeam / firely-validator-api

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

FhirPath's isDistinct doesn't always work #294

Closed luisgmgouveia closed 1 week ago

luisgmgouveia commented 6 months ago

Hi,

This week our team replaced the R5 legacy validator by this new one released this year (v2.1.0). We had some hope the new one would solve an issue we had on FhirPaths. Unfortunately it didn't.

The problem is that, while this FhirPath expression (applied on PackagedProductDefinition.legalStatusOfSupply) works:

- jurisdiction.extension.where(url = 'http://ema.europa.eu/fhir/extension/countryLegalStatusOfSupply').isDistinct()

This one is ignored:

- jurisdiction.extension.where(url = 'http://ema.europa.eu/fhir/extension/countryLegalStatusOfSupply').valueCodeableConcept.coding.code.isDistinct()

That means we are able to make sure that the entire extension does not repeat, but we can't make sure that the code doesn't repeat.

In the java validator (validator_cli.jar) both work fine. On the Firely validator, only the first one works.

Thanks a lot!

mmsmits commented 1 week ago

jurisdiction.extension.where(url = 'http://ema.europa.eu/fhir/extension/countryLegalStatusOfSupply').valueCodeableConcept.coding.code.isDistinct()

seems incorrect, it should be

jurisdiction.extension.where(url = 'http://ema.europa.eu/fhir/extension/countryLegalStatusOfSupply').value.ofType(CodeableConcept).coding.code.isDistinct()