Skip to content

Improve error message for required ValueSet errors #550

@alexzautke

Description

@alexzautke

Error message from the .NET validator:

Code '2029-7' from system 'urn:oid:2.16.840.1.113883.6.238' does not exist in the value set 'Detailed ethnicity' (http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity) (for slice detailed)

Error message form the Java validator:

The Coding provided (urn:oid:2.16.840.1.113883.6.238#2029-7) was not found in the value set 'Detailed Ethnicity Including Absence Reasons' (http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.4.642.40.2.48.1|20250419), and a code is required from this value set.  (error message = The provided code 'urn:oid:2.16.840.1.113883.6.238#2029-7: 'Asian Indian'' was not found in the value set 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.4.642.40.2.48.1|20250419')
  1. The ", and a code is required from this value set." is helpful for understanding why the error is there in the first place. Consider adding this as well.
  2. It's helpful to differentiate in the error message between a code with a required binding and a Coding with a required binding being validated
  3. Consider including the display value in the error message for human readability

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions