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".
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.
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 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. I look at "Do DisplayError^%apiOBJ(sc)" and the message is:
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._OriginalNamespace())
>>> DEMONSTRATION
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")
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.
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:
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:
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:
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.fooProp = fooValue
// Other Foo properties //
set status = Obj.%Save()From time to time, when trying to save the object, an error , informing that it was not possible to obtain the exclusive lock on the table instance
I want, using objectscript, to find out which other part of the system (Classmethod) is causing the lock on this table
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:
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.
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:
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'm not amused and hope there is just an undocumented/unknown param missing
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.

I'm thinking to try ChunkedWriter based on the documentation I'm reading to solve an issue but could use some clarification. Anyone that could provide a usage example of this down below?
To send a chunked request, do the following:
I have a SQL query that I want to run against MS SQL from cache ensemble using the SQL outbound adapter. If I run this query direct from MS SQL Studio it take about 7 seconds MAX and returns about half a million rows. The row only contains one column it is a number all same size and if I run this query in the production in ensemble it takes for ever the production finishes without getting the response back. The same query run in cache outside the ensemble environment writing results to a file it returns results taking about 3minutes to complete. But if I load the results into a list or
Hello all,
Is using ASP.Net Core 2.0 with Cache Object Script possible? I have it successfully working with .Net 4.5 using the supplied .Net 4.5 Dll file by Intersystems. Is there an updated Dll file for .Net Core 2.0?
Thanks
Hi all,
I am trying to use a %Status property on some of my Response classes. If the execution of a service goes wrong, I set the %Status property on Response with the value $$$ERROR($$$GeneralError, "pre-defined error message").
When I check the visual trace for this message and look for the %Status (property "status_code" on the image), it is displayed like this:
If I select to display the Body of the Response, I get the 'readable' form of %Status:
According to the documentation, this is expected as %Status properties are encoded in base64 during Projection to XML.
Hello fellows, I need you wisdom.
In my organization we code in ObjectScript and .int everyday. When I joined nobody knew barely nothing about classes and their use was almost only for storage definition purpose. During my self-learning in caché I discovered the object oriented programming and class developing was possible in caché and started to code in .cls . Being something self-taught, I may have some basic doubts I'd have missed in my documentation readings.