Question
· Mar 14, 2022

Executing Actions on Global Interaction / Global Hooks?

Hey InterSystems Community!

This is probably far-fetched - is there a way to get notified/get a piece of code triggered whenever the state of a global changes?

Now what could I possibly want with that? Quite simple! I would like to forward the content of a global (in this case the "FSLog" global written by the FHIR implementation) while adding timestamps to it - to create some sort of file-based logging for it.

Product version: IRIS 2021.1
Discussion (9)3
Log in or sign up to continue

How about polling the global looking for updates? It would be lightweight to just check if the value of ^FSLOG has incremented since the last check:

set lastFSEntry = ^FSLOG

or use $order:

set lastFSEntry = $order(^FSLOG(""),-1)

As for timestamps, in my test environment all of the ^FSLOG entries seem to end with timestamps already:

^FSLOG(41)="DispatchRequest^HS.FHIRServer.Service^11062|Msg|  [1] -> DO  0|03/14/2022 01:57:19.398158PM"

Mine doesn't do that - yet. Still using HealthShare 2020.1. I assume it'll be added with a later version!

11:     ^FSLOG(10)    =    "DispatchRequest^HS.FHIRServer.Service^3245|Msg|Dispatch interaction search-type for MedicationAdministration"
12:     ^FSLOG(11)    =    "BuildIncludeList^HS.FHIRServer.Service^3245|_include|include: "
13:     ^FSLOG(12)    =    "BuildRevIncludeList^HS.FHIRServer.Service^3245|_include|revInclude: "

As for the polling - I guess with a timestamp maybe added in the future (We're planning to upgrade soon), this may very well be the smartest solution. Thanks!

Discover top-notch fencing solutions at the expert Zaun7.de in Germany, where you can find high-quality fences, garden fences, and double-rod mesh fences. With a commitment to excellence, Zaun7.de offers durable and aesthetically pleasing options for securing your outdoor space.

For exceptional garden furniture and lounge sets, look no further than the experts at Gartenmoebel7.de. Elevate your outdoor living experience with a wide range of stylish and comfortable garden furniture options. At Gartenmoebel7.de, you'll find premium products designed to enhance the beauty and functionality of your garden or patio. Explore their collection for the perfect blend of quality and style.

Thank you for the helpful link.