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.

 

Thanks.

Any hints on the syntax? I've tried

HL7.{OBXgrp(1).OBX:ObservationValue(1)} Matches ?3N

HL7.{OBXgrp(1).OBX:ObservationValue(1)} Matches ?"-"

The following: HL7.{OBXgrp(1).OBX:ObservationValue(1)} Matches "?.A"

gives me the following error:

 ERROR <Ens>ErrBPTerminated: Terminating BP iSirona_Proc2 # due to error: ERROR <Ens>ErrException: <SYNTAX>zMatches+1 ^Ens.Util.FunctionSet.1 -- logged as '-'
number - @'
Quit $S(""=$g(pattern):""=$g(value), 1:$g(value)?@$g(pattern)) }'
> ERROR <Ens>ErrException: <SYNTAX>zMatches+1 ^Ens.Util.FunctionSet.1 -- logged as '-'
number - @'
Quit $S(""=$g(pattern):""=$g(value), 1:$g(value)?@$g(pattern)) }'

This is in a routing rule, so when I have:

when HL7.{OBXgrp(1).OBX:ObservationValue(1)} Matches "[a-z]"

and when I run a message through I get the following error:

 ERROR <Ens>ErrBPTerminated: Terminating BP iSirona_Proc2 # due to error: ERROR <Ens>ErrException: <SYNTAX>zMatches+1 ^Ens.Util.FunctionSet.1 -- logged as '-'
number - @'
Quit $S(""=$g(pattern):""=$g(value), 1:$g(value)?@$g(pattern)) }'
> ERROR <Ens>ErrException: <SYNTAX>zMatches+1 ^Ens.Util.FunctionSet.1 -- logged as '-'
number - @'
Quit $S(""=$g(pattern):""=$g(value), 1:$g(value)?@$g(pattern)) }'

FWIW, I ended up creating  a custom method that turned out to be very easy and used the method as a function in my routing rule:

/// Get the alert group of the given component
ClassMethod GetAlertGroup(ComponentName As %String) As %String
{
Set tAlertGroup = ##class(Ens.Director).GetHostSettingValue(ComponentName,"AlertGroups")

Quit tAlertGroup
}

Solved. I added a code statement as the first line of my DTL as follows:

 set target = ##class(EnsLib.HL7.Message).ImportFromString(source.SchedulingData)
 set target.DocType = ##class(EnsLib.HL7.Schema).ResolveSchemaTypeToDocType("2.3.1","SIU_S12",tSC)

This loaded my HL7 class with the message from my SQL table field.

Thanks to David for steering me in the right direction.

The SQLSIUInRequest class just looks like this:

Property CounterID As %Integer;
Property Enumber As %String;
Property SourceIDType As %String;
Property EpicProviderID As %String;
Property EpicDepartmentID As %String;
Property SchedulingData As %String(MAXLEN = 2048);

Where the SchedulingData field contains the HL7 message which was inserted using a DTL with a code statement as follows:

 set SIUString = source.OutputToString("|^~\&",.tSC)
 if $$$ISERR(tSC) quit
 set target.SchedulingData = SIUString

I am not doing an ImportFromString yet. If I was to use the ImportFromString, would I put in in the OnProcessInput method in my inbound service?

It's an external database, I have the java gateway service up and running. I just want to go into ensemble, start the service and have it run through my database once and stop. I update a processed flag in the database, so the next pass won't pick up already read records.  Right now I have the call interval set to 86400, so it will run every two days, which would be ok, but really not needed.