Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueSet validation fails when a custom IG defines multiple unrestricted code systems #6750

Open
dajaffe opened this issue Feb 19, 2025 · 0 comments

Comments

@dajaffe
Copy link

dajaffe commented Feb 19, 2025

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

Describe the bug
We have our own IG created with some resource's codes bound to our own internal code systems and value sets. I've noticed when a single value set includes specific codes across multiple systems, everything works as expected. However, when a value set allows all codes from multiple systems, the resource attribute bound to that value set is set as Required (not preferred) validation fails with a Terminology_PassThrough_TX_Message.

To Reproduce
Steps to reproduce the behavior:

  1. Create an IG where a resource's code attribute has a required binding to a custom valueset with multiple code systems.
  2. Attempt to validate or save a resource where that attribute's code is set as a code value from any of those code systems within the required valueset.

Sample ValueSet FSH. Note that we have aliases defined for the given systems.

ValueSet: ObservationMethod
Id: observation-method
Title: "Observation Method"
Description: "Set of observation methods accepted"

* ^url = $observation-method-vs
* ^status = #active
* ^version = "0.1"

* include codes from system $observation-method-cs
* include codes from system $snomed-cs
* include codes from system $loinc-cs

Enforcement in an Observation profile:

Profile: ObservationGeneric
Parent: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation
Description: "Generic profile of Observation"

...

* method MS
* method from ObservationMethod (required)
...

Expected behavior
Any codevalue from all code systems specified in the valueset pass validation.

Error response:

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "extension": [
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-line",
                    "valueInteger": 25
                },
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col",
                    "valueInteger": 10
                },
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-message-id",
                    "valueString": "Terminology_PassThrough_TX_Message"
                }
            ],
            "severity": "information",
            "code": "processing",
            "details": {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/java-core-messageId",
                        "code": "Terminology_PassThrough_TX_Message"
                    }
                ]
            },
            "diagnostics": "Unable to expand ValueSet because CodeSystem could not be found: http://loinc.org",
            "location": [
                "Observation.code",
                "Line[25] Col[10]"
            ]
        },
        {
            "extension": [
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-line",
                    "valueInteger": 78
                },
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col",
                    "valueInteger": 10
                },
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-message-id",
                    "valueString": "Terminology_PassThrough_TX_Message"
                }
            ],
            "severity": "error",
            "code": "processing",
            "details": {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/java-core-messageId",
                        "code": "Terminology_PassThrough_TX_Message"
                    }
                ]
            },
            "diagnostics": "Unable to expand ValueSet because CodeSystem could not be found: http://loinc.org (error because this is a required binding)",
            "location": [
                "Observation.method",
                "Line[78] Col[10]"
            ]
        },
        {
            "extension": [
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-line",
                    "valueInteger": 78
                },
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col",
                    "valueInteger": 10
                },
                {
                    "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-message-id",
                    "valueString": "Terminology_TX_NoValid_1_CC"
                }
            ],
            "severity": "error",
            "code": "processing",
            "details": {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/java-core-messageId",
                        "code": "Terminology_TX_NoValid_1_CC"
                    }
                ]
            },
            "diagnostics": "None of the codings provided are in the value set 'Observation Method' (https://fhir-ig.<redacted>.com/ValueSet/observation-method|0.1), and a coding from this value set is required) (codes = http://loinc.org#34391-3)",
            "location": [
                "Observation.method",
                "Line[78] Col[10]"
            ]
        }
    ]
}

Environment (please complete the following information):

  • HAPI FHIR Version: 7.4.5
  • OS: [e.g. iOS] Dockerized
  • Browser [e.g. chrome, safari] N/A

Additional context
Add any other context about the problem here.

@dajaffe dajaffe changed the title ValueSet validation fails when a custom IG defines multiple unrestricted code sets ValueSet validation fails when a custom IG defines multiple unrestricted code systems Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant