Hi All,
Can you please guide me on how to programmatically write objectscript task to export audit log to a directory and what type of task should I set it to.
I want to achieve the same behaviour on the code as seen below
.png)
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 All,
Can you please guide me on how to programmatically write objectscript task to export audit log to a directory and what type of task should I set it to.
I want to achieve the same behaviour on the code as seen below
.png)
In various tests I used both and found no real reason to prefer the one or the other.
Eventually I missed some limits. At least I didn't hit any.
What is the general opinion?
Where to use the one or the other?
I ran into an interesting ObjectScript use case today with a general solution that I wanted to share.
I have a JSON array (specifically, in my case, an array of issues from Jira) that I want to aggregate over a few fields - say, category, priority, and issue type. I then want to flatten the aggregates into a simple list with the total for each of the groups.
Hi All,
I have been given the following xml class file with objectscript code that has methods that I need for file conversions. These method implementations will do necessary conversions but I don't know how to add it to Iris studio and run it as a task or maybe if it must be put on any location and call each method from the terminal and even if so how do I then call it.
Please advise how to go about this.
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2020.1.1 (Build 408U)" ts="2022-02-01 16:19:05">
<Class name="User.Ready.
This is a benchmark built in python and objectscript in InterSystems IRIS.
The objective is to compare the speed for sending back and forth a thousand request/message from a BP to a BO in python and in objectscript.
See https://github.com/LucasEnard/benchmark-python-objectscript for more information.
IMPORTANT : Here are the results of time in seconds, for sending 1000 messagesback and forth from a bp to a bo using python, graph objectscript and objectscript.
String messages are composed of ten string variables.
Good afternoon,
I'm trying to take an unformatted social security number and insert the dashes into it. I'm getting a value in PID-19 like this: "123456789" and would like to use a data transformation to set the value in PID-19 to "123-45-6789".
I can't find any insert or append functions and I can't find anything in the Intersystems doc repository that would do this. Can someone help point the way for me please? I would like to keep this as a "set" action in my DT. I'm a little new to calling classes so it would be helpful if you included some syntax that would go in the "Value" field.
I wrote this COS script that I can run in a terminal session to get a view of the cache users:
set hdl = ##class(%Library.ResultSet).%New()
set hdl.ClassName = "Security.Users"
set hdl.QueryName = "Detail"
set sc = hdl.Execute()
while hdl.%Next() { do hdl.%Print() }
I know this is a bit rudimentary but this seems to be the correct script to get users. But looking at one of the clients AIX based instances there are about 3900 users. But this script returns no results. In fact, after the execute if I issue "w hd.%Next()" it returns 0.
Hi everyone, how do you run multiple quires?
I have tried couple of different ways, but not working.
SET sql = 2
Set sql(1) = "UPDATE QUERY"
Set sql(2) = "UPDATE QUERY"
Set sqlStatement=##class(%SQL.Statement).%New()
Set sc1=sqlStatement.%Prepare(.sql)
If $$$ISOK(sc1) {
Set tResult = sqlStatement.%Execute()
}
else{
$$$LOGERROR("Failed")
}
To Programmatically Edit Productions (interfaces) you can use a combination of the interoperability apis and SQL queries.
At a high level, it is important to know the namespace and production you are working in at the moment.
// Object script
// The active namespace is stored in this variable
$$$NAMESPACE
// Print namespace
Write $$$NAMESPACE
# Python
import iris
# The active namespace is returned from this method
iris.utils._OriginalNamespace()
# Print namespace
print(iris.utils.I am writing a Python tools I want to access the %Monitor.System.License properties:
Initially I want to develop Objectscript to verify access to the properties. But I can not figure the proper syntax.
I first attempted:
set ans = ##class(%Monitor.System.License).AvailableDist
which failed.
I tried another approach:
set ans = ##CLASS(%Monitor.System.License).%GetParameter("AvailableLocal")
which also failed. There is open method so it appears access options are limited.
I have a Business Service that reads a file from a folder and sends it as a string to a Business Process. In the business process, I need to add a string to the end of the file string that is coming into the Business Process. I am trying to do this in object script in studio and I am struggling to figure out how to add the string to the end of the other string. I am still new to studio and object script I have been reading up on the documentation and I am not sure what is the best way to accomplish this.
Any help would be greatly appreciated.
Hello,
I'm currently working on a custom version control implementation.
I'd like to show differences between a copy of a previously saved routine as a merge of the ^ROUTINE Global and the current version of that same routine.
I've found legacy Documentation for %RCMP which does the trick in the terminal but I'd like a similar result stored inside a variable.
I also want to show differences, not only see if they are the same or not.
The management portal has that exact feature, so maybe someone can direct me to the function that is being used there.
Hi contestants!
Here are the results of the bonus collections the applications of the Globals Contest accomplished.
Here are the projects that scored it:
| Project |
Data-model implementation |
Functional index implementation |
Data Move usage |
Embedded Python |
Docker |
ZPM |
Online Demo |
First Article on DC |
Second Article on DC |
Code Quality |
Video on YouTube |
Total Bonus |
| Nominal | 5 | 5 | 3 | 4 | 2 | 2 | 2 | 2 | 1 | 1 | 3 | 30 |
| Globals: Embedded Python vs. ObjectScript | 4 | 2 | 2 | 2 | 2 | 1 | 13 |
Hello communty.
I searched a way to transform a HL7 Message to Persistent. I found a way how to create Data Transformation from Mangment Portal -> Data Transformation Interface. But my task is to create somthing similar to that tool in my web site interface. And the question is: Is There way to create something like new instance of Data Transformation class "Ens.DataTransformDTL" using object script?
Thank you!
Hi Team,
I want to implement functionality in Intersystems IRIS for Health 2021.1. Which Received FHIR JSON from FHIR Repository and Convert them into HL7 different versions by Message type. Can anyone help me with this?
Thanks,
Harshdeep Acharya
Hello Community!
Is in objectscript way to get all properties names from HL7 Message?
For example I have HL7 message:
MSH|^~\&|MIHIN PATIENT GEN|1.2.3.4.5.9.99.999.9999.1004||2.16.840.1.113883.3.1481|20200103000000+0000||ADT^A01^ADT_A01|1092|P|2.6|1091|||||||||Windward General Hospital EVN||20200110000000+0000|||||1.2.3.4.5.9.99.999.9999.
Hi Team,
I would like to save the array subscript with in double quotes
eg sub1=111,sub2=444 (these values are dynamic)
set array(sub1,sub2)=""
It will be saved as array(111,444)=""
but I want to save it as array("111","444")=""
I am trying to save it from the class like """"_sub1_"""" but its not displaying as expected.
Kindly do the need full.
Thanks in Advance
Looks like someone's been messing with the style sheets ...I've tried Edge, Chrome and Firefox and for all the versions I've checked, the class docs are formatted like this:
.png)
Hello everybody.
My question originated when trying to help a coworker...
There is a system module, specifically a ClassMethod that inserts records into a table as per the pseudocode below:
set Obj = ##class(FooSchema.FooTable).%New()
set Obj.Hi, Community!
Want to share with you one debugging approach from the Russian forum.
Suppose I want to debug the application and I want it to stop the execution on a particular line.
I add in code this line:
l +d,-d
When I want to start debugging in this line I block d in terminal
USER> l +d
And execute the app.
The app stops on this line and lets me connect to it with Studio debugger.
To release lock I do in terminal
USER> l -d
And what are your debugging practices?
Hello community!
I found a bug or may be I missed something.
I want to get field name in "PID" segment by field number in HL7 Message using following object script expession:
set nl = $CHAR(10)
set str = "MSH|^~\&|MIHIN PATIENT GEN|1.2.3.4.5.9.99.999.9999.1004||2.16.840.1.113883.3.1481|20200103000000+0000||ADT^A01^ADT_A01|1092|P|2.6|1091|||||||||Windward General Hospital|"_nl
_ "EVN||20200110000000+0000|||||1.2.3.4.5.9.99.999.9999.How do you get a $ZTIMESTAMP in local time?.
I have found this solution and it works:
Set LocalTimestamp=$ZDATETIMEH($ZTIMESTAMP,-3)
Do you use any better way?
InterSystems is pleased to announce version 2.0.0 of the Language Server for VS Code. The Language Server augments the VS Code ObjectScript extension to provide better syntax coloring, embedded documentation, code completion and more. Detailed information is available in the GitHub repo's README. Version 2.0.0 adds support for a number of new platform architectures including M1 Macs! It also reduces package size, improves SQL coloring, and fixes a number of other issues detailed in the CHANGELOG.
Hi, I’m using $ZDATETIME to return the following
I would like to return just the YYYYMMDDHHMM i.e. stripping out the seconds.
Does $ZDATETIME have an option for this?
I'm pleased to announce the release of version 1.4.4 of the VS Code extension, which contains the following enhancements and bug fixes. Links will take you to the GitHub issue being addressed. As always, if you already have the extension installed, VS Code should automatically update your extension. If you're a new user, use these instructions to get started.
objectscript.explorer.This example demonstrates the difference you may experience when you write to
Gllobals directly from Embedded Python compared to native ObjectScript.
To make this demo useful I start 2 background jobs that simply write sequentially
to a dedicated global. A common control method signals for a synchronous start.
Similar a common stop & view interrupts data feeding.
That's the principle process:
As 2 jobs run in parallel the probability of just using sequential blocks is reduced.
During the development of this demo, I detected that the JOB command has problems
with ClassMethods in Embedded Python.
It sounds strange though it's embarrassing.
I have a class with ClassMethods written in ISOS and Embedded Python.
The ClassMethods written in ISOS start in the Background as usual. No problems
But my
ClassMethod setPy() [ Language = python ]
{
import iris, datetime, time
- - -Just fails the JOB command with (even 15 sec) timeout and $ZC=0
This is not funny
My actual workaround:
I created a ClassMethod in ISOS, that does an elegant JobStart
and this ClassMethod only runs the Embedded Python ClassMethod.
I started to get the following error when trying to save HTML and js files after editing in VSCode. This used to work fine, csp still works too.
ERROR #16006: Document 'xxx.html' name is invalid
Is there now a setting that I am missing? I did check but saw nothing that was obviously wrong.
I want to be able to view generated items from visual studio code. In Studio there was an option in the open dialog:
.png)
Specifically, I added a namespace to my workspace for editing (Using InterSystems Server Manager) and I want to be able to access the generated items in this namespace.
Time travel is like visiting Paris. You can't just read the guide, you have to throw yourself into it. Eat the food, use the wrong verbs, get double the charges, and end up kissing complete strangers.
The Doctor
We are now going to travel through time, that is, we are going to see future and past dates and how to calculate them in different formats. The TARDIS doesn't wait, take the controls and hold on tight.
