Jeffrey Drumm · Aug 13, 2021 go to post

If you don't care about any unsent/completed/suspended messages, try calling the CleanProduction() method in class Ens.Director:

Do ##class(Ens.Director).CleanProduction()

This is strongly discouraged for PROD environments ... be forewarned. Would recommend you contact the WRC if you're getting this error in a PROD environment.

Jeffrey Drumm · Aug 13, 2021 go to post

Giving them only the %EnsRole_Operator role will prevent them from making configuration changes to the production. And if they aren't assigned the database resource (%DB_<databasename>), they won't be able to start or stop the production either.

Jeffrey Drumm · Aug 9, 2021 go to post

If the message text is displayed in black, it's most likely that the message does not conform to the document type selected in the inbound service.

Jeffrey Drumm · Aug 8, 2021 go to post

In the %SYS namespace:

%SYS>Set ^%SYS("Portal","EnableAutoRefresh")=1

That will reveal the radio buttons that allow you to turn on/off Auto Refresh. Setting that global to 0 actually has the same effect as clicking the Off button, but eliminates the ability to turn it back on via the management console.

Jeffrey Drumm · Jul 28, 2021 go to post

There's the Activity Monitor, but I don't know whether it was available for 2017.x. It requires configuration, as it is not enabled by default. It starts gathering activity after configuration, so you won't be able to use it to obtain activity/volume history for messages processed through the production prior to setup.

Jeffrey Drumm · Jul 22, 2021 go to post

Building a new message would have been my suggestion had I seen this in time, but you arrived at the same conclusion without my help!

Jeffrey Drumm · Jul 20, 2021 go to post

Are these messages all compliant with the doctype structure they're associated with?

If yes, why not use the symbolic path that the structure supplies ... i.e. something like MsgOut.GetValueAt("PIDgrpgrp.ORCgrp(n).OBXgrp(n).NTE(n)")?

Jeffrey Drumm · Jul 16, 2021 go to post

@Robert C. Cemper has you on the right track, but I'm curious as to whether the vendor of the foreign (i.e. non-HealthShare/HealthConnect) system has provided a specification. Do you need to accommodate Acknowledgement messages for both sending/receiving? Is there some sort of handshake protocol that is used to indicate when it's safe to send, a sort of RTS/CTS-type mechanism? Or is this being designed "on the fly?"

If I were designing something like this, I'd go with a web service ... always over the same port, and when you want to send something you'd POST it. When there's nothing to POST, you'd periodically GET to see if anything is waiting.

Anything else would most likely be a one-off in healthcare integration.

Jeffrey Drumm · Jul 14, 2021 go to post

Are you receiving the A19 message as a response to each ADT message? Or are they being sent asynchronously?

Jeffrey Drumm · Jul 13, 2021 go to post

The variable obx5 most likely refers to the OBX:5 field of an HL7 message, which is normally used for narrative or image result data in healthcare. \.br\ is a commonly used mechanism for representing line breaks in formatted text data. Why they're included in a base64 string/stream is a mystery, but I've seen stranger.

Jeffrey Drumm · Jul 10, 2021 go to post

Or how about this (again, with thanks to @Stuart Strickland)?

