go to post Andy Picou · Sep 13, 2019 I have the same issue and wish someone had a good answer.What I did to get around it was to use a DTL to take the XML and put into a stream container then route to a Business Operation with a class name of EnsLib.File.PassthroughOperation.
go to post Andy Picou · Sep 13, 2019 Waren, it is possible to pass messages to a business service via a scheduled task.Create a Class that extends %SYS.Task.Definition. This will be the class executed by Task Manager.Include Ensemble/// Task to trigger the business service Class Sample.Util.Task.PatientService Extends (%SYS.Task.Definition, %Persistent) [ Inheritance = right ]{Parameter TaskName = "Sample.Util.Task.PatientService";Method OnTask() As %Status{ SET qStatement = ##class(%SQL.Statement).%New() SET qStatus = qStatement.%Prepare("Select Distinct by (PatientId) PatientId,PatientNameLast,PatientNameMiddle,PatientNameFirst,PatientAddress1,PatientAddress2,PatientCity,PatientState,PatientZipCode,PatientSexCode,PatientDateOfBirth,PatientRace,PatientPhone,PatientSSN,PatientMaritalStatus,PatientAdmissionDate,PatientDept from PREVOST_AthenaHealth.Patient Order by PatientId") IF qStatus'=1 { WRITE !,"%Prepare failed",$System.Status.DisplayError(qStatus) Quit $$$ERROR($System.Status.GetErrorCodes(qStatus),$System.Status.GetErrorText(qStatus)) } Set rset = qStatement.%Execute() set k0=0 WHILE rset.%Next() { Set target=##class(EnsLib.HL7.Message).%New() . . . Set tSC=##class(Ens.Director).CreateBusinessService("Sample.AthenaHealth.PatientService",.tService) Set tSC=tService.ProcessInput(target) ; call ProcessInput(target) to send the transaction to the BS } Quit $$$OK}}Create a class for your Business Service./// Class Sample.AthenaHealth.PatientService Extends Ens.BusinessService [ ProcedureBlock ]{/// Name of a Business Partner Profile associated with this itemProperty BusinessPartner As %String(MAXLEN = 128);/// Configuration item(s) to which to send messagesProperty TargetConfigNames As %String(MAXLEN = 2000);Parameter SETTINGS = "BusinessPartner:Info:partnerSelector,TargetConfigNames:Basic:selector?multiSelect=0&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}";Method OnProcessInput(tResult As EnsLib.HL7.Message, Output pOutput As %RegisteredObject) As %Status{ ;Only route to 1st TargetConfigName Set SC = ..SendRequestAsync($piece(..TargetConfigNames,","),tResult) Quit $$$OK}}Create a Business Service using your newly defined class in your Production.<Item Name=“Sample.AthenaHealth.PatientService" Category="PREVOST" ClassName=“Sample.AthenaHealth.PatientService" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule=""> <Setting Target="Host" Name="TargetConfigNames">HL7MsgRouter</Setting> <Setting Target="Host" Name="BusinessPartner">A60</Setting> </Item>
go to post Andy Picou · Oct 11, 2016 I insert a code block in a DTL when the source OBX(1):5 contains multiple lines delimited by "\.br\" and the target message requires one line per OBX. Using standard DTL I can <assign value='$LFS(source.{OBX:5},"\.br\") property='tList'. And in a code block "While $Listnext" through the list populating the target OBX(n)