Referencing CCDA elements in a custom class

Primary tabs

Caché, Ensemble

I've created a CCDA schema with from an xsd ad now am trying to reference the CCDA elements in a custom class (process). What is the syntax for referencing my CCDA elements?

I've tried the following

Method OnRequest(pRequest As EnsLib.EDI.XML.Document, Output pResponse As Ens.Response) As %Status
// constructing PDQ Request
    set tPDQRequest = ##class(HS.Message.PatientSearchRequest).%New()
    $$$LOGINFO("Starting Process")
    set tPDQRequest.Title=pRequest.GetValueAt("/title")
    $$$LOGINFO("Title: "_tPDQRequest.Title)
    set tPDQRequest.LastName=pRequest.GetValueAt("/recordTarget(1)/patientRole/patient/name(1)/choice(1)/family")

    $$$LOGINFO("LastName: "_tPDQRequest.LastName)

None of my log statements output anything. Any hints would be appreciated.


Hi Lewis,

In your path expression, try all of this together:

- If this is a CCDA document, it seems like each path that you showed should start with "/hl7:ClinicalDocument".

- Use square brackets instead of parentheses.

- Prefix each element with "hl7:".

For example "/hl7:ClinicalDocument/hl7:title".



So, I am able to reference the elements in the CCDA as follows:

The address:  <streetAddressLine>123 FAKE ST</streetAddressLine>

I reference as pRequest.GetValueAt("/ClinicalDocument/recordTarget/patientRole/addr/streetAddressLine") and I get my value. But when the source field has just a value or code, I’m not sure of the syntax on the GetValueAt:

 e.g. <administrativeGenderCode code="M" codeSystem="2.16.840.1.113883.5.1" displayName="Male" />

 OR <birthTime value="19560816" />


Any hints would be appreciated.



Add "/@value" or "/@code" to the end of your path expression.