Greetings,
Since cache is an OOP language, how can I create 2 methods with the same name but different parameters? Right now when I try that I get a compile time error!
Thank you,
Everardo
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.
Greetings,
Since cache is an OOP language, how can I create 2 methods with the same name but different parameters? Right now when I try that I get a compile time error!
Thank you,
Everardo
Hi,
Can anyone please explain me how to remove trailing squares from the text field (String). Trailing squares is a white space ?
I tried different things like Ltrim, Trim from sql query side and also from object scripting side something below.
If Address1 set Address1 = $ZSTRIP(Address1,"<>P,<>C,<>W")
If Address1 set Address1 = $ZSTRIP(Address1,"$C(9), $C(32), $C(160)")
If Address1 set Address1 = $ZSTRIP(Address1,"*W,*C")
Nothing works for me
Can anyone please help me to solve this
Thanks
We have a vendor that every couple of days will just stop transmitting messages, but still hold the TCP/IP connection open. No matter how many times we troubleshoot and talk with them, they don't seem to think its an issue with system. Normally if I just restart the service it will get the data flowing again.
I know ideal is for them to fix the issue, but in the meantime I have setup an Inactivity time out alert. I was wondering with the correct filtering if there was a way to say if the Inactivity Alert is triggered during the business day, to have the Alert trigger a restart of the service?
Hi Developers!
As you know the application errors live in ^ERRORS global. They appear there if you call:
d e.Log() in a Catch section of Try-Catch.
With @Robert Cemper's approach, you can now use SQL to examine it.
Inspired by Robert's module I introduced a simple IRIS Analytics module which shows these errors in a dashboard:

