How I can get current date/time on format YYYYMMDDhhmmss?
I tried $ZDATETIME($HOROLOG,8), but I got 20220606 17:59:56 and I want 20220606175956
Thanks
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.
How I can get current date/time on format YYYYMMDDhhmmss?
I tried $ZDATETIME($HOROLOG,8), but I got 20220606 17:59:56 and I want 20220606175956
Thanks
Hi Community,
This post is a introduction of my open exchange iris-fhir-client application.
iris-fhir-client can connect to any open FHIR Server by using embedded python with the help of fhirpy Library.
Get Resource information by terminal and by using CSP web application.
Hi, what’s the best way to check if your query return 0 records?
If $$$ISOK(sc)
{
Set tResult = sqlStatement.%Execute()
WHILE tResult.%Next()
{
set tRecords = tResult.%ROWCOUNT
}
if (tRecords = "")
{
write "no records"
}
}
Hi Community,
Recently, I migrated a series of Objectscript repositories from XML to UDL format.
After the migration, I was a bit disappointed by the presentation on the GitLab web interface.
Since Objectscript syntax is supported by GitHub, I thought It would be also supported by GitLab. Unfortunately, the library used by GitLab to highlight the code does not have an extension to support Objectscript.
GitLab uses the library Rouge, which can highlight over 200 languages. This is a library written in Ruby (see the GitHub page), but Objectscript is not in the list.
HI Guys.
I want to know how to distinguish whether a variable is a pure numeric string or a number, such as "123" and "123".
I only know an inelegant way.
ClassMethod IsNumber(n)
{
s ret=0
try{
s ret= $lb(n)=$lb(+n)
}catch e{
s ret=0
}
q ret
}Is there any other way to implement it
Hi everyone,
I am currently performing a patient merge thorug ADT^40 HL7 messages. In order to do that, I am following this guide which I found on the ducumentation: http://10.41.11.210:57772/csp/docbook/DocBook.UI.Page.cls?KEY=HESUP_ch_IHE#HESUP_IHE_configuring_registry_PIX
My main issue regards the fact that I can't update the PatientID and the SourcePatientID of the HS_Registry.Document table of the prior patient, wheras, I find only the new anagraphic on the HS_Registry.Patient table.
This package offers a utility to export an XLarge Global into a JSON object file and to show
or import it again. In a previous example, this all was processed in memory. But if this is a
large Global you may either experience <MAXSTRING> or an <STORE> error
if the generated JSON structure exceeds available memory.
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 messages back 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 "
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.