Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Model Driven Health Tools » Using CDAUtil's Load(Accessing individual sections using CDAUtil's load)
Using CDAUtil's Load [message #1771018] Mon, 21 August 2017 08:22 Go to next message
Karthik Muthukumaraswamy is currently offline Karthik MuthukumaraswamyFriend
Messages: 3
Registered: August 2017
Junior Member
Hello Community,
I have downloaded MDHT Runtimes from the following location.

LINK:
github.com/mdht/mdht-models

/releases/download/v3.0.0.20170725_Consol2/MDHT_CCDA_R2.1_R1.1_MU2_20170725_build.zip

I believe they are the latest Runtimes (as it shows version 3.0.0.xxx).

After that, I followed the examples provided in the following page:

www.cdatools.com/docs/

developeruserguide/org.openhealthtools.mdht.cda.doc.developerguide/tasks/t_Consume_CDA.html

The following code throws a ClassCastException as already discussed in a different post in the MDHT community forum. (Google for 'eclipse ClinicalDocumentImpl cannot be cast ContinuityOfCareDocument' and the first result is the topic I am talking about).

ContinuityOfCareDocument ccdDocument1 =
 (ContinuityOfCareDocument) CDAUtil.load(new FileInputStream("/tmp/SampleCCDDocument.xml"), result);


java.lang.ClassCastException: org.eclipse.mdht.uml.cda.impl.ClinicalDocumentImpl cannot be cast to org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument


So, I tried to do this instead:

ClinicalDocument ccdDocument = (ClinicalDocument) CDAUtil
                    .load(new FileInputStream("/tmp/SampleCCDDocument.xml"), result);


This compiled/ran fine without any exceptions and I am able to get the list of document sections, their codes etc... as shown in the following code.

EList<Section> sections = ccdDocument.getAllSections();
            System.out.println("# of sections (==> " + sections.size());
            for (Section sec : sections) {
                System.out.println("Section code ==> " + sec.getCode().getCode() + ", # of entries  ==> "
                        + sec.getEntries().size() + ", class code ==> " + sec.getClassCode().getName()
                        + ", template ID ==> " + sec.getTemplateIds().get(0) + ", type ID ==>" + sec.getTypeId()
                        + ", title ==> " + sec.getTitle());

            }



But, on the other hand, querying for a specific section does not return anything.

Query query = new Query(ccdDocument); 
            AdvanceDirectivesSection section = query.getSection(AdvanceDirectivesSection.class);



FYI, I am following the examples provided in the link below to query for a specific document section:

LINK:
www.cdatools.com

/docs/developeruserguide/org.openhealthtools.mdht.cda.doc.developerguide/tasks/t_Query_CDA.html

Please see the sample CCD document I am using for this Query exercise.

Please let me know if I am missing anything. I would like to use the MDHT API to parse the CDA documents.

regards,
Karthik

Re: Using CDAUtil's Load [message #1771077 is a reply to message #1771018] Mon, 21 August 2017 18:19 Go to previous messageGo to next message
Sean Muir is currently offline Sean MuirFriend
Messages: 63
Registered: September 2015
Member
Most of the results depend on the contents of the document and which libraries you have loaded; The samples on CDATools are a bit dated

There are some updated ones here

https://github.com/mdht/mdht-models/tree/develop/examples


in particular you can use the maven one
Re: Using CDAUtil's Load [message #1771078 is a reply to message #1771018] Mon, 21 August 2017 18:19 Go to previous messageGo to next message
Sean Muir is currently offline Sean MuirFriend
Messages: 63
Registered: September 2015
Member
Most of the results depend on the contents of the document and which libraries you have loaded; The samples on CDATools are a bit dated

There are some updated ones here

https://github.com/mdht/mdht-models/tree/develop/examples


in particular you can use the maven one
Re: Using CDAUtil's Load [message #1771149 is a reply to message #1771078] Tue, 22 August 2017 13:37 Go to previous messageGo to next message
Karthik Muthukumaraswamy is currently offline Karthik MuthukumaraswamyFriend
Messages: 3
Registered: August 2017
Junior Member
Hi Sean,
Thank you for your reply.

I tried out my code with different samples available in the link you provided, but with no luck. Let me elaborate what I have now:

1) I am able to successfully load a ClinicalDocument from the sample CCDA example.

2) I am able to print out all the meta information for the clinical documents (i.e., author, title, mood code, record targets size etc...)

3) I am able to print the list of section codes available in the document.

4) I am NOT able to access a section (eg., MedicationSection) from the loaded clinical document. For example:

MedicationsSection medSect = ccdDocument.getMedicationsSection();
 System.out.println("medSect id = " + medSect.getSectionId());


I am wondering whether I am including all the relevant libraries (JARs) so that access by specific section is also possible.

Could you please point me to a project/article that outlines all the required mdht and non-mdht libraries that will be required to achieve what I am trying to do.

Thanks for your help!
Karthik
Re: Using CDAUtil's Load [message #1771367 is a reply to message #1771149] Thu, 24 August 2017 11:45 Go to previous messageGo to next message
Karthik Muthukumaraswamy is currently offline Karthik MuthukumaraswamyFriend
Messages: 3
Registered: August 2017
Junior Member
Hi Sean,
I was able to make some progress with a Discharge Summary example and a different CCD example.

Thanks for your help!

regards,
Karthik
Re: Using CDAUtil's Load [message #1773451 is a reply to message #1771367] Thu, 28 September 2017 03:46 Go to previous message
peter  wachira is currently offline peter wachiraFriend
Messages: 1
Registered: September 2017
Junior Member
HI Karthik,
The consolidated (you can look it up) CDA is the way to go; plus use loadAs method of CDAUtil
So something like
ContinuityOfCareDocument ccd = (ContinuityOfCareDocument) CDAUtil.loadAs(dataHandler.getInputStream() /*or whatever inputstream you have*/
, ConsolPackage.eINSTANCE.getContinuityOfCareDocument());
Previous Topic:cda dependency
Next Topic:How to set sdtc:deceasedInd on a patient
Goto Forum:
  


Current Time: Wed Apr 24 14:51:13 GMT 2024

Powered by FUDForum. Page generated in 0.03253 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top