Here is a method we built for our use.

ClassMethod IsNumeric(value As %String) As %Boolean
{
//Load value into local var tNumber
set tNumber = value

//Use $extract to get the FULL VALUE into an internal format for $isvalidnum
set tFullValue = $EXTRACT(tNumber,1,$length(tNumber))

//Use $isvalidnum to check if the full value is numeric (ex: 123456789 = true, 123456789x = false)
set tNumberIsValid = $ISVALIDNUM(tFullValue)

//At this point, we simply return tNumberIsValid (it will either be 1, true or 0, false)
quit tNumberIsValid
}
 

It seems Node .js is not going to be a viable option. My systems folks said it was compliled with a different GCC than what we have loaded on our AIX Server. If we were to load Node.js it would mess up the rest of the scripting (PERL, Shell) we do on the server.

Javascript was just one idea, I bet there are many other types of code that can be used to adjust an image resolution. Is there anything that can be called from Atelier without having to install a bunch of software on the server?

Here is the same code but from the Studio (class view)

<assign value='##class(%Stream.GlobalCharacter).%New()' property='tStream' action='set' />
<assign value='source.GetFieldStreamRaw(.tStream,"ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).AlternateText",.tRemainder)' property='tSC' action='set' />
<if condition='..Length($get(tSC))&gt;0' >
<true>
<assign value='"1"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:SetIDOBX}' action='set' />
<assign value='"ED"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ValueType}' action='set' />
<assign value='"7"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationIdentifier.Identifier}' action='set' />
<assign value='"URL"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationIdentifier.Text}' action='set' />
<assign value='"EXTLRR"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationIdentifier.NameofCodingSystem}' action='set' />
<assign value='"1"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationSubID}' action='set' />
<assign value='"PDF"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).Identifier}' action='set' />
<assign value='"TMSAUDIO"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).Text}' action='set' />
<assign value='"PDF"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).NameofCodingSystem}' action='set' />
<assign value='"Base64"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).AlternateIdentifier}' action='set' />
<assign value='target.StoreFieldStreamRaw(tStream,"ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).AlternateText", tRemainder)' property='tSC' action='set' />
<assign value='""' property='$P(tRemainder,"|",11)' action='set' />
</true>
</if>

In a lot of places I use...

ConvertDateTime (val,in,out,file)

 

..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.

ClassMethod GroupIDExists(pHL7Msg As EnsLib.HL7.Message, pSegment As %String, pField As %String, pLookupTable As %String) As %Boolean
{
            #dim tSeg as EnsLib.HL7.Segment
            
            set tSegCount = pHL7Msg.SegCountGet()
            set = 1
            Set tFound = 0
            //get new values
            set tval=""
            while ((<= tSegCount) && (tval="")) {
                         
                        set tSeg = pHL7Msg.GetSegmentAt(i)
                        if (tSeg.Name = pSegment) {
                                    set tID = tSeg.GetValueAt(pField)
                                    set tval= ..Lookup(pLookupTable, tID)
                                                            
                        }
                        set = + 1
            }
            if (tval '= "")
            {
                        1
            }
            quit 0
}

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
}

}
 

I have used this in the past...

Under my Data Settings I use the following as my Query to act like a status kick off for my job...

SELECT  1

Then my service does...

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
}

It appears you are not setting your request variable so there is nothing to send to your DQTT.

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.

I have found that the text of "Discarding Received non HL7 data" lives in the EnsLib.HL7.Parser.cls. Has anyone tired to copy and make their own HL7.Parser that would not throw this warning message? It seems pretty simple but I am having issues trying to call my updated Parser.cls. All I want to do it comment this error out so it is not thrown and taking up database space.

 

Thanks

Scott

Have you attempted to use LENGTH?

Say LENGTH(HL7.{MRG. PriorPatientIdentifierList }) > 0

We have never been successful in using the field numbers within our routing rules. Normally we just use the name of the field, or that's at least how we were taught.

I would also think you want to check the message type before you check the MRG.1. So it would be if Message Type is A18 and LENGTH(HL7.{MRG. PriorPatientIdentifierList }) > 0 then return

I just worked with WRC on this same issue. I was able to make copies of %ZEN.Dialog.finderDialog and EnsPortal.LookupSettings. By using these copies I was able to modify some of the methods to limit down the number of tables a end user would have access too by using a filter on the Naming convention.


Class osuwmc.DataLookup.testFinderDialog Extends %ZEN.Dialog.finderDialog
{

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"){

tSC = ##class(%ZEN.FinderUtils).%GetArrayForQuery("Ens.Util.LookupTable","Enumerate",$LB("{Name}","{Name}_"".lut""","lut",""),".",,.pMetaData,.tData)
k=""
for {
k=$order(tData(k))
q:k=""
tableName = $li(tData(k),1)
if (tableName [ "LABS") {
pData($i(pData)) = tData(k)
}

}
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
}

}