如何从 XML 中获取 MS Fhir 中的参考项目内容到 JSON 中?

huangapple go评论52阅读模式
英文:

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

问题

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:

<tr ID="ITEM_GOALXXXXX">
    <td>
        <content ID="GOAL1170275107">
            further evaluate chronic cough
        </content>
    </td>
    <td>
        <content styleCode="Bold">
            Start Date:
        </content>
        11/9/21
    </td>
    <td>
        <content styleCode="Bold">
            End Date:
        </content>
    </td>
</tr>

To refer to this and get it under the description tag in MS Fhir:

"description": {
    "text": "further evaluate chronic cough Start Date: 11/9/21 End Date:"
}

I tried referring through the 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 the description. Section: Goal

英文:

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-
&lt;text&gt;
&lt;reference value=&quot;#ITEM_GOALXXXXX&quot; /&gt;
&lt;/text&gt;
.

In the section tag above entry-

<tr ID="ITEM_GOALXXXXX">
<td>
<content ID="GOAL1170275107">
further evaluate chronic cough
</content>
</td>
<td>
<content styleCode="Bold">
Start Date:
</content>
11/9/21
</td>
<td>
<content styleCode="Bold">
End Date:
</content>
</td>
</tr>

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

答案1

得分: 0

如果文本仅出现在Composition.section.text字段中,而不在Goal.description.text中,您需要更改Composition资源,将文本手动复制到Goal.description.text中。之后,您可以将Composition资源存储在MS FHIR服务器中,根据您的需求以JSON或XML格式检索它。如果您的XML符合FHIR标准,您还可以尝试查看服务器是否支持$convert操作。此操作将允许您将XML发送到服务器并获取JSON等效内容。

英文:

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.

huangapple
  • 本文由 发表于 2023年4月11日 15:49:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/75983569.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定