Introduction
What's in a name? That which we call a rose
By any other name would smell as sweet
William Shakespeare, "Romeo & Juliet"
In this article, we will describe a set of naming conventions for ObjectScript code.
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
What's in a name? That which we call a rose
By any other name would smell as sweet
William Shakespeare, "Romeo & Juliet"
In this article, we will describe a set of naming conventions for ObjectScript code.
Hello
I want to get the property of a class, sorted by order in storage.
I know we can use
Set definition = ##class(%Dictionary.ClassDefinition).%OpenId(className)
Set listProperty = definition.Properties
For ii = 1:1:listProperty.Count(){
write listProperty.GetAt(ii).NameBut using GetAt sorts the results alphabetically.
Example :
Class Test.class Extends (%SerialObject, %XML.Adaptor, %JSON.Adaptor)
{
Property tiers As %String;
Property journal As %String;
}listProperty.GetAt(1).Name = "journal" and listProperty.GetAt(2).
This article is a continuation of the IRIS JSON project and features additional methods and insights.
Let's continue with the instance methods
This instance method is used to determine the JSON data type of the %DynamicObject or %DynamicArray.
It returns one of the following strings:
|
|
USER>Set array = [1,"test",true,12.This great article sparked some recent private discussion, and I'd like to share some of my own thoughts from it.
The motivating concern boils down to: Why do we need coding rules or conventions at all? What happened to the wonderful era of the Renaissance artist-programmer forging their own path, prior to being supplanted by the craftsman and now (even worse) by AI?
In short, there are a few reasons why coding standards/guidelines are useful, and the Renaissance artist-programmer is not entirely gone.
Hi Everyone,
Please suggest/share best practices and sample questions that would help me to secure InterSystems HL7 specialist Certification.
I have a custom Buffer class which is designed to capture written/printed statements to the device, to be able to transform the captured text to string or stream type. I have used this in ObjectScript to capture ObjectScript write statements and return a string. I would like to try to use this with a [ Language = python ] method as follows. This class will be called by a scheduled task.
/// ObjectScript code which initializes buffer to capture statements written in nested method call
ClassMethod CollectStringFromBuffer()
{
set buffer = ##class(CustomClass.Buffer).%New()
do buffer.Hello, how are you?
First of all thanks for your time reading this question.
We are investigating how to validate the indexes of a global. We have read:
https://docs.intersystems.com/irisforhealth20251/csp/docbook/DocBook.UI…
And:
https://docs.intersystems.com/irisforhealth20251/csp/documatic/%25CSP.D…
We want to validate the inxedes of the global titled "Ens.Util.LogD". We have executed on the ObjectScript terminal, on the desired namespace:
ESBSSCC>set tSC = $SYSTEM.OBJ.
Reviewing my published packages, I identified a nasty bug in IRIS Native API
Working in healthcare IT as a young developer, especially on InterSystems TrakCare, you quickly realize one thing: it’s not just about HL7 messages or backend integrations. A huge part of making TrakCare work smoothly for hospitals comes down to how it’s configured, customized, and supported on the application side.
That’s where people like me come in—techno-functional developers who understand both the tech and how it impacts actual hospital workflows.
Our role sits right in the middle.

In this section, we will explore how to use Python as the primary language in IRIS, allowing you to write your application logic in Python while still leveraging the power of IRIS.
Word documents are widely used in the market. Users frequently create contracts, memos, resumes, reports, analyses, and other documents that may require data from or captured by InterSystems IRIS. However, IRIS does not have an API, SDK, library, or adapter for this. This limitation no longer exists.
The new Open Exchange library iris4word (https://openexchange.intersystems.com/package/iris4word) delivers an ObjectScript SDK where the developer passes any %DynamicObject as a parameter, a Word file template and then receives a ready document, with the structure and formatting defined in its template.
.png)
Let's start with a simple motivating question: over the past 14 days, what are my most common errors in the Application Error Log?
Answering this through the management portal or terminal is an annoying manual process - we should just be able to use SQL. Fortunately, there are a few class queries to help with this in the SYS.ApplicationError class in the %SYS namespace. You can answer the question for a single date with something like:
select "Error message",count(*)
from SYS.Hi,
I have a code that copy a method to another class for analysis purpose.
I also want this method to appear first in the source code to easily use it in VSCode with the classmethod debug button and not search it in the numerous method of the modified class.
Is there a way to do such a thing?
I tried the placeAfter keyword but I can't find a way to make it really work as I want. Is their other ways to control the order of methods?
Imagine you’re walking down the street on a nice summer’s day, and someone walks up to you and says “Hey, you work at InterSystems, right? I’ve been hearing more and more about InterSystems IRIS lately. I know IRIS has its own programing language called ObjectBook? or InstaScript? OK, I admit it, I know it’s called ObjectScript! I know IRIS also supports Python. I’m a Python developer, so that sounds great to me. But I’m also interested in ObjectScript. For example, Python and other languages support collections. Does ObjectScript support collections?”
You’d answer “Of course!”
And then your new friend might get excited and start firing off more questions:
How would you answer? Well, you don’t have to worry about answering. All you’d have to do is send your new friend the URL of this long page.

Now that we have a good understanding of Python and its features, let's explore how we can leverage Python within IRIS.
Sending emails is a common requirement in integration scenarios — whether for client reminders, automatic reports, or transaction confirmations. Static messages quickly become hard to maintain and personalize. This is where the templated_email module comes in, combining InterSystems IRIS Interoperability with the power of Jinja2 templates.
Jinja2 is a popular templating engine from the Python ecosystem that enables fully dynamic content generation.

This will be a short article about Python dunder methods, also known as magic methods.
Dunder methods are special methods in Python that start and end with double underscores (__). They allow you to define the behavior of your objects for built-in operations, such as addition, subtraction, string representation, and more.
Some common dunder methods include:
__init__(self, ...): Called when an object is created.
%OnNew method in ObjectScript.__str__(self): Called by the str() built-in function and print to represent the object as aAre you curious about how to run Python scripts directly in your InterSystems IRIS or Caché terminal? 🤔 Good news it's easy! 😆 IRIS supports Embedded Python, allowing you to use Python interactively within its terminal environment.
How to access the Python Shell?
To launch the Python shell from the IRIS terminal, simply run the following command:
do ##class(%SYS.Python).Shell()This opens an interactive Python shell inside the IRIS terminal. From here, you can write and run Python code just as you would in a normal Python environment.

Modules what a topic! We don't have this notion in ObjectScript, but it's a fundamental concept in Python. Let's discover it together.
I see modules as an intermediate layer between classes and packages. Let see it by example.
A bad example :
# MyClass.py
class MyClass:
def my_method(self):
print("Hello from MyClass!")
When you try to use this class in another script, you would do:
# class_usage.py
from MyClass import MyClass # weird, right?
my_instance = MyClass()
my_instance.my_method()
Why this is a bad example?
Working on wrapping an IRIS Cache ObjectScript method that runs for a few seconds. Trying to get UI updates to show BEFORE the method runs in an async/await function. But it seems to be running synchronously rather than asynchronously . So my question is does IRIS/ObjectScript CSP pages support futures with JavaScript or does it run all synchronously.
InterSystems is pleased to announce that version 3.0.5 of the VS Code - ObjectScript extension has been released. This release includes many bug fixes, as well as changes to the telemetry data we collect. Collecting more product usage data helps InterSystems identify and prioritize fixes and enhancements that will have the most positive impact for you, our users. Personally identifiable information (PII) will never be collected, and telemetry can be disabled using the telemetry.telemetryLevel setting. The full list of data points that are collected can be found here.
I am trying to catch an exception and write it to the Application Error Log, but cant find any details on how to do this in IRIS health.
Catch ex { Set logger = ##class(%Logger).%GetLogger("MyApp") Do logger.Error($ZError) }
Cant seem to find the %Logger class either.

This will be a short article about PEP 8, the Python style guide.
In a nutshell, PEP 8 provides guidelines and best practices on how to write Python code.
I am trying to create users who only have `%SQL` Role for the INSTANCE. But I am unable to find any documentation on the `
See:
// Instantiate the Security.Users object Set userObj = ##class(Security.Users).%New() // Set the username and password Set userObj.Name = userName Set userObj.FullName = userFullName Set userObj.Namespace = "USER" Set userObj.Roles = "%SQL" Set sc = userObj.ChangePassword(passwd) // Save the user to the database Set ss = userObj.
in order to do analysis on huge data volumes, it is better to take you data to a separate machine for analysis away from the operational machine, so trying to write huge globals or tables into files as is would take a huge space, what could be a solution or best practice ?..in python for instance, there is the pickling option (serializes data to byte string and saves it to a file) to save space, what could be best in object script ?

This will be an introduction to Python programming in the context of IRIS.
Before anything I will cover an important topic: How python works, this will help you understand some issues and limitations you may encounter when working with Python in IRIS.
All the articles and examples can be found in this git repository: iris-python-article
Python is an interpreted language, which means that the code is executed line by line at runtime even when you import a script.
What does this mean ? Let's take a look at the following code:
# introduction.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!
Hi Developers!
There is a free ObjectScriptQuality tool for ObjectScript developers who upload solutions on GitHub. This tool helps developers validate ObjectScript code using a variety of rules, based on common code errors.
There are currently 16 rules in this tool, but there are definitely many more rules to consider when testing ObjectScript code.
Could you suggest any other rules to add to this tool?
Note: You can submit it as an idea on the InterSystems Ideas for the 2nd Idea-A-Thon contest.
Hello my friends,
I have a problem with Objectscript, why the value of address become like this ?
.png)
everything works fine except the Address,
this is my code, do I need something to make this into real address ? should I put something in my code ?
set paper=obj.PAADMPAPMIDR.PAPMIPAPERDR
if '$isobject(paper) continue
set Address=paper.PAPERStName
thank you for your help
Best Regards,
Steven Henry