so I have this
<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns="urn:hl7-org:v3">
<realmCode code="US" />
<typeId extension="POCD_HD000040" root="2.16.840.1.113883.1.3" />
<templateId root="1.2.840.114350.1.72.1.51693" />
<templateId root="2.16.840.1.113883.10.20.22.1.1" />
<templateId root="2.16.840.1.113883.10.20.22.1.1" extension="2015-08-01" />
<templateId root="2.16.840.1.113883.10.20.22.1.2" />
<templateId root="2.16.840.1.113883.10.20.22.1.2" extension="2015-08-01" />
<id assigningAuthorityName="EPC" root="1.2.840.114350.1.13.535.2.7.8.688883.17473398" />
<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Summarization of Episode Note" />
<title>Clinical Summary</title>
<effectiveTime value="20181016153816-0400" />
<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25" displayName="Normal" />
<languageCode code="en-US" />
<setId assigningAuthorityName="EPC" extension="d5ccd6e6-4b6b-11e7-90e8-f508dff85edf" root="1.2.840.114350.1.13.535.2.7.1.1" />
<versionNumber value="31" />
<recordTarget>
This part is down lower, where I need to extract the data I need
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of Medication Usage" />
<title>Current Medications</title>
<text>
<table>
<colgroup>
<col width="25%" />
<col width="25%" />
<col width="13%" />
<col width="12%" />
<col width="8%" />
<col width="8%" />
<col width="9%" />
</colgroup>
<thead>
<tr>
<th>Prescription</th>
<th>Sig.</th>
<th>Disp.</th>
<th>Refills</th>
<th>Start Date</th>
<th>End Date</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr ID="currx6">
<td>
<paragraph ID="med6">Misc. Devices (BATH/SHOWER SEAT) Misc</paragraph>
<content styleCode="allIndent">
Indications:
<content ID="indication7">Mild cognitive impairment</content>
,
<content ID="indication8">MGD (meibomian gland disease)</content>
,
<content ID="indication9">Glaucoma suspect</content>
,
<content ID="indication10">Nuclear sclerosis</content>
</content>
</td>
<td ID="sig6">Pt needs shower/bath bar to assist with getting in and out of bath tub/shower.</td>
<td>
<paragraph>1 Units</paragraph>
</td>
<td>0</td>
<td>06/21/2013</td>
<td />
<td>Active</td>
</tr>
<tr ID="currx11">
<td>
<paragraph ID="med11">Misc. Devices (HUGO ROLLING WALKER) Misc</paragraph>
I'm pretty much trying to get the paragraph ones with the ID only. I was using this
NodeList nodeList = (NodeList) xpath.evaluate( "//*[local-name()='code'][@code='10160-0']/following-sibling::*[local-name()='text']/table/tbody/tr/td/paragraph", new InputSource(new StringReader(docString)), XPathConstants.NODESET);
but it keeps telling me I have 0 nodes... and if I make it just try to get the table it tells me I have 1 node.. but that its null.. what exactly am I doing wrong ??
SOLUTION : to get the paragraphs
//*[local-name()='code'][@code='10160-0']/following-sibling::*[local-name()='text']//*[local-name()='paragraph']
to get the ID= only ones
//*[local-name()='code'][@code='10160-0']/following-sibling::*[local-name()='text']//*[local-name()='paragraph'[@ID]]
ones and weed out the ones I dont if needed. I'll give what you said a try now
– kevin_kss Oct 16 '18 at 19:30