简体   繁体   English

使用MDHT从CCD读取问题部分

[英]Read ProblemSection From CCD Using MDHT

I am trying to parse problem section in CCD using MDHT. 我正在尝试使用MDHT解析CCD中的问题部分。 The XML code I am trying to parse is: 我尝试解析的XML代码是:

<entry>
    <act classCode="ACT" moodCode="EVN">
        <templateId root="2.16.840.1.113883.10.20.22.4.3" />
        <id root="2.16.840.1.113883.3.441" extension="85cec11c26ff475fac469cc9fa7a040c" />
        <code code="CONC" codeSystem="2.16.840.1.113883.5.6" />
        <statusCode code="active" />
        <effectiveTime nullFlavor="UNK">
            <low value="20110925000000" />
            <high nullFlavor="UNK" />
        </effectiveTime>
        <entryRelationship typeCode="SUBJ" inversionInd="false">
            <observation classCode="OBS" moodCode="EVN" negationInd="false">
                <templateId root="2.16.840.1.113883.10.20.22.4.4" />
                <id root="2.16.840.1.113883.3.441.1.50.300011.51.26604.61" extension="1348" />
                <code nullFlavor="NA" />
                <text>Asthma<reference value="#ref_d910f32f622b4615970569407d739ca6_problem_name_1" />
                </text>
                <statusCode code="completed" />
                <effectiveTime nullFlavor="UNK">
                    <low value="20110925000000" />
                    <high nullFlavor="UNK" />
                </effectiveTime>
                <value xsi:type="CD" nullFlavor="UNK">
                    <translation code="195967001" displayName="Asthma" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT">
                        <originalText>
                            <reference value="#ref_d910f32f622b4615970569407d739ca6_problem_name_1" />
                        </originalText>
                    </translation>
                </value>

I want to read the translation tag (displayName="Asthma"). 我想阅读翻译标签(displayName =“ Asthma”)。 I want to read asthma, its code value and code system. 我想阅读哮喘,其代码值和代码系统。

But in MDHT I can't get translation tag inside value tag. 但是在MDHT中,我无法在value标签内获取翻译标签。 I am doing get as: 我正在做为:

entry.getAct().getEntryRelationships().get(0).getObservation().getValues().get(0) //no translation tag.

One of the advantages of using MDHT versus other JAVA/XML generations is we generate domain specific classes to help you navigate the document a bit more effectively 与其他几代JAVA / XML相比,使用MDHT的优势之一是我们生成了特定于域的类,以帮助您更有效地浏览文档

You should avoid using specific get() and generic getObservation because the underlying CDA standard constrains what is required but producers are able to place any sort of observation etc within the document. 您应该避免使用特定的get()和通用的getObservation,因为基本的CDA标准限制了所需的内容,但是生产者可以在文档中放置任何类型的观察结果。 Here is a sample snippet to walk the problem section 这是解决问题部分的示例片段

The observation class itself and as such the problem observation value is a collection of ANY which need to properly cast to get to the CD type which in turn would have the translation property you are looking for. 观察类本身以及这样的问题观察值是ANY的集合,它需要正确转换为CD类型,该CD类型将具有您要查找的转换属性。

hth Sean 希恩·肖恩

ProblemSection ps = ...
        for (ProblemConcernAct cpc : ps.getConsolProblemConcerns()) {
            for (ProblemObservation pos : cpc.getProblemObservations()) {
                for (ANY any : pos.getValues()) {
                    if (any instanceof CD) {
                        CD code = (CD) any;
                        for (CD translationCode : code.getTranslations()) {
                            System.out.println(translationCode.getCode());
                        }

                    }
                }
            }
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM