2

I am trying to parse problem section in CCD using MDHT. The XML code I am trying to parse is:

<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"). I want to read asthma, its code value and code system.

But in MDHT I can't get translation tag inside value tag. I am doing get as:

entry.getAct().getEntryRelationships().get(0).getObservation().getValues().get(0) //no translation tag. 
3
  • 1
    maybe this gives you a clue how solve the issue projects.openhealthtools.org/sf/go/projects.mdht/… Commented Apr 26, 2014 at 10:30
  • Thanks that's my question asked a long ago. But this time I want to read the xml node instead of text. Anyways thanks. The solution below worked for me. Commented Apr 28, 2014 at 5:20
  • @sqlab the link is dead now [x_X] Could you please reanimate it? Commented Apr 10, 2018 at 12:16

1 Answer 1

3

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

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. 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.

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()); } } } } } 
Sign up to request clarification or add additional context in comments.

3 Comments

Also can you please provide link of any programmer guide for MDHT which contains list of such classes?
@user2418114 the link is dead now [x_X] Could you please reanimate it?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.