Question
· Oct 2, 2020

When we test using the actual HL7 message, how could we achieve to send the response from the Process to the Service?

Hello,

We would need your help.

When we test using the actual HL7 message, how could we achieve to send the response from the Process to the Service? 

Process does not send response to a EnsLib.HL7.Service.TCPService when we test it with a EnsLib.HL7.Operation.TCPOperation, why?

We are developing a Production which is composed by:

 - A service: EnsLib.HL7.Service.TCPService

 - A bussiness process

 - An Operation: EnsLib.HL7.Operation.TCPOperation

 

We have the following challenge:

 

1) When we test the Production sending from the Process:

 

We observe the response being sent back, which is the expected behaviour:

 

2) However if we test it sending an actual HL7 Message from the Operation which points to the Service:

 

We do not get a response from the Process back to the Service (which is an unexpected behaviour):

 

➡️ We would like to ask why we do not see in the second example, at point 2), a response being sent back from the Process to the Service?

 

 

 

We have read:

https://cedocs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=EHL7...

https://cedocs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=EHL7...

 

Besides we post the configurations:

 

- Service

  <Item Name="Servicios.HL7.TransformarOBXs" Category="TransformarOBXs" ClassName="EnsLib.HL7.Service.TCPService" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Adapter" Name="Port">19887</Setting>
    <Setting Target="Adapter" Name="StayConnected">0</Setting>
    <Setting Target="Host" Name="TargetConfigNames">TransformarOBXs</Setting>
    <Setting Target="Host" Name="MessageSchemaCategory">2.3</Setting>
    <Setting Target="Host" Name="AckMode">Never</Setting>
  </Item>

 

- Process

  <Item Name="TransformarOBXs" Category="TransformarOBXs" ClassName="Procesos.TransformarOBXs" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="Pruebas" Category="TransformarOBXs" ClassName="EnsLib.HL7.Operation.TCPOperation" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Adapter" Name="IPAddress">localhost</Setting>
    <Setting Target="Adapter" Name="Port">19887</Setting>
    <Setting Target="Adapter" Name="StayConnected">3</Setting>
  </Item>

 

- Operation

<Item Name="Pruebas" Category="TransformarOBXs" ClassName="EnsLib.HL7.Operation.TCPOperation" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Adapter" Name="IPAddress">localhost</Setting>
    <Setting Target="Adapter" Name="Port">19887</Setting>
    <Setting Target="Adapter" Name="StayConnected">3</Setting>
  </Item>

 

➡️ When we test using the actual HL7 message, how could we achieve to send the response from the Process to the Service?

Discussion (2)2
Log in or sign up to continue

Hi Yone,

It looks your Business Process does not do anything with the message. Can you activate tracing on it (to make sure that your OBX transform is working)? 

Also, looking at code in  EnsLib.HL7.Service.Standard I am seeing that this type of Business Service would send the message to Business Process asynchronously in almost all cases:

If $Case(..AckMode,

"Never":1,

"Immed":1,

"Byte":1,

"Msh":'$IsObject(tMSH)||$Case(tMSH.GetValueAt(16),"AL":0,"SU":0,"ER":0,:1),:0)

; ApplicationAcknowledgmentType="Never"
   #; Send Async; no reply required
   $$$SyncCommitSet(tSyncCommit)
   For iTarget=1:1:$L(..TargetConfigNames, ",")

      Set tOneTarget=$ZStrip($P(..TargetConfigNames,",",iTarget),"<>W") Continue:""=tOneTarget
      $$$sysTRACE("Sending HL7 Message "_pDocIn_" / "_pDocIn.%Id()_" from "_pDocIn.Source_" to '"_tOneTarget_"'")
      Set tSC1=..SendRequestAsync(tOneTarget,pDocIn) Set:$$$ISERR(tSC1) tSC=$$$ADDSC(tSC,tSC1)
   }

  #; other code ...

}

Else {
    #; Send Synchronous; reply required - for Application ACK mode (either explicit or MSH-requested)
   If ""'=tReplyCode||..ImmediateByteAck {

  #; other code ...

}

You may need to route your transformed message forward to an EnsLib.HL7.Operation.TCPOperation, which can then throw the message to an IP address where the original message came from. Most HL7 Ensemble transactions are implemented this way. It is counterintuitive but HL7 Business Services and Business Operations are sort of one way - only forward (at least when we try to forward real data... Acknowledgements can be returned with the proper settings on the Business Service).