N(i,s)
 j=1:1:$l(i) c=$e(i,j),o=$g(o)_$s(",.!?"[c:c,c?1a:$e(" ",j>1)_$ZCVT(c,"U")_$p(s,7,$a(c)#32),1:"")
 o
 

114 characters cheeky

Who needs the Nato alphabet in the code when you can pass it as a parameter? laugh

(I'll stop now, I know I'm getting silly)

Jeffrey Drumm · Jul 10, 2021 go to post

One additional modification to @Stuart Strickland's most amazing attempt:

N(i)
 j=1:1:$l(i) c=$e(i,j),o=$g(o)_$s(",.!?"[c:c,c?1a:$e(" ",j>1)_$ZCVT(c,"U")_$p("lfa77harlie7elta7cho7oxtrot777ndia7777ike7ovember7scar777omeo777niform7777ankee",7,$a(c)#32),1:"")
 o

180 192 characters, assuming Unix line endings and a ridiculously limited use case that still solves the problem devil

EDIT: Added 12 characters to add fix for capitalized output ...

Jeffrey Drumm · Jul 10, 2021 go to post

While true, that's a rabbit hole that will generally be quite unrewarding as you continue down through the language/abstraction layers to the underlying machine code.

"Code golf" in my experience has never been about the size of the final executable ... it's all about how little you have to write to solve the problem.

Jeffrey Drumm · Jul 9, 2021 go to post

While not actually competing in this exercise, I would suggest that both of you could shorten your comma-delimited list by 26 characters with the realization that the first character of each entry is already supplied by the input string laugh

Jeffrey Drumm · Jul 6, 2021 go to post

The <transform> action seems to hide the return value of the call to the DTLName.Transform() method, but you should be able to call it in a code action and obtain it:

Set xform=##class(My.DTL.Class).%New()
Set tSC = xform.Transform(SrcMsg, .TgtMsg)

If there's been an error, tSC should tell you what it is ...

Jeffrey Drumm · Jul 6, 2021 go to post

I haven't actually tried this, but I suspect it's as simple as creating a message of type Ens.AlertRequest, populating it, and <call>ing Ens.Alert asynchronously in the <catchall>.

Or maybe insert an <alert> action?

Jeffrey Drumm · Jul 1, 2021 go to post

Hi @Eduard Lebedyuk,

I recently implemented this mechanism for handling ad-hoc message selection queries to the Google Health HL7v2 Store, and wanted to share a modification needed to satisfy the customer.

Their concern was that the service name was hard-coded in the dispatch class, and that they would have to touch the code if they used the class with a differently named service. To resolve that, I added a TargetConfigName property to the otherwise empty proxy service along with a SETTINGS parameter to reveal it through the configuration panel and allow the user to configure it.

I then modified the methods in the dispatch class to expect the service name in the URL "launch" argument and interrogate the production for the specified service's TargetConfigName value.

As always, thank you for the informative articles and answers!

Jeffrey Drumm · Jun 27, 2021 go to post

Would it be possible to provide a little more detail? Are you referring to the Ensemble/HealthConnect message store, the HealthShare UCR, or the TrakCare EHR?

Jeffrey Drumm · Jun 25, 2021 go to post

The tools for doing this will vary by platform, but a utility called qpdf supports your needs for most modern Unix/Linux variants. You would call it from ObjectScript using the $ZF(-100) function.

Jeffrey Drumm · Jun 25, 2021 go to post

Do you need the eventual user to be prompted for a password when opening the PDF? If so, you'll need to push it through an external application/utility (under IRIS/Cache control) that supports command-line password protection for the output file.

If you just need to encrypt the file for delivery but don't need the user to be prompted for a password when opening the document, there are a number of encryption options in the %SYSTEM.Encryption class.

Jeffrey Drumm · Jun 18, 2021 go to post

I'm seeing some interesting behavior in the Production view, and I think it has something to do with changes made to the way active items are colored when not actually running. The Proxy Service's status icon always displays pale green when enabled, while other items that are enabled display a dark green icon. This is behavior I first noticed in HealthConnect/IRIS4Health with 2020.1 in relation to scheduled hosts. Although they were enabled, they would only display in the dark green color when the schedule started them and would revert to pale green when the schedule stopped them.

I'm just curious to know if there's a way to force the proxy service to display a "normal" dark green icon, even though it's not actually doing anything.

Jeffrey Drumm · Jun 17, 2021 go to post

Hi @Eduard Lebedyuk ,

I'm working on what I expected to be a fairly simple web service that would accept a JSON payload as the body. I started with your code and instructions here, but I can't seem to get past this error:

While the class appears to be dispatched properly, It appears that the %request object has no Data property, and I'm not understanding why.

I searched for other examples of the %request object in the InterSystems-supplied classes and found no reference to the Data member, so am unsure how to proceed. Thanks in advance for your help!

Jeffrey Drumm · Jun 8, 2021 go to post

Thanks, Eduard. I found it late last night in the class docs, along with some other stuff I was looking for. Came back here first thing this morning to update my post, but you were, as usual, very quick to answer!

Thank you yes

Jeffrey Drumm · Jun 7, 2021 go to post

Apologies for digging up this old thread, but this solution doesn't seem to work for IRIS Interoperability Business Operations (and, I'm assuming, Services). Is there A mechanism to get at message header data from within a custom operation?

Jeffrey Drumm · Jun 1, 2021 go to post

I guess I answered my own question. Did some poking around and found the data from the dynamic object in  global ^EnsLib.H.MessageD, which tells me that the %DynamicObject is persisted as part of the message object. So that's good.

I think 😁

Jeffrey Drumm · May 31, 2021 go to post

You appear to be attempting to call the method from the debugger. Type Q to return to the normal Cache/IRIS prompt and try again ... let me know what happens.

Being in the debugger shouldn't be a problem unless you have the Secure Debug Shell enabled. There are a lot of things you can't do from the debugger when that's enabled, and one of them is using the SET command.

Jeffrey Drumm · May 28, 2021 go to post

I tested the method on my own system before posting it, so I'm not sure why you're getting the error.

Did you compile the class after saving it?

Are you certain the name of the production is spelled correctly?

Are you in the proper namespace?

EDIT: I also added a tiny bit of error checking to the original method ... note the Return statement after the line Set tPrd...