Question Lionel Woods · Sep 27, 2022

I am trying to split a HL7 message (RDE O11) into several messages depending on how many RXC segments there are in the message (Two RXC segments would need to two separate HL7 messages)

I have seen a couple of posts regarding this but am struggling with my BP using ObjectScript, the idea is to take the receiving message and split this before passing it onto another BP

Here is my code so far 

Class BDROWA.Transform.OVMO Extends Ens.BusinessProcess [ ClassType = persistent ]


{Method OnRequest(pRequest As EnsLib.HL7.Message, Output pResponse As Ens.Response) As %Status


{Set RXCCount =

2
0 670
Question Lionel Woods · Sep 12, 2022

Am trying to create a custom ACK to return to sending system as it does not accept standard 2.3:ACK, want to send the below:

Set pResponse=##class(EnsLib.HL7.Message).%New()
Set pResponse.DocType="2.4:ACK"
Set MSHStr="MSH|^~\&|EnsembleHL7|ISC|ARiM Server|ROWA|"_$REPLACE($REPLACE($ZDATETIME($HOROLOG,8,1),":",""), " ","")_"||ACK|"_pRequest.GetValueAt("MSH:10")_"|P|2.3"
Set MSHSeg=##class(EnsLib.HL7.Segment).ImportFromString(MSHStr,.tSC,pRequest.Separators)
Set MSAStr="MSA|AA|"_pRequest.GetValueAt("MSH:10")
Set MSASeg=##class(EnsLib.HL7.Segment).ImportFromString(MSAStr,.tSC,pRequest.Separators)
Set

9
2 633
Question Lionel Woods · Nov 2, 2021

I am using the following code to capture the current Date/Time and Date/Time from the previous 15 minutes 

set now=$horolog
$$$TRACE("now:"_now)set time15min = $piece(now,",",*) - (15 * 60)
$$$TRACE("time15min"_time15min)set after = $piece(now,",",1)_","_time15min
$$$TRACE("after"_after)set datetime15=$zdatetime(after, 3)
$$$TRACE("datetime15"_datetime15)set datetimenow=$zdatetime(now, 3)
$$$TRACE("datetimenow"_datetimenow)set datetime15=$replace(datetime15," ","T")
$$$TRACE("datetime15"_datetime15)set datetimenow=$replace(datetimenow," ","T")
$$$TRACE("datetimenow"_datetimenow)

The issue I

1
1 209
Question Lionel Woods · Sep 28, 2021

I am trying to convert a valid date range (Previous Day - Current Day) to a valid date/time range (-15 mins from current date/time to current date/time) for a Task to run (Format needs to be YYYY-MM-DD hh:mm:ss)

Code being used currently for date range is 

set previousDay=$zdatetime($horolog-1,3)
set currentDay=$zdatetime($horolog-0,3)

Can anyone help?

4
0 494
Question Lionel Woods · Sep 30, 2020

Trying to extract "x, y", and only the "x" is being extracted because the "," is the separator  

The ":"  is set to extract everything after this 

"Working Example": xyz,

"Not  Working Example": "x,  y",

$EXTRACT($P($P(pData,",",78),":",2),2,$L($P($P(pData,",",78),":",2))-1)

Any ideas on how to extract the whole field on the example with the "," in the field

7
0 662