Hi Developers!
I'm pleased to present to you a new feature of Open Exchange - ZPM Package Manager support!
What's about it?
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 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:
...
Method X(pRequest As Mensajes.ServiciosGeneralRequest, ...){
set writer=##class(%XML.Writer).%New()
set status=wri
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 detval = pRequest.FindSegment("OBX(2)")
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 dtl = ##class(my.DTLtransform).%New()
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:
##class(%SYS.Task).ExportTasks($lb(tTaskID),"c:\TasksExport\"_tTaskName_".xml")
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
Set archiveFilePath=##class(Ens.Director).GetItemSettingValue("ReadPDFFileService","Adapter","ArchivePath",.status)
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?
Hey Developers,
We're pleased to invite you to join the next InterSystems IRIS 2020.1 Tech Talk: Using Java and .NETon June 16 at 10:00 AM EDT!
In this installment of InterSystems IRIS 2020.1 Tech Talks, we put the spotlight on extending InterSystems IRIS with your own custom Java and .NET code. We will demo how to create a custom interoperability component with the new Productions Extensions (PEX) feature. Following that, we’ll demo how to call Java or .NET code from any ObjectScript code.
Hi Developers,
Please welcome the new coding talk on InterSystems Developers YouTube:
⏯ How to Generate Modules for InterSystems Package Manager (ZPM)
Hi all
Does anyone have an easy way of reading the cdata in the xml response returned buy a Webservice?
At the moment I have a XML class and then I use read.Correlate() to read through that XML bit.
However, depending on the message I have different things in the CData and I don't want to create a class for each one of these.
The API returns the cddata as KeyValueOfstringstring.
My idea would be to send to my method the cdata as a parameter which is the KeyValueOfstringstring part of the response message and then deal with it...
Any help would be appreciated...
Best Regards
Looking for a fast, efficient IDE for developing ObjectScript code?
Check out ObjectScript with Visual Studio Code, a new video from Online Learning, which shows how to export ObjectScript packages from the InterSystems IRIS server and write ObjectScript classes and methods with Visual Studio Code.
Good day all -
I am attempting to use the Data Transformation Builder (for ease of use for my other engineers) to build up a web service request object to send to an outbound operation. The source is a custom persistent class (extends Ens.Response, %JSON.Adaptor) and has serialized sub-class data elements and the request object is a custom persistent class (extends Ens.Request, %JSON.Adaptor.)
When attempting to use a for each on one of the serialized properties of the source object, the for each works (source.
I have a code tag that performs some logic in a DTL, and want to add to it the ability to find the number of substrings delimited by a dollar sign ($) within a particular string. I have tried the following which compiles just fine, but generates an error when testing in the Data Transformation Builder.
ERROR <Ens>ErrException: <SUBSCRIPT>zTransform+985^LH.IAMON.IAMONORU1XsformDTC2.1 *DCOUNT() Encoded subscript 1 > 511 bytes -- logged as '-' number - @' set lineCount = DCOUNT(reportBody,"$")'
Hi
I was experiencing an issue yesterday where I had over 900 messages in the queue. I had to filter and delete only A31 messages out of the queue allowing the rest of them to be processed. I tried to use SQL to set the status of the message to 'Suspended' however the A31 messages still remained on the queue and I had to suspend manually by going through each message. Is there a way of Suspending or Aborting only certain type of messages in a queue.
Hi All,
I am aware of some Auditing software that was made available quite some years ago that I cannot find.
I would like to install it and give it a try. Does anyone know where I can access this software please?
Thanks in advance.
Steve
So we have a custom business service that we use and we are calling SendRequestSync.
Set tSC=..SendRequestSync(tOneTarget,tTargetStream, .tResponse)
For our response from our custom business operation, we send back an Ens.StringResponse.
set pResponse = ##class(Ens.StringResponse).%New()
set pResponse.StringValue = "File Delivery: "_tOutFilename_" of size: "_pRequest.Stream.Size_" (modified='"_pRequest.Stream.LastModified_"')"_" Status: "_tSC
So now we are trying to use Rules to pass the the messages to certain destinations with a normal business process of EnsLib.