Enrico Parisi · Aug 21, 2024 go to post

With "pre-compiled parameter" you mean a class parameter? Of what class?

You may user the $paramater function:

$parameter(classname,parametername)

Enrico Parisi · Aug 21, 2024 go to post

I can see the function %GetParameter available in the WYSIWIG rule editor

There is no %GetParameter function available in default functions provided by IRIS, to list available functions you need to press the "fx" button, it looks you have typed in %GetParameter.

Maybe you have developed a custom function called %GetParameter?

What parameter are you looking for within an HL7 routing rule?

Enrico Parisi · Aug 8, 2024 go to post

EXCELLENT advise/suggestion! I fully agree that using global mapping is MUCH better. 👏

Enrico Parisi · Aug 8, 2024 go to post

I don't think there is an official support way to achieve that.

However, if you temporary change ENSLIB database and remove read-only flag and then:

Set ^IRIS.Msg("EnsColumns","en","ServerName")="Server Name"

or maybe better:

s ^IRIS.Msg("EnsColumnsNAMESPACENAME,"en","ServerName")="Server Name"

where NAMESPACENAME is the name of your production.

And then you put back the read-only flag in ENSLIB  database......you will find a surprise 😉

Note that this is a kind of a hack, you lose the "surprise" when you upgrade and may not work in future versions.

Edit: see @Eduard Lebedyuk advise below for a much better way to do it using global mapping instead of changing ENSLIB

Enrico Parisi · Aug 8, 2024 go to post

The count syntax ("*") only works if used for the last repeating element and using curly braces, so this works:

HL7.{PIDgrpgrp(1).ORCgrp(1).OBXgrp("*")}

You need to loop in the two previous groups (PID and ORC) to get the total count of OBX segments in the message.

Enrico Parisi · Aug 7, 2024 go to post

OK, it seems that I did not understood the challenge! 😂

BUT, the instructions read as:

"...build a program (using only printable ASCII characters, tabs and newlines) that prints out...."

What's your concept of "prints out"?

I understand that the provided sample solution doe not printout anything, but the instructions also says:

"....exactly the characters in the printable ASCII space (characters 32 to 126) that don't appear in your program's source code..."

Again, my concept of source code include...well, all the code, including string constants in the source code, so the provided sample solution does not satisfy the conditions because it contains ALL the printable ASCII space!
Maybe it correct because sing it contains all the  printable ASCII space, it does not prints out anything?!

Enrico Parisi · Aug 6, 2024 go to post

42 characters, but I don't like that code in a class....it's like cheating

43 characters, without feeling cheating 😂

Enrico Parisi · Aug 1, 2024 go to post

Maybe you have issue with your web server, but you didn't provide any details so is impossible to guess.

Maybe you have an issue with the Web/CSP Application setup, but you didn't provide any details so is impossible to guess.

It's unlikely a security issue since you can access csl and zen (supposedly?) in the same Web/CSP application.

Enrico Parisi · Aug 1, 2024 go to post

"...do I check the status for Prepare and Execute methods?"

No, you don't, but you should.

Enrico Parisi · Jul 31, 2024 go to post

Set dynOBJ={}.%FromJSONFile("c:\temp\BundleSample.json")
Set firstResource=dynOBJ.entry.%Get(0).resource
Write firstResource.resourceType
 

Enrico Parisi · Jul 30, 2024 go to post

In the Management Portal go to Interoperability (choose namespace if asked) -> List -> Productions

There, do you see the production you need to open?
If yes, select the production line from the list and click the "Open" button below the title bar.

What do you get?

Enrico Parisi · Jul 26, 2024 go to post

USER>DO HELP^%G
 
The %G utility displays global nodes. A "?" at the "Global ^" prompt
displays the global directory. If you enter just the name of a global,
%G displays the entire global. You may also display a portion of the
global at different subscript levels or specific nodes.
 
A complete global reference, such as ^GLO(3,"BED",5) will display
only that particular node. You may specify a subtree, such as
^GLO(3,"BED", to display all descendants of that node. To display
both the node and its descendants, do not end your entry with a
comma or a right parenthesis.
 
You can leave a subscript field empty when you specify the subtree and
the %G utility displays any nodes matching the other subscripts:
^GLO(,"BED") will match any nodes with 'BED' as the second subscript.
 
You can specify a range of subscripts for a particular subscript
level by inserting a colon between the first and last subscript in the
range: ^PT(1,"ACC":"BIRTH"
 
You can use variables and simple expressions in a subscript
specification by assigning a value to the variable before calling %G.
For example SET ID=214 and enter something like ^PT(ID,0).

Enrico Parisi · Jul 26, 2024 go to post

You don't provide enough information to help you.

Can you please provide some more detail on how you are "reading" "message_code"?

What kind of object/class and how you load/populate  "response" when you mention "response.message_code"?

What product/version are you using?

Enrico Parisi · Jul 25, 2024 go to post

The RoutineList query in %Routine class does offer ranges, try this:

Set Query=##class(%Routine).RoutineListFunc("%D:%E")
Do Query.%Display()

Enrico
P.S.: Tested in latest IRIS, I'm not sure that the "Func" query method is available in 2017, but you can use your old %ResultSet with same parameters.

Enrico Parisi · Jul 18, 2024 go to post

It has happened to me a few time not having access to terminal (OS or IRIS).

For this situation I developed a quick and dirty CSP class to allow me to execute IRIS or OS commands.

Class SomePackege.Cmd Extends %CSP.Page
{

ClassMethod OnPage() As %Status
{
    &html<<html>
<head>
</head>
<body>
<form>
<input type="text" name="cmdOS" size="150" value='#(%request.Get("cmdOS"))#'>
<input type="submit" value="runOS" onclick="this.form.submitted.value=this.value;" >
<br/>
<input type="text" name="cmd" size="150" value='#(%request.Get("cmd"))#'>
<input type="submit" value="runCMD" onclick="this.form.submitted.value=this.value;" >
<input type="hidden" name="submitted">
</form>
>
    If (%request.Get("submitted")="runOS") && (%request.Get("cmdOS")'="") {
        Set cmdOS=%request.Get("cmdOS")
        Set io=$io
        Open cmdOS:"QR"
        Write "<tt>"
        Try {
            For  Use cmdOS Read line Use io Write $replace(..EscapeHTML(line)," ","&nbsp;"),"<br>"
        } Catch CatchError {
            Set sc=CatchError.AsStatus()
        }
        Use io Write "</tt>"
        Close cmdOS
        Use io
    } ElseIf (%request.Get("submitted")="runCMD") && (%request.Get("cmd")'="") {
        Set cmd=%request.Get("cmd")
        Write "<pre>"
        x cmd
        Write "</pre>"
    }
    &html<</body>
</html>>
    Quit $$$OK
}

}

Once the class is loaded (say, from Studio or VS code) in one namespace, just call it from the default csp/web application, for example:

http://yourhost:57772/csp/user/SomePackage.Cmd.cls

Please note that the UI is very, very, VERY rudimental (ugly), but gets the job done in case of need.

Enrico Parisi · Jul 4, 2024 go to post

I'm puzzled by the fact that the two $$$LOGINFO() are present in the trace when an exception should have raised BEFORE the $$$LOGINFO().

The code posted is not the code that generated that trace. And this is very confusing.

Maybe the code was modified without restarting the Business Operation?

Enrico Parisi · Jul 4, 2024 go to post

..Adapter.Credentials.Username and ..Adapter.Credentials.Password

Credentials property of EnsLib.FTP.InboundAdapter is %String, so I expect an <INVALID OREF> error.

In general, I'd suggest to put your code inside a Try/Catch, something like:

	Set sc=$$$OK
	Try {
	    
	    ; your code here
	    
	} Catch CatchError {
		#dim CatchError as %Exception.SystemException
		Set sc=CatchError.AsStatus()
	}
	Quit sc
Enrico Parisi · Jul 2, 2024 go to post

Just tested using IRIS for Health 2022.2 installed in a temp VM and it works fine.

Can you share the terminal output when you run that code?

Enrico Parisi · Jul 2, 2024 go to post

Did you try from terminal using the EXACT code I posted?

What product are you using? You mention "IRIS 2022.2" is it IRIS for Health?

Enrico Parisi · Jul 2, 2024 go to post

Using your code (simplified by me) from terminal it works fine using a sample CCDA from here.

set ccdaStream = ##class(%Stream.FileBinary).%OpenId("c:\temp\CCDA_CCD_b1_Ambulatory_v2.xml")
write "Size of CCDA Stream: ", ccdaStream.Size,!
set xsltTransform = "SDA3/CCDA-to-SDA.xsl"
set tTransformer = ##class(HS.Util.XSLTTransformer).%New()
set tSC = tTransformer.Transform(ccdaStream, xsltTransform, .sdaStream)
if 'tSC write "Transformation to SDA3 failed with error ",$system.Status.GetErrorText(tSC),!
set fhirStream = ##class(%Stream.TmpBinary).%New()
set SDA3ToFHIRObject = ##class(HS.FHIR.DTL.Util.API.Transform.SDA3ToFHIR).TransformStream(sdaStream, "HS.SDA3.Container", "R4")
if '$isobject(SDA3ToFHIRObject.bundle) write "Failed to transform SDA3 to FHIR",!
do SDA3ToFHIRObject.bundle.%ToJSON()

The result/output is a pretty long JSON FHIR bundle with CCDA data (I didn't check the content!)

Does your code works with that sample CCDA?

If not, then maybe there is something wrong in your CCDA.

For my test I used: IRIS for Windows (x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:35:10 EDT