Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ensemble Dual ACK Example
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2014.1.1 (Build 702U)" ts="2017-07-06 10:00:27">
<Class name="Examples.DeferredHL7.CustomProcess">
<ClassType>persistent</ClassType>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>64470,35796.396505</TimeChanged>
<TimeCreated>64470,32347.921948</TimeCreated>
<Method name="OnRequest">
<FormalSpec>pRequest:Ens.Request,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[ quit ..SendRequestAsync("3. SEND HL7 OVER TCP",pRequest,1,"COMPLETE ON ACK","SEND TO OP")
]]></Implementation>
</Method>
<Method name="OnResponse">
<FormalSpec><![CDATA[request:EnsLib.HL7.Message,&response:EnsLib.HL7.Message,callrequest:EnsLib.HL7.Message,callresponse:EnsLib.HL7.Message,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
$$$TRACE("request contains the inbound request "_request.RawContent)
$$$TRACE("callrequest contains the sent request "_callrequest.RawContent)
$$$TRACE("callresponse contains the deferred ACK "_callresponse.RawContent)
quit $$$OK
]]></Implementation>
</Method>
<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>
<Class name="Examples.DeferredHL7.Production">
<Super>Ens.Production</Super>
<TimeChanged>64470,35525.292266</TimeChanged>
<TimeCreated>64197,17855.357726</TimeCreated>
<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Examples.DeferredHL7.Production" LogGeneralTraceEvents="false">
<Description></Description>
<ActorPoolSize>2</ActorPoolSize>
<Item Name="1. HL7 TEST FILE IN" Category="" ClassName="EnsLib.HL7.Service.FileService" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
<Setting Target="Host" Name="MessageSchemaCategory">2.5</Setting>
<Setting Target="Host" Name="TargetConfigNames">HL7 OUT,2. PROCESS HL7 MESSAGE</Setting>
<Setting Target="Adapter" Name="FilePath">C:\Temp\examples\in</Setting>
<Setting Target="Adapter" Name="ArchivePath">C:\Temp\examples\archive</Setting>
<Setting Target="Adapter" Name="FileSpec">*</Setting>
</Item>
<Item Name="3. SEND HL7 OVER TCP" Category="" ClassName="EnsLib.HL7.Operation.TCPAckOutOperation" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
<Setting Target="Adapter" Name="IPAddress">127.0.0.1</Setting>
<Setting Target="Adapter" Name="Port">50000</Setting>
<Setting Target="Host" Name="PartnerAckTimeout">10</Setting>
<Setting Target="Host" Name="ReplyCodeActions">:?R=RF,:?E=W,:~=S,:?A=C,:*=S,:T?=C</Setting>
</Item>
<Item Name="2. PROCESS HL7 MESSAGE" Category="" ClassName="Examples.DeferredHL7.CustomProcess" PoolSize="0" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
</Item>
<Item Name="4.1 TARGET SYSTEM RECEIVER" Category="" ClassName="EnsLib.HL7.Service.TCPService" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
<Setting Target="Host" Name="MessageSchemaCategory">2.4</Setting>
<Setting Target="Host" Name="TargetConfigNames">4.2 TARGET SYSTEM PROCESSOR</Setting>
<Setting Target="Adapter" Name="Port">50000</Setting>
<Setting Target="Host" Name="AckMode">Byte</Setting>
</Item>
<Item Name="4.2 TARGET SYSTEM PROCESSOR" Category="" ClassName="Examples.DeferredHL7.TargetCustomProcess" PoolSize="0" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
</Item>
<Item Name="4.3 TARGET SYSTEM ACKER" Category="" ClassName="EnsLib.HL7.Operation.TCPOperation" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
<Setting Target="Adapter" Name="IPAddress">127.0.0.1</Setting>
<Setting Target="Adapter" Name="Port">50001</Setting>
</Item>
<Item Name="5. HL7 ACK TCP IN" Category="" ClassName="EnsLib.HL7.Service.TCPAckInService" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
<Setting Target="Host" Name="MessageSchemaCategory">2.4</Setting>
<Setting Target="Host" Name="TargetConfigNames"></Setting>
<Setting Target="Adapter" Name="Port">50001</Setting>
<Setting Target="Host" Name="AckMode">Byte</Setting>
<Setting Target="Host" Name="PartnerOperation">3. SEND HL7 OVER TCP</Setting>
</Item>
</Production>
]]></Data>
</XData>
<Method name="OnStart">
<Description>
Override this in your Production class to do setup before the Production starts</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>pTimeStarted:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[ Quit $$$OK
]]></Implementation>
</Method>
</Class>
<Class name="Examples.DeferredHL7.TargetACKCreator">
<Super>Ens.DataTransformDTL</Super>
<TimeChanged>64470,34892.216592</TimeChanged>
<TimeCreated>64470,34650.693149</TimeCreated>
<DependsOn>EnsLib.HL7.Message</DependsOn>
<Parameter name="IGNOREMISSINGSOURCE">
<Default>1</Default>
</Parameter>
<Parameter name="REPORTERRORS">
<Default>1</Default>
</Parameter>
<XData name="DTL">
<XMLNamespace>http://www.intersystems.com/dtl</XMLNamespace>
<Data><![CDATA[
<transform sourceClass='EnsLib.HL7.Message' targetClass='EnsLib.HL7.Message' sourceDocType='2.4:ADT_A01' targetDocType='2.4:ACK' create='new' language='objectscript' >
<assign value='source.{MSH}' property='target.{MSH}' action='set' />
<assign value='source.{MSH:MessageControlID}' property='target.{MSA:MessageControlID}' action='set' />
<assign value='"AE"' property='target.{MSA:AcknowledgmentCode}' action='set' />
<assign value='"ERROR IN MESSAGE"' property='target.{MSA:TextMessage}' action='set' />
<assign value='source.{MSH:MessageControlID}+1000' property='target.{MSH:MessageControlID}' action='set' />
<assign value='"ACK"' property='target.{MSH:MessageType.messagetype}' action='set' />
</transform>
]]></Data>
</XData>
</Class>
<Class name="Examples.DeferredHL7.TargetCustomProcess">
<ClassType>persistent</ClassType>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>64470,34945.473418</TimeChanged>
<TimeCreated>64470,33016.371462</TimeCreated>
<Method name="OnRequest">
<FormalSpec>pRequest:Ens.Request,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
$$$QuitOnError(##class(Examples.DeferredHL7.TargetACKCreator).Transform(pRequest,.ack))
quit ..SendRequestAsync("4.3 TARGET SYSTEM ACKER",ack,0,"","Send deferred ACK message")
]]></Implementation>
</Method>
<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>
</Export>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.