Yes I would think the easiest way would be to create a record mapper structure, then use the DTL to map your HL7 fields to where they need to be, then send it to a EnsLib.RecordMap.Operation.FileOperation.
Record Mapper

DTL

- Log in to post comments
Yes I would think the easiest way would be to create a record mapper structure, then use the DTL to map your HL7 fields to where they need to be, then send it to a EnsLib.RecordMap.Operation.FileOperation.
Record Mapper

DTL

In a lot of places I use...
ConvertDateTime (
..ConvertDateTime(source.{Z01(1):DateOfBirth},"%Y%m%d","%q(1)")
%q(1) is the format.
We had a consultant write this for us as well...
ClassMethod FormatStringToSQLDate(InDate As %String) As %String [ Final ]
{
If InDate=""
{
set OutDate="1900-01-01 00:00:00"
}
else
{
set DateLength=..Length(InDate)
if (DateLength > 7) && (DateLength < 15)
{
set YYYY=..SubString(InDate,1,4)
set mm=..SubString(InDate,5,6)
set dd=..SubString(InDate,7,8)
set OutDate=YYYY_"-"_mm_"-"_dd
if DateLength=8
{
set OutDate=OutDate_" 00:00:00"
}
if DateLength=10
{
set HH=..SubString(InDate,9,10)
set OutDate=OutDate_" "_HH_":00:00"
}
if DateLength=12
{
set HH=..SubString(InDate,9,10)
set MM=..SubString(InDate,11,12)
set OutDate=OutDate_" "_HH_":"_MM_":00"
}
if DateLength=14
{
set HH=..SubString(InDate,9,10)
set MM=..SubString(InDate,11,12)
set SS=..SubString(InDate,13,14)
set OutDate=OutDate_" "_HH_":"_MM_":"_SS
}
}
else
{
set OutDate="1900-01-01 00:00:00"
}
}
Quit OutDate
}
}
We've have done something similar but wrote a function to do the looping... This example loops through a given segment and field and looks that value up against a lookup table. This could be modified for your use. This is the only way I know to do the looping within the BusinessRule.
{
#dim tSeg as EnsLib.HL7.Segment
set tSegCount = pHL7Msg.SegCountGet()
set i = 1
Set tFound = 0
//get new values
set tval=""
while ((i <= tSegCount) && (tval="")) {
set tSeg = pHL7Msg.GetSegmentAt(i)
if (tSeg.Name = pSegment) {
set tID = tSeg.GetValueAt(pField)
set tval= ..Lookup(pLookupTable, tID)
}
set i = i + 1
}
if (tval '= "")
{
Q 1
}
quit 0
}
After many TRACE statements found I was missing (1) after the FT1 in my syntax. So it should be... request.GetValueAt("FT1(1):16.4.2")
I have always called it the other way around with the outbound before the I in the Execute Procedure Parm Array.
Method InsertProviderDivisionSp(pRequest As osuwmc.CPD.DataStructures.InsertProviderDivision, Output pResponse As Ens.Response) As %Status
{
set SPQuery = "{ ?= call usp_Interfaces_Insert_ProviderDivision_Ens(?,?,?,?) }"
set par = 4
set par(1) = pRequest.DoctorNumber
set par(2) = pRequest.Division
set par(3) = pRequest.UpdatedBy
set par(4) = pRequest.OrderBy
set tSC = ..Adapter.ExecuteProcedureParmArray(.InsertDivision,.outputs,SPQuery,"oiiii",.par)
if 'tSC write " failed ",tSC
quit tSC
}
or you can call it like...
Method InsertProviderPreference(pRequest As osuwmc.CPD.DataStructures.InsertPreferences, Output pResponse As Ens.Response) As %Status
{
set SPQuery = "{ ?= call usp_Interfaces_Insert_ProviderPreference(?,?,?,?,?) }"
set parm = 6
set parm(1,"SqlType")=$$$SQLVARCHAR
set parm(1,"IOTypes")=$$$SQLPARAMOUTPUT
set parm(2) = pRequest.DoctorNumber
set parm(2,"SqlType")=$$$SQLVARCHAR
set parm(2,"IOTypes")=$$$SQLPARAMINPUT
set parm(3) = pRequest.Preference
set parm(3,"SqlType")=$$$SQLNUMERIC
set parm(3,"IOTypes")=$$$SQLPARAMINPUT
set parm(4) = pRequest.PreferenceValue
set parm(4,"SqlType")=$$$SQLNUMERIC
set parm(4,"IOTypes")=$$$SQLPARAMINPUT
set parm(5) = pRequest.PreferenceDesc
set parm(5,"SqlType")=$$$SQLVARCHAR
set parm(5,"IOTypes")=$$$SQLPARAMINPUT
set parm(6) = pRequest.UpdatedBy
set parm(6,"SqlType")=$$$SQLVARCHAR
set parm(6,"IOTypes")=$$$SQLPARAMINPUT
set tSC = ..Adapter.ExecuteProcedureParmArray(.InsertPreference,.outputs,SPQuery,"oiiiii",.parm)
if 'tSC write "Failed",tSC
quit tSC
}
What does your... ##class(SamsReq).%New() look like? Here is what my Request and code look like as a whole. I have used this many times across many services in different fashions. I am using JDBC vs ODBC which maybe a difference, not sure.
Class osuwmc.CPD.DataStructures.StartJobRequest Extends (%Library.Persistent, %XML.Adaptor) [ Not ProcedureBlock, SqlRowIdPrivate ]
{
Property StartJobStatus As %Integer;
Storage Default
{
<Data name="StartJobRequestDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>StartJobStatus</Value>
</Value>
</Data>
<DataLocation>^osuwmc.CPD59D.StartJobReqE986D</DataLocation>
<DefaultData>StartJobRequestDefaultData</DefaultData>
<IdLocation>^osuwmc.CPD59D.StartJobReqE986D</IdLocation>
<IndexLocation>^osuwmc.CPD59D.StartJobReqE986I</IndexLocation>
<StreamLocation>^osuwmc.CPD59D.StartJobReqE986S</StreamLocation>
<Type>%Library.CacheStorage</Type>
}
}
Class osuwmc.CPD.UpdateClarityAddressesFromCPDService Extends Ens.BusinessService [ ClassType = "", ProcedureBlock ]
{
Parameter ADAPTER = "EnsLib.SQL.InboundAdapter";
Parameter REQUESTCLASSES As %String = "EnsLib.SQL.Snapshot";
Property InitDSN As %String;
Method OnInit() As %Status
{
Set ..InitDSN = ..Adapter.DSN
//Set ..Adapter.ConnectAttrs = "QueryTimeout:45" ; try this too just in case...
Quit $$$OK
}
Method OnProcessInput(pInput As EnsLib.SQL.Snapshot, pOutput As %RegisteredObject) As %Status
{
set req=##class(osuwmc.CPD.DataStructures.StartJobRequest).%New()
set req.StartJobStatus = pInput.Get("1")
set sc = ..SendRequestSync("CPDClarityAddressUpdateBPL",req,.pOutput)
Quit sc
}
}
You can use a Data Lookup table to specify the Subject based on the Error you are looking for.
You can try the following...
https://community.spiceworks.com/topic/255740-powershell-script-to-show-all-groups-in-ad
The application is sending us the following back... Of course it does not match up to any structure but like you said they probably have omitted the backslash from the ACK causing the error.
MSH|^~\&|GCRC|RDM|INTENG||20180207084732||SIU^S12|70577207|P|2.3| MSA|AA|Successful|
I went ahead and made copies of 4 different EnsLib.HL7 classes, and modified the Parser to not throw the warning message. So for it is working like it should.
We found the Ensemble Scheduler single threaded, so If you had schedules that would overlap some instances would not be started correctly. One of my colleagues created two simple command line scripts to start and stop interfaces. We are using those scripts along with the cron scheduler on AIX.
I just worked with WRC on this same issue. I was able to make copies of
{
Method GetFinderArray(ByRef pParameters, Output pMetaData, Output pData) As %Status
{
Kill tParms
// assemble search parameters
Set tParms("sort") = ..currSortMode
Set tParms("search") = ..searchKey
Set tParms("abstract") = ..includeAbstract
if (..mode = "labLookup"){
s tSC = ##class(%ZEN.FinderUtils).%GetArrayForQuery("Ens.Util.LookupTable","Enumerate",$LB("{Name}","{Name}_"".lut""","lut",""),".",,.pMetaData,.tData)
s k=""
for {
s k=$order(tData(k))
q:k=""
s tableName = $li(tData(k),1)
if (tableName [ "LABS") {
s pData($i(pData)) = tData(k)
}
}
q tSC
}
else {
Quit ##class(%ZEN.FinderUtils).%GetClassListArray(.tParms,.pMetaData,.pData)
}
}
Class osuwmc.DataLookup.testLookupSettings Extends EnsPortal.LookupSettings
{
/// Handle various dialogs.
ClientMethod onPopupAction(popupName, action, value) [ Language = javascript ]
{
try {
if (action != "ok") {
return false;
}
popupName = this.removePopupSuffix(popupName);
switch(popupName) {
case 'NewLookup':
if (value.substring(value.length-4).toUpperCase() != '.LUT') value += '.lut';
// note that we fall through to open the page for both NewLookup and LookupOpen
case 'LookupOpen':
var link = zenLink('osuwmc.DataLookup.testLookupSettings.zen');
link += (link.indexOf('?') > -1 ? '&' : '?') + 'LookupTable=' + encodeURIComponent(value);
this.setModified(false);
this.gotoPage(link);
break;
case 'switchNamespace':
zenPage.changeURLNamespace(value);
break;
case 'LookupSaveAs':
if (value.substring(value.length-4).toUpperCase() == '.LUT') value = value.substring(0,value.length-4);
zenPage.checkName(value);
break;
}
}
catch (ex) {
alert("Error: " + ex);
}
}
/// If the new name is already in use, confirm that the user wishes to overwrite the old table of that name.
ClientMethod checkName(newName) [ Language = javascript ]
{
var duplicateName = zenPage.NameCheck(newName);
if (duplicateName !="")
{
if (!confirm($$$FormatText($$$Text("Lookup table name '%1' is already in use! Are you sure you want to overwrite this table?"),duplicateName))) {
return;
}
zenPage.RemoveTable(duplicateName);
}
zenPage.renameSave(newName);
var link = zenLink('osuwmc.DataLookup.testLookupSettings.zen');
link += (link.indexOf('?') > -1 ? '&' : '?') + 'LookupTable=' + encodeURIComponent(newName+".lut");
this.setModified(false);
this.gotoPage(link);
}
ClientMethod openTable() [ Language = javascript ]
{
if (this.pageModified) {
var doOpen = confirm($$$Text('The current lookup table has been modified. Do you wish to discard these changes and open a different lookup table?'));
if (!doOpen) return;
}
var parms = { MODE: "labLookup"};
zenLaunchPopupWindow(zenLink('osuwmc.DataLookup.testFinderDialog.cls'),this.addPopupSuffix('LookupOpen'),'status,scrollbars,resizable=yes,width=800,height=600',parms);
}
Method OnGetRibbonInfo(Output pDisplay As %Boolean, Output pViewIcons As %List, Output pSortOptions As %List, Output pSearchBox As %Boolean, Output pRibbonTitle As %String, Output pCommands As %List) As %Status
{
Set pDisplay = 1
Set pRibbonTitle = $$$Text("Lookup Table Viewer")
Set pCommands(1) = $LB("btnOpen",$$$Text("Open"),$$$Text("Open an existing lookup table"),"zenPage.openTable();")
Set pCommands(2) = $LB("btnSave",$$$Text("Save"),$$$Text("Save the current lookup table"),"zenPage.saveTable();")
Set pCommands(3) = $LB("btnSaveAs",$$$Text("Save As"),$$$Text("Save the current lookup table with a different name"),"zenPage.saveTableAs();")
Quit $$$OK
}
}