ImageMagick is likely available for your platform and can be called using $ZF(-100). It has a LOT of image conversion options.

A sample command line for svg to png conversion:

$ convert -background none -density 1000 -resize 1000x myvector.svg myraster.png

Example using $ZF(-100):

Class User.Util.Image [ Abstract ]
{

ClassMethod Convert(pSourceFile As %String, pDestFile As %String, pDensity As %Integer = 1000, pResize As %String = "1000x", pBackground As %String = "none") As %Status
{
    Set OsCmd = "/usr/bin/convert"
    Set OsArgs(1) = "-background"
    Set OsArgs(2) = pBackground  // "none" for transparent and black for formats w/o alpha channel
    Set OsArgs(3) = "-density"
    Set OsArgs(4) = pDensity // set the vector width before resizing for best image quality
    Set OsArgs(5) = "-resize"
    Set OsArgs(6) = pResize // image output width/height (default is width 1000 keeping aspect ratio)
    Set OsArgs(7) = pSourceFile
    Set OsArgs(8) = pDestFile // file type controlled by extension; .png, .jpg, .gif etc.
    Set OsArgs = 8
    Set tRC = $ZF(-100,"",OsCmd,.OsArgs)
    // On Linux, a return code of 0 indicates success
    If '(tRC = 0)
    {
        Return $$$ERROR(5001,"OsCmd "_OsCmd_" Returned Error Code ["_tRC_"]")
    }
    Return $$$OK
}

}

Called like this:

Set tSC = ##class(User.Util.Image).Convert("/path/to/filename.svg", "/path/to/filename.png")

I don't think so.

