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

XMLParser overwrites section.text in Composition resources #402

Closed
mbaltus opened this issue Jul 13, 2016 · 3 comments

Comments

@mbaltus
Copy link

@mbaltus mbaltus commented Jul 13, 2016

When I create a Composition resource and set its Narrative, then create some sections and set the section.text, the XML parser will generate the value of Composition.text in each of the section.text parts, instead of their real value.

@jamesagnew

This comment has been minimized.

Copy link
Owner

@jamesagnew jamesagnew commented Jul 24, 2016

Hi Mirjam,

I'm having a hard time visualizing how this works. Any chance you could paste in a code snippet or link to a resource that demonstrates this?

oliveregger added a commit to ahdis/hapi-fhir that referenced this issue May 29, 2019
oliveregger added a commit to ahdis/hapi-fhir that referenced this issue May 29, 2019
oliveregger added a commit to ahdis/hapi-fhir that referenced this issue Jun 11, 2019
oliveregger added a commit to ahdis/hapi-fhir that referenced this issue Aug 2, 2019
@oxymor0n

This comment has been minimized.

Copy link

@oxymor0n oxymor0n commented Sep 30, 2019

+1 on this issue, just encountered it myself

I parsed a Composition JSON like so:

{
  "resourceType": "Composition",
  "section": [
    {
      "entry": [
        {"reference": "#1"},
        {"reference": "#2"},
        ...
        ]
    }
  ],
  "text": {
    "div": "<div xmlns='http://www.w3.org/1999/xhtml'>some narrative here</div>",
    "status": "generated"
  }
}

which has Composition.text but no Composition.section.text

After exporting the Composition as XML, what I received is

<Composition xmlns="http://hl7.org/fhir">
   <section>
      <text>
         <status value="generated"/>
         <div xmlns="http://www.w3.org/1999/xhtml">some narrative here</div>
      </text>
      <entry>
         <reference value="#1"/>
      </entry>
      <entry>
         <reference value="#2"/>
      </entry>
      ...
   </section>
   <text>
      <status value="generated"/>
      <div xmlns="http://www.w3.org/1999/xhtml">some narrative here</div>
   </text>
</Composition>

As you can see, the Composition.text Narrative has been used to overwrite the value of Composition.section.text, which should have been null.

@jamesagnew jamesagnew closed this in eaaf276 Oct 1, 2019
jamesagnew added a commit that referenced this issue Oct 1, 2019
overwritten section text in composition  #402
@jamesagnew

This comment has been minimized.

Copy link
Owner

@jamesagnew jamesagnew commented Oct 1, 2019

@mbaltus - Sorry this took so long to close :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.