FirelyTeam / firely-validator-api

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

Validating an element of type CodeableReference will fail if it's a reference #281

Closed ewoutkramer closed 6 months ago

ewoutkramer commented 6 months ago

Description

If a CodeableReference has a concept, all will be fine, but when it encounters a CodeableReference with just reference set, you will get a message like Type 'CodeableReference' is bindable, but could not be parsed..

Analysis

The ParseBindable function used by the validator will return null when it parses a CodeableReference without a concept - this is incorrectly interpreted as having a bindeable element without data (About which we complain). For all cases except CodeableReference this was a reasonable (if overzealous) error, but not in this case.

Solution

If we know that an element is bindable (and we do), but then there is no bindeable data in it, we should just remain silent.

ewoutkramer commented 6 months ago

Note: this error was found by a unit test in the Legacy validator. This means that: