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 loading is overriding default display with desgination #2809

Closed
GinoCanessa opened this issue Jun 28, 2024 · 2 comments
Closed

ValueSet loading is overriding default display with desgination #2809

GinoCanessa opened this issue Jun 28, 2024 · 2 comments

Comments

@GinoCanessa
Copy link
Contributor

Describe the bug
When loading the R5 Units of Time ValueSet (ValueSet-units-of-time.json), the concepts all have the Chinese (zh) values for the display element instead of the English value.

To Reproduce
Steps to reproduce the behavior:

  1. Load the ValueSet-units-of-time.json ValueSet from the R5 expansions package (hl7.fhir.r5.expansions#5.0.0), using the FhirJsonPocoDeserializer.
  2. Examine the Expansion.Contains elements.

Unit Test (from my project, not Hl7.Fhir) for review:

FhirJsonPocoDeserializer parser = new(new FhirJsonPocoDeserializerSettings()
{
    DisableBase64Decoding = false,
    Validator = null,
});

// always use lenient parsing
Resource parsed = parser.DeserializeResource(json);

parsed.Should().NotBeNull();
parsed.Should().BeOfType<ValueSet>();

ValueSet vs = (ValueSet)parsed;

vs.Expansion.Should().NotBeNull();
vs.Expansion.Contains.Should().NotBeEmpty();
vs.Expansion.Contains.Count.Should().Be(7);

foreach (ValueSet.ContainsComponent cc in vs.Expansion.Contains)
{
    cc.Display.Should().StartWith(cc.Code);
}

Each of the English displays match the beginning of the code values, so the test should pass. Instead it fails:

Expected cc.Display to start with "s", but "秒" differs near "秒" (index 0).

Expected behavior
The display element value should represent what is in the resource and not override with the designation value.

Screenshots
The image below is from the watch of the above unit test. The Display string should have second in it, but has the Chinese instead.

image

Version used:

  • FHIR Version: FHIR R5 5.0.0
  • Version: Hl7.Fhir.R5 version 5.8.1

Additional context

GinoCanessa added a commit to microsoft/fhir-codegen that referenced this issue Jun 28, 2024
Firely R5 is correct except for Timing, affected by FirelyTeam/firely-net-sdk#2809 .
GinoCanessa added a commit to microsoft/fhir-codegen that referenced this issue Jul 1, 2024
@ewoutkramer
Copy link
Member

I think this issue is in the wrong repo, maybe you wanted to report this to HL7?

When looking at the expansion provided in the hl7.fhir.r5.expansions#5.0.0 package NPM file I see:

"contains": [
      {
        "system": "http://unitsofmeasure.org",
        "code": "s",
        "display": "",
        "designation": [
          {
            "language": "zh",
            "value": ""
          }
        ]
      },
      {
        "system": "http://unitsofmeasure.org",
        "code": "min",
        "display": "分钟",
        "designation": [
          {
            "language": "zh",
            "value": "分钟"
          }
        ]
      },

     (etcetera)

So, it seems the expansion tooling in the Java stack is indeed overwriting the display. Not sure what to do about that here!

@GinoCanessa
Copy link
Contributor Author

Thanks, I missed that looking at compose.include, which has the correct info. Apologies!

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

2 participants