UpdateProduction (I think that's what you meant) is attempting to obtain state information for all of the business hosts and likely won't complete until they're all down. Calling it at the end should still be faster than having it enabled for each EnableConfigItem() call.

The reality is that you appear to have a lot of processes that are dependent on polling rates and/or getting the appropriate responses back from external systems on notification they're terminating connections.

If you need to shut down the interfaces fast, you really can only do it at the expense of graceful connection termination.

Have you considered creating separate namespaces and compartmentalizing interfaces to keep your productions at a more manageable size? Business hosts in multiple smaller productions benefit from parallelism when performing administrative tasks like stopping/starting interfaces in bulk.

That should probably be a choice for completeness' sake.

But you can create an ObjectScript class by right-clicking the server or one of its packages in the Explorer pane and entering the package/class name with a .cls extension. Use slashes rather than periods as package/class delimiters (if you use periods, it may display differently in Explorer until you refresh the window).

What's the use case for this function?

ISC's Interoperability business rule editor has some quirks; it does not allow the passing of variables by reference to custom methods and that will cause objects to be passed as the OREF string in some cases. I was wondering if there was a way to work around that by obtaining another reference to the object by its OREF string, since that's what i ended up with.

I haven't tried this yet ... it may not work for the specific scenario I encountered. But this discussion has certainly helped me understand how things work under the covers a bit better.

So I forgot that there's a Pad() method in the DTL function list that would likely work better for your purposes than $EXTRACT() and $JUSTIFY(). You can use it to zero or space fill the fields to the required width. The first argument is the value to pad, the 2nd the width (positive numbers for pad right, negative for left), and the 3rd is the pad character to fill with.

Your update to the requirements is incomplete; it doesn't specify what, if anything, goes in the 2nd (and subsequent) row(s) of the output after the ItemCodeExternal.Identifier value, whether the fractional value is in the Quantity field is right or left justified zero-filled, or whether the UnitofMeasure and DateNeeded values are padded to make line length consistent across all records.

Here's an example of what it might look like and will need to be adjusted to accommodate your vendor's spec:

The code rules that write the records to the stream would need to be adjusted to eliminate the "|" delimiters and insert the renamed/added variables:

This should get you to where you need to be.

Hi Doug,

Looks like only two lines need to be changed in what I posted previously; they're numbered 20 and 26 in the screen shot. You'd use a combination of string concatenation and $EXTRACT(), along with $JUSTIFY() to line things up according to the specification. Alternately you can set the variables to the justified/aligned/padded version of the values extracted from the HL7 message and then just concatenate them without the pipe characters in lines 20 and 26.

If I have time over the weekend I'll take a stab at it, but if you figure it out beforehand, please post your solution here.

I went ahead and created a DTL that appears to do what you requested and does not require a custom File Operation to work; It assumes you're using EnsLib.File.PassthroughOperation as the outbound operation class.

The filename is created using the value set for target.OriginalFilename in Ens.StreamContainer in the DTL, so you could base it on something from the HL7 message itself or just set it to a static value (as I've done). You can use date/time tokens in the outbound operation's File Name field to aggregate multiple messages per file, or just let it create uniquely named files for each message with the default pattern.

Here's the DTL Configuration:

And the rules:

To test, I created a HL7 file with repeating ORC groups based on the sample provided in your post, but the DTL will work whether it's repeating or not:

The Filename pattern I used in the outbound operation:

This file was created:

And contained this output:

Hope this helps.

If the 3rd argument to EnableConfigItem() is 1, the method will update the production on each call. That can be time consuming, so it might be worth considering setting that to 0 and then call Ens.Director.UpdateProduction() after the loop completes.

The other issue is that simply disabling a Production Config Item will only shut it down at the next polling interval or completion of the currently-processing request. This is a generally a good thing, but can take time for some interfaces.

For @Eduard Lebedyuk's benefit ... the regex @Scott Roth referred to is most likely to allow the selective shutdown of interfaces by name pattern to accommodate outages/upgrades for external systems. Alternately to be able to disable inbound interfaces before outbound interfaces to prevent queued messages.

Well I guess there IS a setting (thanks, @Eduard Lebedyuk!) laugh

The parameter Undefined specifies the behavior when ObjectScript attempts to fetch the value of a variable that has not been defined. The value of Undefined may be 0, 1, or 2:

  • 0 - Always throw an <UNDEFINED> error. (default)
  • 1 - If the undefined variable has subscripts, return a null string, but if the undefined variable is single-valued, throw an <UNDEFINED> error.
  • 2 - Always return a null string.

You can change that setting in System Administration | System Configuration | Additional Settings | Compatibility.

What does your method's argument list look like? If it's something like this:

Method Encrypt(pVarA As %String = "", pVarB As %String = "", pVarC As %String = "") As %Status

The pVar* variables above should automatically default to empty strings when the method is called as provided in your first example.

I'm not aware of any system setting that would affect the behavior of unsupplied values for method arguments when they're not defined with an initial value (unlike those in my snippet above).

That doesn't mean that there isn't one, though ...

Not sure what version of Caché or IRIS you're on; for future reference it's helpful to include that information. In IRIS 2021.2, you can do this from the IRIS SQL Shell:

JEFF>do $system.SQL.Shell()
SQL Command Line Shell
----------------------------------------------------
The command prefix is currently set to: <<nothing>>.
Enter <command>, 'q' to quit, '?' for help.

[SQL]JEFF>>set displaypath /home/jeff/tmp/
displaypath = /home/jeff/tmp/

[SQL]JEFF>>set displayfile sqlout
displayfile = sqlout

[SQL]JEFF>>set displaymode csv
displaymode = csv

[SQL]JEFF>>set selectmode display
selectmode = display

[SQL]JEFF>>select top 100 * from Ens_Util.Log
13.     select top 100 * from Ens_Util.Log

/home/jeff/tmp/sqlout.csv
/home/jeff/tmp/sqloutMessages.txt

statement prepare time(s)/globals/cmds/disk: 0.0002s/6/831/0ms
          execute time(s)/globals/cmds/disk: 0.0035s/467/20822/0ms
                          cached query class: %sqlcq.JEFF.cls115
---------------------------------------------------------------------------

The default delimiter is comma, but you can change that. For example, the tab character:

[SQL]JEFF>>set displaydelimiter = $C(9)