During my search for a snapshot of a persistent object,
I met a feature that I would like to share as it could be useful in some special situations.
My trigger was to have a before- and an after-image during unit testing.
Now I want to return a large amount of data to the front end. The string length has reached 40000 +, and the returned data needs to be encrypted by AES + Base64. I can convert the string into a stream. AES can use the AESCBCEncryptStream method to encrypt, but Base64 has no stream method。Anyone who get the solution would you kindly share the solution please。
Any help would be appreciated. Thanks!
Hi Devs!
A few months ago I raised a discussion on the naming convention for ZPM modules.
And you free to put your name or your organization name for the packages you want to have your personal or company's brand.
But if you contribute to community, we suggested to have "community." package for all such libraries.
But the name is too long.
What if we use "isc." instead? Which can be read as "isc ->InterSystemsCommunity". Short and unique.
What do you think?
Hello for everyone.
We recently started our migration to the cloud. We left a unix environment for a Windows 2016 environment and everything seems normal except for the error ( <ZSOAP> zInvokeClient + 208 ^% SOAP.WebClient.1 ) when we try to consume a web service. In fact, any webservice. The classes have been exported and recompiled but do not work. Apparently by the complements of the error DO $ System.OBJ.DisplayError () (ERROR # 6246: There was no response to the SOAP request) or the $ system.Status.DecomposeStatus (% objlasterror, .
The offer of ZPM is growing daily and the short names and
acronyms of the offer are sometimes hard to understand and
also hard to type with my lazy fingers.
So I decided to have
It runs with do ^zpmshow
A snapshot from the screen:
USER>d ^zpmshow
1 analyzethis 1.1.4 -- not github --
2 apps.rest 1.0.0 -- no descripition --
3 bitmap-adoption 1.0.
Hi Developers!
I'm pleased to present to you a new feature of Open Exchange - ZPM Package Manager support!
What's about it?
It would be interesting if there is some recommended documentation about best practices using Healthshare for interoperability.
Also, some how-tos or frequently asked questions about ObjectScript.
Or event better, if there are experienced developers who would like to share some common habits on their work with Studio / ObjectScript, which are valuable to do the developing work better.
For example, How to get the XML of a class and write it into a REST operation:
...
set status=
This is a sample to use %JSON.Adaptor class available in IRIS to produce a snapshot of your object.
The sample consists of 2 classes that are variations of what was known in Caché/SAMPLES as Sample.Person.
Be aware that the possibilities are limited by %JSON.Adapter and how you make use of it.
Once in place, you create some test data by Populate().
You select an object and take a snapshot.
You apply changes to your object and take another snapshot.
And see the difference.
BINGO!
It's also an example of a customized SystemFunction extension (ZZISJSON) in Caché & IRIS
This time it is to be included in %ZLANGF00.mac
A JSON string is mostly imported from a file or over REST
You rely on a clean and compatible structure. This is the check.
required: ZPretty.mac
demo
USER>ZWRITE jsn
jsn="{"Name":"Li,Robert K.","SSN":"672-92-9664","DOB":"1975-01-12","Home":{"Street":"986 Washington Blvd","City":"Boston","State":"PA","Zip":"95802"},"Office":{"Street":"6012 First Place","City":"Reston","State":"MT","Zip":"77739"},"Spouse":{"Name":"Avery,Zelda H.t's also an example for a customized command extension (ZZJSN) in Caché & IRIS
This is the Caché version for fast JSON formatting but it also works in IRIS.
Requires package ZPretty
To allow parallel existence in IRIS this is named ZZJSN
see:
USER>ZWRITE jsn
jsn="{"Name":"Li,Robert K.","SSN":"672-92-9664","DOB":"1975-01-12","Home":{"Street":"986 Washington Blvd","City":"Boston","State":"PA","Zip":"95802"},"Office":{"Street":"6012 First Place","City":"Reston","State":"MT","Zip":"77739"},"Spouse":{"Name":"Avery,Zelda H.t's also an example for a customized command extension (ZZJSON) in IRIS
IRIS has a nice %JSON.Formatter class.
But for debugging it is not really handy.
see:
ZWRITE js1
js1="{""Name"":""Cunningham,John C."",""SSN"":""294-11-9150"",""DOB"":""1933-01-08"",""Home"":{""Street"":""4249 Ash Street"",""City"":""Tampa"",""State"":""MD"",""Zip"":""30176""},""FavoriteColors"":\[""White"",""Red"",""Green""]}"
so you proceed for the most simple case
set formatter=##class(%JSON.Formatter).%New()
do formatter.Format(js1)
{
"Name":"Cunningham,John C.IRIS and Caché / Ensemble offer the possibility to add Languages Extension as SystemFunctions, SystemVariables, SystemCommands
The related documentation tells you where to add the system-wide extension. Parameter passing is not covered explicitly.
Hi, I am trying to read a field from the second obx segment but it keeps giving me an error.
Following is what I am trying:
s dep = detval.GetValueAt(2)
but it doesnt read it. Is there a different way to read the value?
Hello Community members, am newbie here
Already learning and working through Studio & Terminal and since am from C# background and trying to use VS Code for ObjectScript coding, appreciate you help, unable to edit files, please see below snapshot
.png)
I try to run a small test routine (guessing a random number) in WebTerminal but the result looks broken.
in IRISterminal:
.png)
in WebTerminal:
.png)
I think it relates to backspace.
Is there some special setting required?
The code:
a
s q=".......... guess [0..9]: "
f i=1:1 d b if p w ! w $c(9),"thank you",! q
q
b
w !,i,$c(9),q
f r v#1 q:(v?.1n) w " !no number",$c(8,8,8,8,8,8,8,8,8,8,8,8)
w " "
s r=$R(10),p=$s(v="":1,v=r:"!",v>r:"<",1:">")
s x=q,$e(x,r+1)="*",$e(x,v+1)=$s(v=r:"!",v>r:"<",1:">")
q:p w $c(13),$c(9),x s p=v=r q
I need to set and use some context variables in a transformation (written in DTL), but the code is manually written.
When writing the same as BPL I define context variables and they are visible in transformations called by that process.
In something like this my.DTLtransform sets HL7 message fields to values in context variables:
Set qStatus = dtl.Transform(pRequest, .msg)
However, when I create a business process using custom code option, I don't see an obvious option, as well as documentation covering that area.
.png)
Currently , I am using objectscript in Iris. If I switch the code from objectscript to Java means what are all the steps I need to do?
As I've become a little more familiar with HealthShare, I'd like to start exploring different ways of doing things. To date, the bulk of my data transformations have been using DTL; only using ObjectScript for a few operations that write to external SQL tables that were largely based on examples provided by my sales engineer.
I'd like to trying doing all of the data transformation in a process using ObjectScript.
Hi, folks!
Do you know the option/mode when I can feed multiline code into a terminal?
E.g.
for i=1:1:100 {
/// do one line
///do something else}I'm working with VS Code on Centos 8. When I install the ObjectScript extension the installation succeeds, but the InterSystems icon never appears in the left-side panel. I can change settings for the extension - set the server info, etc. No errors show-up in the VS Code debug log.
UPDATE: the same thing happens on MacOS when using VS Code 1.46.1 and InterSystems ObjectScript extension 0.8.6
Can anyone suggest next steps for me to troubleshoot? Is there another log I should check?
VS Code version:
Version: 1.46.1
Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
Date: 2020-06-17T21:13:08.
Hi Developers!
Looking for a fast, efficient IDE for developing ObjectScript code? Watch the new video on InterSystems Developers YouTube for more:
⏯ ObjectScript with Visual Studio Code
Hi all,
We are working on getting a number of non-code based configurations and settings in fully automated deployments, and I was wondering if anyone had any ideas on how to "update" a task that already exists.
What's in our repository is a separate file for each task in the standard .xml format for:
The problem is, the ImportTasks method doesn't update or overwrite if the task name already exists, and there's no DeleteTask method.
We could of course, delete the task by querying %SYS.
Set cdef = ##class(%Dictionary.ClassDefinition).%OpenId(table)
Set count = cdef.Properties.Count()
For i = 1:1:count {
Write cdef.Properties.GetAt(i).Name, " ", cdef.Properties.GetAt(i).Type, "", <MY QUESTION>,!
}
How can I do to get maxlen?
We have code with the line
When we have this archivePath set as a System Default setting rather than Production definition setting i.e. shows in blue rather than black in the restore default screen it doesn't get the setting value. We want to get this value nomatter what way it is set.
Running 2016 Healthshare
Hi, I am doing a stream read so that I can do some inserts to the table however other language read is not supported, any idea what I need to do to achieve this?
Thanks
Hi guys,
Do you have any objectscript sample to list persistent classes with name, type, primary key and foreign keys using %Dictionary?