jsonxmlhl7-fhirccd

How to get reference item contents from xml to json in MS Fhir?


Section Goal- In the xml file there is a reference to a text that is being declared in the section tag, In the entry tag- <text> <reference value="#ITEM_GOALXXXXX" /> </text> .

In the section tag above entry- further evaluate chronic cough Start Date: 11/9/21 End Date:
How to refer to this so that I can get it under description tag in MS Fhir? "description": { "text": "further evaluate chronic cough Start Date:11/9/21End Date:" }, `

I tried referring through Section template in Ms Fhir but was not able to proceed with the code to get all the contents present in the tr tag as text of description. Section: Goal


Solution

  • If the text is only present in the Composition.section.text field and not in the Goal.description.text where you (also) seem to want it, you will have to change the Composition resource and manually copy the text to the Goal.description.text. After that, you can store your Composition resource in the MS FHIR Server and retrieve it as JSON or XML, depending on what you want. If your XML is valid FHIR, instead of storing the resource, you can also try and see if the server supports the $convert operation. This operation will let you send the XML to the server and get back the JSON equivalent.