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

Context Validation not working as expected #402

Open
NilsFa1 opened this issue Dec 19, 2024 · 2 comments
Open

Context Validation not working as expected #402

NilsFa1 opened this issue Dec 19, 2024 · 2 comments

Comments

@NilsFa1
Copy link

NilsFa1 commented Dec 19, 2024

I am currently encountering errors related to the context of an extension.

The extension is located within the Human.family element, and error indicates that the extension is expected to be inside the Human.family element. Am I understanding this correctly, or could there be a misunderstanding?

[ERROR] Extension used outside of appropriate contexts. Expected context to be one of: {ELEMENT,HumanName.family} (at Bundle.entry[1].resource[0].name[0].family[0].extension[0]

The Element:

            <name>
               <use value="official"/>
               <family value="LastnameExample">
                  <extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-name">
                     <valueString value="LastnameExample"/>
                  </extension>
               </family>
               <given value="FirstNameExample"/>
            </name>
@mmsmits
Copy link
Member

mmsmits commented Dec 19, 2024

Thanks for reporting!

This looks like a bug indeed.
Would you be willing to send us the profiles (including the extension) or the package URL you validate against?
And it would also be helpful to have the entire example.

@NilsFa1
Copy link
Author

NilsFa1 commented Dec 19, 2024

The Package I use:
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"

An Example to reproduce is:

<Bundle xmlns="http://hl7.org/fhir">
   <id value="12dc6158-54f3-449d-95e2-33f51d145ab7"/>
   <meta>
      <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_MIO_ULB_Bundle|1.0.0"/>
   </meta>
   <identifier>
      <system value="urn:ietf:rfc:3986"/>
      <value value="urn:uuid:631252f3-bc32-4d69-82c4-71858169ce17"/>
   </identifier>
   <type value="document"/>
   <timestamp value="2024-08-01T11:35:43.1835703+02:00"/>
   <entry>
      <fullUrl value="urn:uuid:1c2c2ff8-86d2-491f-aff7-7ebe23a23ea3"/>
      <resource>
         <Composition>
            <id value="1c2c2ff8-86d2-491f-aff7-7ebe23a23ea3"/>
            <meta>
               <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_MIO_ULB_Composition|1.0.0"/>
            </meta>
            <text>
               <status value="extensions"/>
               <div xmlns="http://www.w3.org/1999/xhtml">
                  <h1>Composition</h1>
               </div>
            </text>
            <status value="final"/>
            <type>
               <coding>
                  <system value="http://snomed.info/sct"/>
                  <version value="http://snomed.info/sct/900000000000207008/version/20220331"/>
                  <code value="721919000"/>
                  <display value="Nurse discharge summary (record artifact)"/>
               </coding>
            </type>
            <subject>
               <reference value="urn:uuid:6217f8ca-d404-436f-bf69-5bc9569a7374"/>
            </subject>
            <date value="2024-08-01T11:35:43.3954575+02:00"/>
            <author>
               <reference value="urn:uuid:e9ae3468-366b-4976-a0d5-0b6fb7c7ef5e"/>
            </author>
            <title value="Überleitungsbogen"/>
            <section>
               <title value="Pflegegrad"/>
               <code>
                  <coding>
                     <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_MIO_ULB_Section_Codes"/>
                     <version value="1.0.0"/>
                     <code value="SectionPflegegrad"/>
                     <display value="Bereich Pflegegrad"/>
                  </coding>
               </code>
               <entry>
                  <reference value="urn:uuid:9fb6a081-512e-4e21-a237-4563042181db"/>
               </entry>
            </section>
         </Composition>
      </resource>
   </entry>
   <entry>
      <fullUrl value="urn:uuid:6217f8ca-d404-436f-bf69-5bc9569a7374"/>
      <resource>
         <Patient>
            <id value="6217f8ca-d404-436f-bf69-5bc9569a7374"/>
            <meta>
               <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_MIO_ULB_Patient|1.0.0"/>
            </meta>
            <text>
               <status value="extensions"/>
               <div xmlns="http://www.w3.org/1999/xhtml">
                  <h1>Patient</h1>
               </div>
            </text>
            <name>
               <use value="official"/>
               <family value="LastnameExample">
                  <extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-name">
                     <valueString value="LastnameExample"/>
                  </extension>
               </family>
               <given value="FirstNameExample"/>
            </name>
            <gender value="female"/>
            <birthDate value="1935-05-05"/>
            <address>
               <use value="home"/>
               <type value="both"/>
               <text value="Street 123, 39078 ExampleCity"/>
               <line value="Street 123">
                  <extension url="http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName">
                     <valueString value="Street"/>
                  </extension>
                  <extension url="http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber">
                     <valueString value="123"/>
                  </extension>
               </line>
               <city value="ExampleCity"/>
               <postalCode value="39078"/>
               <country value="D"/>
            </address>
         </Patient>
      </resource>
   </entry>
   <entry>
      <fullUrl value="urn:uuid:9fb6a081-512e-4e21-a237-4563042181db"/>
      <resource>
         <Observation>
            <id value="9fb6a081-512e-4e21-a237-4563042181db"/>
            <meta>
               <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_MIO_ULB_Observation_Care_Level|1.0.0"/>
            </meta>
            <text>
               <status value="extensions"/>
               <div xmlns="http://www.w3.org/1999/xhtml">
                  <h1>Pflegegrad</h1>
               </div>
            </text>
            <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_MIO_ULB_Status_Care_Level">
               <valueCodeableConcept>
                  <coding>
                     <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_MIO_ULB_Application_Status_Care_Level"/>
                     <version value="1.0.0"/>
                     <code value="Pflegegrad_bewilligt"/>
                     <display value="Pflegegrad bewilligt"/>
                  </coding>
               </valueCodeableConcept>
            </extension>
            <extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_MIO_ULB_Application_Status">
               <extension url="antragsstatusPflegegrad">
                  <valueCodeableConcept>
                     <coding>
                        <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_MIO_ULB_Application_Status_Care_Level"/>
                        <version value="1.0.0"/>
                        <code value="Beantragung_mit_Pflegegradzuweisung_abgeschlossen"/>
                        <display value="Beantragung mit Pflegegradzuweisung abgeschlossen"/>
                     </coding>
                  </valueCodeableConcept>
               </extension>
            </extension>
            <status value="final"/>
            <code>
               <coding>
                  <system value="http://loinc.org"/>
                  <version value="2.72"/>
                  <code value="80391-6"/>
                  <display value="Level of care [Type]"/>
               </coding>
            </code>
            <subject>
               <reference value="urn:uuid:6217f8ca-d404-436f-bf69-5bc9569a7374"/>
            </subject>
            <effectivePeriod>
               <start value="2023-04-18"/>
               <end value="9999-12-31"/>
            </effectivePeriod>
            <valueCodeableConcept>
               <coding>
                  <system value="http://fhir.de/CodeSystem/bfarm/ops"/>
                  <version value="1.0.0"/>
                  <code value="9-984.a"/>
                  <display value="Pflegebedürftig nach Pflegegrad 5"/>
               </coding>
            </valueCodeableConcept>
         </Observation>
      </resource>
   </entry>
   <entry>
      <fullUrl value="urn:uuid:e9ae3468-366b-4976-a0d5-0b6fb7c7ef5e"/>
      <resource>
         <Organization>
            <id value="e9ae3468-366b-4976-a0d5-0b6fb7c7ef5e"/>
            <meta>
               <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_MIO_ULB_Organization|1.0.0"/>
            </meta>
            <text>
               <status value="extensions"/>
               <div xmlns="http://www.w3.org/1999/xhtml">
                  <h1>entsendende Einrichtung</h1>
               </div>
            </text>
            <type>
               <coding>
                  <system value="http://snomed.info/sct"/>
                  <version value="1.0.0"/>
                  <code value="43741000"/>
                  <display value="Site of care (environment)"/>
               </coding>
            </type>
            <name value="SendingAuthor"/>
            <telecom>
               <system value="phone"/>
               <value value="0000111"/>
            </telecom>
         </Organization>
      </resource>
   </entry>
</Bundle>

I hope this information proves useful in resolving the issue.

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