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

Namespace reset on narrative elements #81

Closed
vadimnehta opened this issue Apr 22, 2016 · 5 comments
Closed

Namespace reset on narrative elements #81

vadimnehta opened this issue Apr 22, 2016 · 5 comments

Comments

@vadimnehta
Copy link

Doing a query like http://spark.furore.com/fhir/Encounter?patient=spark2653 to sparks returns elements in the narrative with the namespace removed, like xmlns="". This isn't correct as all elements need to be in the xhtml namespace.

<Bundle xmlns="http://hl7.org/fhir">
    <id value="urn:uuid:359250d0-a37b-4736-b123-a6181bddef9a" />
    <type value="searchset" />
    <total value="1" />
    <link>
        <relation value="self" />
        <url value="http://spark.furore.com/fhir/Encounter?patient=spark2653" />
    </link>
    <link>
        <relation value="first" />
        <url value="http://spark.furore.com/fhir/_snapshot?id=dd294dec-8750-4dc5-965c-69d28ea03b20&amp;start=0" />
    </link>
    <link>
        <relation value="last" />
        <url value="http://spark.furore.com/fhir/_snapshot?id=dd294dec-8750-4dc5-965c-69d28ea03b20&amp;start=0" />
    </link>
    <entry>
        <fullUrl value="http://spark.furore.com/fhir/Encounter/spark181/_history/spark1920" />
        <resource>
            <Encounter>
                <id value="spark181" />
                <meta>
                    <versionId value="spark1920" />
                    <lastUpdated value="2016-04-21T05:01:45.585+00:00" />
                </meta>
                <text>
                    <status value="generated" />
                    <div xmlns="http://www.w3.org/1999/xhtml">
                        <p xmlns="">
                            <b>Generated Narrative with Details</b>

                        </p>
                        <p xmlns="">
                            <b>id</b>: nehta-f001
                        </p>
                        <p xmlns="">
                            <b>identifier</b>: v1451 (OFFICIAL)
                        </p>
                        <p xmlns="">
                            <b>status</b>: finished
                        </p>
                        <p xmlns="">
                            <b>class</b>: outpatient
                        </p>
                        <p xmlns="">
                            <b>type</b>: Patient-initiated encounter 
                            <span>(Details : {SNOMED CT code '270427003' = 'Patient-initiated encounter (procedure)', given as 'Patient-initiated encounter'})</span>
                        </p>
                        <p xmlns="">
                            <b>priority</b>: Non-urgent cardiological admission 
                            <span>(Details : {SNOMED CT code '310361003' = 'Non-urgent cardiological admission (procedure)', given as 'Non-urgent cardiological admission'})</span>
                        </p>
                        <p xmlns="">
                            <b>patient</b>: 
                            <a>P. van de Heuvel</a>
                        </p>
                        <h3 xmlns="">Participants</h3>
                        <table xmlns="">
                            <tr>
                                <td>-</td>
                                <td>
                                    <b>Individual</b>

                                </td>

                            </tr>
                            <tr>
                                <td>*</td>
                                <td>
                                    <a>P. Voigt</a>

                                </td>

                            </tr>

                        </table>
                        <p xmlns="">
                            <b>length</b>: 140 min
                            <span> (Details: http://unitsofmeasure.org code min = 'min')</span>
                        </p>
                        <p xmlns="">
                            <b>reason</b>: Heart valve replacement 
                            <span>(Details : {SNOMED CT code '34068001' = 'Heart valve replacement (procedure)', given as 'Heart valve replacement'})</span>
                        </p>
                        <h3 xmlns="">Hospitalizations</h3>
                        <table xmlns="">
                            <tr>
                                <td>-</td>
                                <td>
                                    <b>PreAdmissionIdentifier</b>

                                </td>
                                <td>
                                    <b>AdmitSource</b>

                                </td>
                                <td>
                                    <b>DischargeDisposition</b>

                                </td>

                            </tr>
                            <tr>
                                <td>*</td>
                                <td>93042 (OFFICIAL)</td>
                                <td>Referral by physician 
                                    <span>(Details : {SNOMED CT code '305956004' = 'Referral by physician (procedure)', given as 'Referral by physician'})</span>
                                </td>
                                <td>Discharge to home 
                                    <span>(Details : {SNOMED CT code '306689006' = 'Discharge to home (procedure)', given as 'Discharge to home'})</span>
                                </td>

                            </tr>

                        </table>
                        <p xmlns="">
                            <b>serviceProvider</b>: 
                            <a>Burgers University Medical Center</a>
                        </p>

                    </div>
                </text>
                <identifier>
                    <use value="official" />
                    <system value="http://www.amc.nl/zorgportal/identifiers/visits" />
                    <value value="v1451" />
                </identifier>
                <status value="finished" />
                <class value="outpatient" />
                <type>
                    <coding>
                        <system value="http://snomed.info/sct" />
                        <code value="270427003" />
                        <display value="Patient-initiated encounter" />
                    </coding>
                </type>
                <priority>
                    <coding>
                        <system value="http://snomed.info/sct" />
                        <code value="310361003" />
                        <display value="Non-urgent cardiological admission" />
                    </coding>
                </priority>
                <patient>
                    <reference value="http://spark.furore.com/fhir/Patient/spark2653" />
                    <display value="P. van de Heuvel" />
                </patient>
                <participant>
                    <individual>
                        <reference value="http://spark.furore.com/fhir/Practitioner/nehta-f002" />
                        <display value="P. Voigt" />
                    </individual>
                </participant>
                <length>
                    <value value="140.0" />
                    <unit value="min" />
                    <system value="http://unitsofmeasure.org/" />
                    <code value="min" />
                </length>
                <reason>
                    <coding>
                        <system value="http://snomed.info/sct" />
                        <code value="34068001" />
                        <display value="Heart valve replacement" />
                    </coding>
                </reason>
                <hospitalization>
                    <preAdmissionIdentifier>
                        <use value="official" />
                        <system value="http://www.amc.nl/zorgportal/identifiers/pre-admissions" />
                        <value value="93042" />
                    </preAdmissionIdentifier>
                    <admitSource>
                        <fhir_comments value="        &lt;preAdmissionTest&gt;&#xA;            &lt;coding&gt;&#xA;                &lt;system value=&quot;http://snomed.info/sct&quot;/&gt;&#xA;                &lt;code value=&quot;164847006&quot;/&gt;&#xA;                &lt;display value=&quot;Standard ECG&quot;/&gt;&#xA;            &lt;/coding&gt;&#xA;            &lt;coding&gt;&#xA;                &lt;system value=&quot;http://snomed.info/sct&quot;/&gt;&#xA;                &lt;code value=&quot;396550006&quot;/&gt;&#xA;                &lt;display value=&quot;Blood test&quot;/&gt;&#xA;            &lt;/coding&gt;&#xA;        &lt;/preAdmissionTest&gt;   " />
                        <coding>
                            <system value="http://snomed.info/sct" />
                            <code value="305956004" />
                            <display value="Referral by physician" />
                        </coding>
                    </admitSource>
                    <dischargeDisposition>
                        <coding>
                            <system value="http://snomed.info/sct" />
                            <code value="306689006" />
                            <display value="Discharge to home" />
                        </coding>
                    </dischargeDisposition>
                </hospitalization>
                <serviceProvider>
                    <reference value="http://spark.furore.com/fhir/Organization/nehta-f001" />
                    <display value="Burgers University Medical Center" />
                </serviceProvider>
            </Encounter>
        </resource>
    </entry>
</Bundle>
@mbaltus
Copy link
Member

mbaltus commented Apr 22, 2016

Did you upload the Encounter yourself and see that Spark removed the namespaces, or is this just an example of a resource you found where the namespaces are empty?
IMHO the namespace should just be on the <div> element, so the top level of the <text> contents.
I've tried uploading a new Encounter where I filled in the namespaces for some of the <p> and other tags within the <div>. Spark didn't remove them upon creating the Encounter and Spark shows them when I retrieve the Encounter again. So I don't see what you think Spark is doing incorrectly?

@vadimnehta
Copy link
Author

When I upload this to spark:

{
  "resourceType": "Encounter",
  "id": "nehta-f001",
  "text": {
    "status": "generated",
    "div": "<div><p><b>Generated Narrative with Details</b></p><p><b>id</b>: nehta-f001</p><p><b>identifier</b>: v1451 (OFFICIAL)</p><p><b>status</b>: finished</p><p><b>class</b>: outpatient</p><p><b>type</b>: Patient-initiated encounter <span>(Details : {SNOMED CT code '270427003' = 'Patient-initiated encounter (procedure)', given as 'Patient-initiated encounter'})</span></p><p><b>priority</b>: Non-urgent cardiological admission <span>(Details : {SNOMED CT code '310361003' = 'Non-urgent cardiological admission (procedure)', given as 'Non-urgent cardiological admission'})</span></p><p><b>patient</b>: <a>P. van de Heuvel</a></p><h3>Participants</h3><table><tr><td>-</td><td><b>Individual</b></td></tr><tr><td>*</td><td><a>P. Voigt</a></td></tr></table><p><b>length</b>: 140 min<span> (Details: http://unitsofmeasure.org code min = 'min')</span></p><p><b>reason</b>: Heart valve replacement <span>(Details : {SNOMED CT code '34068001' = 'Heart valve replacement (procedure)', given as 'Heart valve replacement'})</span></p><h3>Hospitalizations</h3><table><tr><td>-</td><td><b>PreAdmissionIdentifier</b></td><td><b>AdmitSource</b></td><td><b>DischargeDisposition</b></td></tr><tr><td>*</td><td>93042 (OFFICIAL)</td><td>Referral by physician <span>(Details : {SNOMED CT code '305956004' = 'Referral by physician (procedure)', given as 'Referral by physician'})</span></td><td>Discharge to home <span>(Details : {SNOMED CT code '306689006' = 'Discharge to home (procedure)', given as 'Discharge to home'})</span></td></tr></table><p><b>serviceProvider</b>: <a>Burgers University Medical Center</a></p></div>"
  },
  "identifier": [
    {
      "use": "official",
      "system": "http://www.amc.nl/zorgportal/identifiers/visits",
      "value": "v1451"
    }
  ],
  "status": "finished",
  "class": "outpatient",
  "type": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "270427003",
          "display": "Patient-initiated encounter"
        }
      ]
    }
  ],
  "priority": {
    "coding": [
      {
        "system": "http://snomed.info/sct",
        "code": "310361003",
        "display": "Non-urgent cardiological admission"
      }
    ]
  },
  "patient": {
    "reference": "Patient/nehta-f001",
    "display": "P. van de Heuvel"
  },
  "participant": [
    {
      "individual": {
        "reference": "Practitioner/nehta-f002",
        "display": "P. Voigt"
      }
    }
  ],
  "length": {
    "value": 140,
    "unit": "min",
    "system": "http://unitsofmeasure.org",
    "code": "min"
  },
  "reason": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "34068001",
          "display": "Heart valve replacement"
        }
      ]
    }
  ],
  "hospitalization": {
    "preAdmissionIdentifier": {
      "use": "official",
      "system": "http://www.amc.nl/zorgportal/identifiers/pre-admissions",
      "value": "93042"
    },
    "admitSource": {
      "fhir_comments": [
        "        <preAdmissionTest>\n            <coding>\n                <system value=\"http://snomed.info/sct\"/>\n                <code value=\"164847006\"/>\n                <display value=\"Standard ECG\"/>\n            </coding>\n            <coding>\n                <system value=\"http://snomed.info/sct\"/>\n                <code value=\"396550006\"/>\n                <display value=\"Blood test\"/>\n            </coding>\n        </preAdmissionTest>   "
      ],
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "305956004",
          "display": "Referral by physician"
        }
      ]
    },
    "dischargeDisposition": {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "306689006",
          "display": "Discharge to home"
        }
      ]
    }
  },
  "serviceProvider": {
    "reference": "Organization/nehta-f001",
    "display": "Burgers University Medical Center"
  }
}

and ask for XML back, some elements in the narrative obtain xmlns="", which is effectively removing the xhtml namespace on them - so it is by actually adding the namespace tag that it is removing the namespace.

@cknaap
Copy link
Member

cknaap commented Apr 26, 2016

So it seems to be in the json-xml roundtripping, which is the responsibility of the parser and serializer in the Hl7.Fhir API. I will close this issue here, but have created issue #193 on the API.

@cknaap cknaap closed this as completed Apr 26, 2016
@vadimnehta
Copy link
Author

OK! Thanks :)

@brianpos
Copy link
Contributor

brianpos commented May 4, 2016

In this example, the div doesn't have the xhtml namespace defined in the json example, so are you expecting the server to replace it?

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

4 participants