#Code Snippet

6 Followers · 302 Posts

Code snippet is a programming term for a small region of re-usable source code, machine code, or text.

Article Robbie Luman · Aug 15, 2025 7m read

Dynamic Entities (objects and arrays) in IRIS are incredibly useful in situations where you are having to transform JSON data into an Object Model for storage to the database, such as in REST API endpoints hosted within IRIS. This is because these dynamic objects and arrays can easily serve as a point of conversion from one data structure to the other.

4
3 303
Article David Hockenbroch · Feb 18 7m read

In the previous article, we examined how we can use the %CSP.Request and %CSP.Response classes to test a REST API without having the API fully set up and accessible across a network with an authentication mechanism. In this article, we will build on that foundation to perform some simple unit testing of one of our REST API methods.

The unit testing framework requires a couple of setup steps before we can use it. First, we have to ensure that the unit testing portion of the management portal is enabled so we can review the results of our tests.

0
2 140
Article Barry Meyer · Jan 23 3m read

Senior engineering is defined not by the volume of code produced, but by the strategic avoidance of it. In complex integration environments, the tendency to utilize general-purpose libraries for every niche requirement introduces unnecessary overhead. True architectural maturity requires a commitment to "minimalist tooling"—prioritizing resilient, battle-tested system utilities over custom logic. This assessment examines our PGP encryption/decryption pipeline to demonstrate how shifting from application-level libraries to OS-native delegation enhances system durability.

0
0 11
Article Keren Skubach · Dec 29, 2025 2m read

When working with InterSystems Interoperability (Iris / Health Connect / Ensemble), configuration data is often spread across many production items: services, processes, operations, adapters, and their settings.

A common operational or security need is to answer questions like:

  • Which interfaces reference file system paths?
  • Where are directories, network shares, or absolute paths configured?
  • Can I quickly audit or document this information across all my productions?

The ObjectScript utility below solves exactly that problem by exporting selected configuration settings into a CSV file.

0
2 109
Article Keren Skubach · May 5, 2025 4m read

An extension “extends” or enhances a FHIR resource or a data element in a custom way. The extension can be added to the root of a resource, such as “Patient.ethnicity” in US Core profile, and they can be added to individual elements such as HumanName, Address or Identifier.

Did you know that you can also add an extension to a primitive data type?

Primitives usually store a single item and are the most basic element in FHIR. For example: "Keren", false, 1234, 12/08/2024 etc.

2
2 384
Article Joan-Baptista Fabregas · Dec 8, 2025 4m read

One of the newest features of .Net core 10 with C# 14 is the file-based apps. This feature allows you to execute C# code in a simple .cs file without the need to create a solution, a project, or any of the related structure.

For example you can create a script.cs file using the notepad with the content: 

Console.WriteLine(“This is a script in c#.”);

Then in the command line or the terminal you execute the command:

dotnet run script.cs

There is plenty of information about this new feature of .net 10.

0
0 78
Article Andrew Sklyarov · Nov 8, 2025 4m read

When I started my journey with InterSystems IRIS, especially in Interoperability, one of the initial and common questions I had was: how can I run something on an interval or schedule? In this topic, I want to share two simple classes that address this issue. I'm surprised that some similar classes are not located somewhere in EnsLib. Or maybe I didn't search well? Anyway, this topic is not meant to be complex work, just a couple of snippets for beginners.

0
0 128
Question Michael Akselrod · Nov 3, 2025

Only method/routine executed as "do Method..." is included into $ESTACK.
How can I modify a method or routine that returns a value so it can be included in $ESTACK?
Example upon executing via Studio Debug ($ESTACK is converted to string with ">" delimiter):
    Expected: stackstr = %Debugger.System.DebugStub > LogGenerate > Entry > DirChain > Attributes >  LogNew > LogSize >  LogFormat > LogWrite
        Processes DirChain, LogNew, LogSize, LogFormat are executed as "If Method..."
        Process Attributes is executed as "set a = Attributes..."
    Current: stackstr =  %Debugger.

1
0 73
Question Michael Akselrod · Oct 29, 2025

Environment:
    Targeted *.inc file (with hundreds of defined macros) is in use throughout the application and included into every class declaration.
    Statement "set a = $$$TestIf(3)" is included into a classmethod with no other code in. Expected output 5
Same macro options in *.inc:
    #define TestIf(%arr)    if %arr>0 QUIT 5
    #define TestIf(%arr)    if (%arr>0) {QUIT 5}
Issue:
    failure to compile class with the same error on all tried definition options as:

13
0 166
Article David Hockenbroch · Jul 10, 2025 16m read

Dear community, I have a confession to make. I have not gotten over Zen yet. Alas, all good things must come to an EOF, so I am currently learning about Angular. I am working on proving to myself that with the right back end and Angular components, I can deliver to myself and my team a very Zen-like experience in this environment. Since this is my first attempt, here is a fair warning: I will be providing some rather large code samples before discussing them. Please warm up your mouse and hand for extensive upcoming scrolling!

7
1 274
Question Yone Moreno Jiménez · Jun 23, 2025

Good morning,

We would need help, thanks in advance for your help. 🙂

We have been trying to debug the following error, when sending a DICOM from a "EnsLib.DICOM.Operation.TCP" to a PACs:

 



  ERROR <EnsDICOM>NoCompatibleTransferSyntaxFound: No negotiated transfer syntax for SOP class '1.2.840.10008.5.1.4.1.1.4' is compatible with document transfer syntax '1.2.840.10008.1.2.4.70'

 

We use the following AET titles at the Operation:

LocalAET: ESBSSCC-DCM

RemoteAET: HUNSCESBGWT

 

We have observed that we do have the transfer syntax "1.2.840.10008.5.1.4.1.1.4" with the document syntax "1.2.840.

6
0 135
Question Yone Moreno Jiménez · Jun 23, 2025

Hello, good morning, thank you so much for reading this question. ☺️🙂👍

 

We are developing a code to get information about our Production's items: services, processes and operations.

 

We know we can get various configurations of a given item: Category, Port, Enabled...

 

But we wonder how we could get the date time of the last mesage (most recent) received in an item.

 

To give a code snippet a small section of the code we have developed (and tested), it looks like:

[...]

For i=1:1:tProduction.Items.Count() {
    #dim item as Ens.Config.Item
    set item = tProduction.
2
0 130