0

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

Amrisha
  • 3
  • 1
  • HL7 is Medical data that is usually transferred as XML. It is complex and getting one tag in the xml is not enough info to give a proper answer. I've given lots of answers for HL7 question in the past. I would parse the XML using Powershell which can read xml and output json. – jdweng Apr 11 '23 at 10:09
  • The question is not completely clear, but I've tried to answer it anyway. @jdweng: for FHIR, we do see a lot of data being communicated with JSON instead of XML, and a tool like Powershell would most likely not be able to convert to correct FHIR JSON. – Mirjam Baltus Apr 11 '23 at 14:07

1 Answers1

0

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.

Mirjam Baltus
  • 2,035
  • 9
  • 13
  • HL7 XML is well structured and has schema to make sure data is correct format. The OP may not need to transfer data in JSON format, but instead display results to users in a web application. I still feel that Powershell is the best solution when user is not transferring data using JSON. – jdweng Apr 11 '23 at 14:23
  • @jdweng Maybe I'm mistaken, but I think the OP is talking about HL7 FHIR, which uses a specific flavor of XML / JSON. Powershell is no use for that, if you want to do something with the JSON after converting. HL7 FHIR prefers to use StructureDefinitions instead of schemas, since the schemas are too limited in expressing all of the finer details/rules for FHIR data. – Mirjam Baltus Apr 11 '23 at 19:55
  • There is no such thing as a flavor of XML except if you are referring to a schema as a flavor. Powershell you can use the Net library XElement to parse any XML file and convert to a PS object. Structure Definitions are schemas. So I have no idea what you are trying to say. I have read the HL7 specification and have helped plenty of people parse HL7 with Net Library XElement and used XML serialization in c#. Recently moved to Powershell to accomplish same tasks. – jdweng Apr 11 '23 at 21:03