While starting with Intersystems IRIS or Cache, developers often encounter three core concepts: Dynamic Objects, Globals & Relational Table. Each has its role in building scalable and maintainable solutions. In this article, we'll walk through practical code examples, highlight best practices, and show how these concepts tie together.

1. Working with Dynamic Objects:

3 2
4 101

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.

Dynamic Objects

Dynamic Objects are very similar to the standard ObjectScript object model you get when you create a new instance of a class object, but with some key differences:

2 1
2 82

What are best practices for JSON transformation in IRIS interoperability? This is for a non-healthcare use case, so any tools we happen to have around FHIR might not be available. The motivating use case is trimming down a verbose and needlessly complex REST API response to feed to an LLM - trying to reduce token usage and maybe get better results from less noisy data.

0 5
0 74

Hi folks!

Sometimes, when designing a class method and feeding it with more and more useful features, very soon the number of parameters can reach 10 and even more.

It becomes pretty difficult for users of useful methods to remember the position of the important parameter, and it is very easy to misuse the position and transfer the wrong value to the wrong parameter.

Here is an example of such a method (I asked GPT to create a method with 20 params):

ClassMethod GenerateReportWith20Params(
    pTitle As %String = "",
    pAuthor As %String = "",
    pDate As %String = "",            // e.g. 2025-09-03
    pCompany As %String = "",
    pDepartment As %String = "",
    pVersion As %String = "1.0",
    pFormat As %String = "pdf",       // pdf|html|docx
    pIncludeCharts As %Boolean = 1,
    pIncludeSummary As %Boolean = 1,
    pIncludeAppendix As %Boolean = 0,
    pConfidentiality As %String = "Public",
    pLanguage As %String = "en",
    pReviewers As %String = "",       // CSV, e.g. "Alice,Bob"
    pApprover As %String = "",
    pLogoPath As %String = "",
    pWatermarkText As %String = "",
    pColorScheme As %String = "default",
    pPageSize As %String = "A4",
    pOrientation As %String = "Portrait",
    pOutputPath As %String = "report.pdf"
) As %Status
{

// implementation
}

3 0
1 46