Eduard Lebedyuk · Jun 22, 2023 go to post
Set image.Prompt = "Two cats with a hat reading a comic"

Come on, why wouldn't you post the results?

Eduard Lebedyuk · Jun 21, 2023 go to post

Why will this only work in Chrome and not Microsoft Edge?

Is that a local server? Edge does not allow websockets on localhost.

In the Edge open About:flags page. Enable the "allow Localhost Loopback" feature.

Eduard Lebedyuk · Jun 20, 2023 go to post

Can you show the definition for /terminalsocket web app please?

If it's a DEV server, add %ALL to it and check if it works.

Also, check Audit DB for PROTECT errors.

Eduard Lebedyuk · Jun 20, 2023 go to post

UPD: Never mind, that's the wrong answer as it's about HL7. Sorry about that.

There are two ways to do that:

  1. Use EnsLib.MsgRouter.VDocRoutingEngine, it has Validation setting which is a string specifying types of validation to perform. Set to 1 to block documents that don't pass default validation. Default validation checks for DocType assignment and successful BuildMapStatus. This is equivalent to 'dm': 'd' - require DocType 'm' - require successful BuildMap status. Set to 0 to skip validation. In addition configure Bad Message Handler setting to handle messages which fail validation. I'm not sure it your messages would fail BuildMap validation, but that's the easiest option to implement.
  2. Create a subclass of EnsLib.MsgRouter.RoutingEngine and implement OnValidate method to provide custom validation. You'll also need to add Validation property to settings, same as EnsLib.MsgRouter.VDocRoutingEngine  does. In OnValidate method you can perform any checks you like.
Eduard Lebedyuk · Jun 20, 2023 go to post

Do you want to job ObjectScript code? Write a wrapper class method and call it from embedded python.

Eduard Lebedyuk · Jun 16, 2023 go to post

Found it:

set sc = ##class(EnsLib.HL7.SchemaXML).Import(filenameOrStream)

Works with both old and new export.

Eduard Lebedyuk · Jun 15, 2023 go to post

Anything better than manual wrangling:

Set tSC=##class(%Atelier.v2.Utils.TextServices).SetTextFromArray(.tTextArray,0,"CatNameFromFile","OTH",0)
Eduard Lebedyuk · Jun 1, 2023 go to post

I don't think dynamic return value is possible.

As a workaround you can write the desired destination value in context and redefine doOneAction in your custom router engine to replace i.e. @destino value with a value from a context before calling ##super.

Eduard Lebedyuk · May 30, 2023 go to post

Run:

do ##class(HS.HC.Util.Installer).InstallFoundation(ns)

to enable HS package in a different namespace.

Eduard Lebedyuk · May 29, 2023 go to post

If you're using git/Gitlab you can have System Default Settings file (export, import) specific for each deployment.

  • /<repo>/config/SDS/dev.xml
  • /<repo>/config/SDS/test.xml
  • /<repo>/config/SDS/live.xml

And get the path as: config/SDS/$CI_COMMIT_BRANCH.xml

This way the code is the same everywhere, and you only load one SDS file, depending on the current environment.

Eduard Lebedyuk · May 27, 2023 go to post

3 times cheaper. Or you can get the compute Savings Plans for AWS Fargate.

Compare prices:

  • On Demand (100%): $0.04048 per vCPU per hour + $0.004445 per GB per hour
  • Spot (31%): $0.01254 per vCPU per hour + $0.00137698 per GB per hour
  • 3 years upfront Compute Savings Plan (48%): $0.0194304 per vCPU per hour + $0.0021336 per GB per hour
Eduard Lebedyuk · May 27, 2023 go to post

At this point I would highly recommend just writing a cfn template, rather than clicking through 30 screens.

Great article though.

Notes:

  1. Split cluster and service/task creations into separate stacks.
  2. By default your cluster would have FARGATE and FARGATE_SPOT capacity providers, but if you use Launch type compute configuration you'll only get Fargate On-Demand. To use Spot you need to use Capacity provider strategy compute configuration and specify Spot.
     
Eduard Lebedyuk · May 25, 2023 go to post

Does your license support IAM? What's the output for this command:

w $SYSTEM.License.GetFeature(21)
Eduard Lebedyuk · May 25, 2023 go to post

As long as you insert only with SQL (without %NOINDEX flag) or objects (%Save), you don't have to rebuild indices. But some gotchas to remember:

  • If the table has some data before you added an index, you need to build the index after adding it (as adding an index does not build it for preexisting data)
  • If you ran sql queries which filtered based on an indexed column value, they won't automatically take advantage of the index, you need to purge all queries associated with the newly indexed table.
  • If you use %NOINDEX or direct global access to add rows, indexes must be built manually later
Eduard Lebedyuk · May 24, 2023 go to post

Here's the code to create task to purge messages in all interoperability namespaces:

set sc = ##class(%SYS.Namespace).ListAll(.result) 
kill result("%SYS"), result("HSCUSTOM"), result("HSLIB"), result("HSSYS"), result("REPO") 
while 1 {set ns = $o(result($g(ns))) quit:ns="" continue:$e(ns,1,2)="^^" set $namespace = ns continue:'##class(%Dictionary.ClassDefinition).%ExistsId("Ens.MessageHeader") set task=##class(%SYS.Task).%New(),task.Name = "Purge old Interoperability data in " _ $namespace,task.NameSpace=$Namespace,task.TimePeriod=0,task.TimePeriodEvery=1,task.DailyFrequency=0,task.DailyFrequencyTime="",task.DailyIncrement="",task.DailyStartTime = 3600,task.DailyEndTime = "",task.StartDate = $p($H,",",1)+1,task.Priority = 2,task.Expires = 0,taskdef = ##class(Ens.Util.Tasks.Purge).%New(),taskdef.BodiesToo = 1,taskdef.KeepIntegrity = 1,taskdef.NumberOfDaysToKeep = 1,taskdef.TypesToPurge = "all",sc = task.AssignSettings(taskdef),task.TaskClass=$classname(taskdef),sc = task.%Save()}
Eduard Lebedyuk · May 23, 2023 go to post

I try to ask all non-sensitive questions on community so that the info would be available publicly.

Eduard Lebedyuk · May 18, 2023 go to post

There was actually supposed to be a hard mode, where rotation can happen in any (of two) directions, but I removed that.

Eduard Lebedyuk · May 18, 2023 go to post

Here's how to fix that.

1. Create Inbound adapter which extends default inbound adapter and exposes DeleteFromServer setting:

Class Test.InboundAdapter Extends EnsLib.File.InboundAdapter
{
Parameter SETTINGS = "DeleteFromServer:Basic";
}

2. Create Passthrough Service, which uses your custom adapter:

Class Test.PassthroughService Extends EnsLib.File.PassthroughService
{
Parameter ADAPTER = "Test.InboundAdapter";
}

3. Use your class (2) when you create a new BS, it will have DeleteFromServer property:

I filed an enhancement request, please use DP-422980 as an identifier if you would contact WRC on this topic.