Hi Community,
Enjoy watching the new video on InterSystems Developers YouTube:
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.
Hi Community,
Enjoy watching the new video on InterSystems Developers YouTube:
Hi guys!
My student asked my why his unit tests don't work as they should, and I just could answer him. Here is the simplified case.
There is a class with a required unique property Name:
Class Test.NewClass [ Abstract ]
{
Property Name As %String [ Required ];
Index NameIndex On Name [ Unique ];
}And there is an inherited class:
Class Test.NewClass1 Extends (%Persistent, Test.NewClass)
{
}What I expect to happen, is when I save two objects of class Test.NewClass1 with the same value of property Name, for the second one to get an error stating that it violates the unique index.
Hi Developers,
Enjoy watching the new video on InterSystems Developers YouTube:
When creating a PRA (Privileged Routine Application; which by the way is not relevant just for Routines but also for Classes/Methods), it is important to make sure you include a new $ROLES, before calling AddRoles(). For example:
new $ROLES
set status=$System.Security.AddRoles("MyPrivilegedRoutineApplication")This way you ensure that indeed the added (elevated) roles "evaporate" for the User running this code, once the User is out of the scope of that routine/method.
[Thank you @Andreas Dieckow for validating this]
TL;DR: This article describes an introductory-level project that exercises some string-manipulation functions in both ObjectScript and Python…with specs from a song.
After you’ve written your first “Hello World!” program, are you ready for a new fun challenge? An old, very popular (at the time) song may be just what you need.
While I was driving around on vacation in southern Maine, the local “Legends” radio station played the old classic, “The Name Game” by Shirley Ellis (https://www.youtube.com/watch?v=5MJLi5_dyn0).
Class CarDealer.Order Extends (%Persistent, %Populate)
{
Property Title As %String
Property Status As %String(VALUELIST = ",InProgress,Done,Canceled");
Trigger setStatus [ Event = INSERT, Foreach = row/object, Time = AFTER ]
{
&sql(update CarDealer.Order set Status = 'InProgress')
}
Hi Developers!
Often when we develop some library, tool, package, whatever on InterSystems ObjectScript we have a question, how we deploy this package on the target machine?
Also, we often expect that some other libraries already installed, so our package depends on them, and often on some particular version of it.
When you code on javascript, python, etc the role of packages deployment with dependency management takes package manager.
So, I'm pleased to announce that InterSystems ObjectScript Package Manager available!
Hi Community,
I need to convert HL7 Message into FHIR Format.Can anyone share basic reference for FHIR ADT^A01 message?
For converting HL7 message to FHIR we need to convert HL7 to SDA3 format and then converting SDA3 to FHIR format.
Please Share few basics steps for converting SDA3 to FHIR message?
Thanks
Smythee

preface
Since the contact with IRIS, it has been used most in hospitals as an ESB integration engine, as a link in the hospital's integration platform+data center. However, you can also develop some restful pis to be used as the backend of front end and back end separation projects
List of articles
Introduction
List of articles
I. Development of technologies and tools
II. Development Path and Relevant Codes
1. database
2. Preparatory work
3. Steps associated with developing an interface
4.
Hi,
I
want to get the values from a serial property because my code depends upon the class serial class.
For example
Serial class
Class Data.Serial Extends %SerialObject
{
Property FirstName as %String;
Property LastName as %String;
}
Persistent class
Class Data.Persistent Extends %Persistent
{
Property MPID as %Integer;
Property Name as Name.Serial;
}
Now i need save MPID and Name(Serial class property into SQL Table ) so i am trying the below class
Class Data.TestUtil Extends
{
Method Savedata(MPID,FirstName,LastName)
{
Set tSC=0
Set Obj=##Class(Data.Persistent).%New()
Set Obj.MPID=MPID
Set Obj.
Hi,
when I using ObjectScript Trigger Code , I want to get whether the fields has changed by using "{fieldName*C}" , actually, fieldName in "{fieldName*C}" is a real field name ,but in my code, fieldName is a variable as follows:
SET stat=##class(%SYSTEM.SQL).GetColumns(tableName,.byname,.bynum,1)
IF stat=1{
SET i=1
WHILE $d(bynum(i)){
SET xColName=bynum(i)
SET valComp={xColName*C}
IF valComp=1{
SET oldVal=1 //{xColName*O}
SET newVal=2 //{xColName*N}
&sql(INSERT INTO Yan.Hi, devs!
In ObjectScript I can refer to a class parameter as:
write ..#ParameterName
How do I do the same in Embedded Python?
Hi
I have a Zen Page with tablepane which has a datasource in a different namespace to that of the Zen Page. When the page is run, no data is returned and the tablepane is not populate, even though the rerferenced table contains dat.
The tablePane code is as follows:
<tablePane id="DataExtractionCurrent"
showZebra="true"
cellSpacing="2px"
OnCreateResultSet="DataExtractionCurrent">
</tablePane>The OnCreateResultSet points to the following method:
Method DataExtractionCurrent(Output tSC As %Status, pInfo As %ZEN.Auxiliary.We need to resize existing images already in %GlobalBinaryStream to create thumbnails.
The requirement is also to use the method to resize new images that are uploaded.
Does anyone have a solution for this ?
Is there a way to add specific table permissions to a security role programmatically? I'm working on scripting some of the initial setup work when we sell certain add-ons to our software, and I see how I can assign resources to a role and give it a description, but I don't see how I tell it that this role gives the user, for example, SELECT privileges only on the invoices table, or SELECT, INSERT, UPDATE, and DELETE.
Hi Community ,
Can anyone please explain how to use EnsLib.EMail.AlertOperation operation to send notification to my email id when any error occurs in my production?
Please give any example how to use EnsLib.EMail.AlertOperation operation class
Thanks,
Smythee
The topic of for/while loop performance in Caché ObjectScript came up in discussion recently, and I'd like to share some thoughts/best practices with the rest of the community. While this is a basic topic in itself, it's easy to overlook the performance implications of otherwise-reasonable approaches. In short, loops iterating over $ListBuild lists with $ListNext or over a local array with $Order are the fastest options.
As a motivating example, we will consider looping over the pieces of a comma-delimited string.
Hello
I have a class to render reports as pdf. My problem that arabic characters in report replaced with ####.
Please find my code below
set report.RUID = RUID set %response.ContentType = "application/pdf"
set sc = report.GenerateReportToStream(.stream, 2) return:$$$ISERR(sc) sc
do stream.OutputToDevice()
return $$$OK
Your help is appreciated.
Hello all; I am using a one-to-many relationship. I have a Claim (one), in a relationship with Lines (many), but the Claim is storing a list of Lines IDs, rather than the Lines storing the Claim Id. This seems upside down, and not what I expected.
Class Claim
{
Relationship ClaimLineRel as ClaimLine [Cardinality = many, Inverse = Claim];
}
Class ClaimLine
{
Relationship Claim as Claim [ Cardinality = one, Inverse = ClaimLineRel, OnDelete = cascade];
Index ClaimIndex on Claim;
}But the storage globals for Claim show data in the ClaimLine spot:
^ClaimD(1)=$lb("",$lb(2,3).
Good morning, evening, night,... ![]()
A small reflection/question for today... it's true that new IRIS for Health (I4H) releases are more and more powerful each time regarding FHIR capabilities. Nowadays it allows us to consume FHIR resources with extrem easiness, we can connect with end-points in external FHIR servers very easily and make I4H act as passthrough or consume their resources... or, even more, we can define, configure and run a FHIR repository in, literally, less than 5 minutes.
Hi all.
I have a scenario where I am receiving NACKs and I'd like to adjust the error handing of the operation based on the content of the NACK.
For example, I could receive the following and want to move onto the next message:
MSH| ^~\&|||||20221025083135.489+0100||ACK ^A02^ACK|9271|D|2.5.1 MSA|AE|1664378390234 ERR|||207 ^Application internal error ^HL70357^^^^^^Cannot transfer patient, encounter is cancelled.|E
However, I could also receive the following and want to keep retrying:
MSH| ^~\&|||||20221014103828.043+0100||ACK^A03^ACK|1049|D|2.5.
Hi ,
Still a newbie for ensemble, I am trying to convert XML message to HL7 Message. I am using Custom schema for XML structure which includes MSH and PID segments from HL7 Message.
These are the service, process, Operation classes i am using
Business service-EnsLib.EDI.XML.Service.FileService
Business Process-EnsLib.MsgRouter.RoutingEngine
Business operation -EnsLib.HL7.Operation.FileOperation
I am using data transformation to convert XML message to HL7 message and data transformation is working fine and im getting this in the business operation.
Good men don’t need rules.
The Doctor.
It's not an easy task to be a master of dates and times, it is always a problem and sometimes confusing in any programming language, we are going to clarify and put a few tips to make this task as simple as possible.
Get on the TARDIS and I'm going to turn you into a Time lord

Hello,
I am trying to grab a specific zip file from a webpage but once I grab the zip file I need to grab a specific file within that zip file and I was hoping someone could explain how to do this or provide an example
With $Property is possible to dynamically get and set values on property of an instanced class and with $ClassMethod is possible to invoke methods from a class.
I would like to know: Is there an elegant way to do Write and Set dynamically on variables without using Xecute?
Hi everyone,
I'm having trouble parsing XML containing unicode characters which I receive from an external webservice. I believe my file is saved properly with UTF-8 encoding but the SAX Parser still throws me an error.
I have 2 classmethods: 1 general one (get) to make a request to a webservice and return the date, and 1 (getSportsPerDate) to make a specific call and then parse the data.
ClassMethod getSportsPerDate(language As %String, date As %String) { #dim cResponse As betradar.uof.api.descriptions.schedule.scheduleEndpoint #dim res As %Stream.FileCharacter s res=.
Hi, devs!
Consider you have an arbitrary global with an unknown amount of indexes.
How to print all the values to the terminal with Embedded Python?
Hi folks!
I'm working with a global via Embedded Python as a class method. I init the handler for a global via:
gl=iris.gref("^Global")What is the way to check the value at index ^Global("x","y")? E.g.:
In ObjectScript I'd do the following:
set result=$data(^Global("x","y"))How do I do the same in Embedded Python?
I checked the documentation, but haven't found an answer.
Breakpoints do not work when using VS Code Debug this method feature on a ClassMethod. Debug runs like normal and I can sometimes see 'running' on the CALL STACK menu. In the BREAKPOINTS menu, the breakpoints will start red, like normal, but eventually turn gray. On-hover for a grey breakpoint is the message "Breakpoint Cannot Be Mapped". After the method finishes, the breakpoint turns red again. No error messages appear. This is an intermittent issue, as sometimes it runs fine. So far, I have not been able to figure out the conditions to re-create this issue.
Any suggestions?
If your handling XML then it can often be unformatted for human display.
Using a little bit of XSLT magic you can format the XML in just two lines of code...