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?
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, 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^GlobalHow 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...
When using VS Code for Objectscript, is there a way to directly open % classes, like %Library.String, without needing to search for a property of that type and right clicking->"Go to Definition"?
I know it is possible to use "system=1" in the workspace uri definition to see all the % classes, but that tends to clog up the left side viewer with many extra directories. There is also the option in the settings to selectively hide some by defining files.exclude, but it seems fairly complicated to set up a filter for exactly the relevant directories.
So does anyone know the best workaround?
Hey Developers,
Meet the latest video on InterSystems Developers YouTube:
⏯ Configuring VS Code Workspaces for Multiple ObjectScript Connections
Hi, ObjectScript experts!
I know that there are auto-generated getter and setter methods for class properties in ObjectScript.
Are there auto-generated getter methods for class parameters?
Hi folks!
We have a bunch of templates on OEX that provide a handy foundation for building a particular application with IRIS. And the basic principle of each and every template is that we take vanilla IRIS images, load code, and files into the image using Dockerfile, and create a new docker image as a solution. And then we develop running this image and rebuilding it when returning to development.
Some developers ask me why we need to build the docker image to work with the code. Indeed, if at the end of the day I need to develop a ZPM package and not a docker image why don't run the vanilla image and load the code and everything in it?
The problem I have with the building image approach is that often I can wait a lot to build an image and it fails on some Objectscript problem in the source that I cannot fix as the image is not building. and
Any thoughts? How do you develop with docker?
Hi,
My routine contains embedded SQL including this:
&sql(DECLARE C1 CURSOR FOR
The error "SQLCODE=-52 : Cursor C10 already declared" comes up on compilation in Studio. Does anyone know a way around it please?
Bob
If you’re on the fence about learning InterSystems ObjectScript, we’re making the decision a whole lot easier.
We just updated the Getting Started with InterSystems ObjectScript learning path with 3 new videos — and a capstone exercise to help you pull together everything you’ll learn.
🤝 Get an introduction to InterSystems ObjectScript
🤿 Dive deeper into commands and functions
🤔 Understand data types and variables
👨💻 Create a class definition
Do it all in our updated learning path, Getting Started with InterSystems ObjectScript.
Hey Community,
Don't miss the new video on InterSystems Developers YouTube channel:
⏯ Working with ObjectScript Classes in VS Code for Client Side Editing
Let's consider these two ways of passing an obj to a function:
//var is a structured obj (1) do ..methodX(var) (2) do ..methodX(.var)
In c++ if we pass an obj by reference like in (2) we save a lot in computation because we are not copying the whole object, and when the object is modified within the function it is modified also for everyone.
In this case does (2) achieve any better performance than (1)? Is passing with the "." save any computation? the object is copied anyway?
Is there a simple way of passing obj to a function?
InterSystems is proud to offer 50% discount on InterSystems Certification exams to all registered attendees of UK&I summit. Vouchers will be available at the registration desk.

Available Exams
Hello Community!
This article gives an overview of the REST JSON webservices developed for TrakCare.
These webservices allow users to access TrakCare data from outside of the software, mainly through external apps.
Hello,
I need to run some clean up routine in the background so loss of my terminal session won't stop the process.
I found the JOB command in the documentation.
JOB | ObjectScript Reference | InterSystems IRIS Data Platform 2022.1
When I try it, it doesn't seem to be doing much. I also expected this to become visible in the Background Tasks but that doesn't happen either.
Probably I am missing something.
This is the command I am running:
JOB ##class(HIHLib.Support.GetHL7MessageStat).ISBListingQuery("2017-01-01","2017-02-01",0,"WAHISCL",-1,0)::10
The same command without the ::10 has the same effect.
Hi All,
Can you help me how to extract SQL table data into a text file and generate the text file in a particular file path
Thanks,
Smythee
Is it possible to use integer with a higher precision so that something like this works:
ClassMethodSet92233720368547758079223372036854775807
9223372036854775810 // should be 9223372036854775808
0 // should be 1The docs say "... However, with extremely large numbers (larger than 9223372036854775807E127) it is not always possible to convert a numeric string to a Decimal value. ..."[0], but operations on numbers bigger than 9223372036854775807 are not working correctly.
In the August Learning Services newsletter, see how you can get hands-on with healthcare analytics tools, Embedded Python, and InterSystems Package Manager. If you're new to InterSystems ObjectScript, try out a learning path to get started!
Can someone help me on how the alter a table in Management table, I have tried the SQL and MYSQL way but it does not alter the table.
Thank you.
Is it possible to access (read, write) to an external Oracle database via Cache SQL Gateway using JDBC in Cache Object Script? I am currently using ODBC successfully but wanted to see if JDBC was an option too. If it is possible, does anyone have a basic Object Script example(s) that I can review?
Thanks!
We are looking for a 3rd party application that can scan our IRIS based Cache Object Script code for vulnerabilities or coding weaknesses. There are many, many applications/vendors out there that do code scanning but none seem to support Cache Object Script or scanning the IRIS environment. If anyone is aware of a company/product that can scan our code / IRIS environment, I would love to hear about it.
Thanks in advance for the help.
Mike
Hi, I am passing an EDIFACT file from a service to an operation using the super class. I would like to prepopulate the 'Source' variable with some information, but I’m not sure how to access this variable.
Any pointers much appreciated.
Hi Developers!
Sometimes we need to import CSV data programmatically to InterSystems IRIS either from CSV or from URL. And we expect the class with proper datatypes to be created and the data to be imported.
I published a module csvgen on Open Exchange which does exactly that.
If you just need the CSV file be imported into IRIS you can do the following:
USER>do ##class(community.csvgen).Generate("/usr/data/titanic.csv",,"Data.Titanic")
Class name: Data.Titanic
Header: PassengerId INTEGER,Survived INTEGER,Pclass INTEGER,Name VARCHAR(250),Sex VARCHAR(250),Age INTEGER,SibSp INTEGER,Parch INTEGER,Ticket VARCHAR(250),Fare MONEY,Cabin VARCHAR(250),Embarked VARCHAR(250)
Records imported: 891
USER>Or if you have the CSV on the internet, e.g. COVID-19 Data on Github you can get the data in the following way:
USER>d ##class(community.csvgen).GenerateFromURL("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/05-29-2020.csv",",","Data.Covid19")
Class name: Data.Covid19
Header: FIPS INTEGER,Admin2 VARCHAR(250),Province_State VARCHAR(250),Country_Region VARCHAR(250),Last_Update DATE,Lat MONEY,Long_ DOUBLE,Confirmed INTEGER,Deaths INTEGER,Recovered INTEGER,Active INTEGER,Combined_Key VARCHAR(250),Incidence_Rate DOUBLE,Case-Fatality_Ratio DOUBLE
Records imported: 3522
USER>In this article you will have access to the curated base of articles from the InterSystems Developer Community of the most relevant topics to learning InterSystems IRIS. Find top published articles ranked by Machine Learning, Embedded Python, JSON, API and REST Applications, Manage and Configure InterSystems Environments, Docker and Cloud, VSCode, SQL, Analytics/BI, Globals, Security, DevOps, Interoperability, Native API. Learn and Enjoy!
Machine Learning is a mandatory technology to build advanced data analysis and automate manual activities with excellent efficiency.
Hi,
I am receiving a JSON File as Stream container Using pRequest As Ens.StreamContainer and output as Output pResponse As %Persistent in a Custom Business Operation
Please find the code below
Method OnMessage(pRequest As Ens.StreamContainer, Output pResponse As %Persistent) As %Status
{
Set tFilename=..Adapter.CreateFilename(##class(%File).GetFilename(pRequest.OriginalFilename),..Filename)
Set tSC=..Adapter.PutStream(tFilename, pRequest.Stream)
Quit tSC
}
Question:How can i extract name,DOB,SSN from the pRequest
I am trying to use the IRIS connection to connect from our LIS to Health Connect (ENSEMBLE) directly. You can do this in the same namespace using this:
I ##class(Ens.Director).CreateBusinessService(Ensemble Service Name,.theService)
I theService.ProcessInput(TRAN,.response)
I would like to be able to do the same thing across servers using IRIS connection. I have the following connection:
set connection = ##class(%Net.DB.DataSource).CreateConnection(host, port, namespace, user, pwd)
if 'connection.
Hey Developers,
Enjoy watching the new video on InterSystems Developers YouTube channel:
Does anyone have any pointers or maybe familiarity of making Email templates in Objectscript?
I'm currently trying to implement Televisits with our system and am needing to send an email to the patient. I'd like to make it a nicer looking email which will require a good amount of inline CSS. I currently have a method, but is very much a sore sight for the eyes.
I was wondering if there was a way I could use Embedded HTML and pass that into the DO msg.TextData.Write command with the ##class(%Net.MailMessage)?
How do I access items and their settings of production by using Objectscript? I have already tried making SQL queries to Ens_Config.Production table and using methods in Ens.Director and EnsPortal.Utils classes but I just can't get a hang of it.
The unfortunate reason, why I need to do this, is that our environments (DEV, QA and PROD) have gone in really bad shape over the years and now the software development is just pure agony since environments are not in sync. Comparing different environments is also extremely difficult since it is hard to even tell which classes are in use.
Is there any full featured tutorial available for doing the report development using object script in the Trakcare system for a starter developer(For Trakcare)?
Once we developed the report and then how we can test and add this report to our existing Trakcare.