#ObjectScript

14 Followers · 1.6K Posts

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.

Documentation.

Question Michoel Reach · Apr 8, 2021

We have a Unicode installation of Cache'. A client wants to send us documents that will be machine-read and loaded, automatically. They want to create the documents in ISO-8859-1 ("Latin-1"). We'd need to convert the text to UTF8 for our system. I saw the documentation on the $ZCONVERT function, but I didn't see this option. How should it be done?

Thanks!

10
0 1460
Question Roger Taylor · Mar 29, 2021

Background: We have our own SQL map that predates InterSystems'. A program writes an XML file for each table map class as $system.OBJ.Export would. $system.OBJ.LoadDir loads the XML files into .cls files.

The reason is a long story, but we need to update parameter EXTENTSIZE (only) in existing classes. This does not seem to happen. As a test I used $system.OBJ.Export to make an XML file and edited EXTENTSIZE in the two places it appears in the XML:

<StorageStrategy>SQLStorage</StorageStrategy>
<Parameter name="EXTENTSIZE"><Default>1001</Default></Parameter>

4
0 671
Article Evgeny Shvarov · Jan 24, 2020 3m read

Hi Developers!

Recently we released the updated version 0.1.3 of ObjectScript Package Manager (ZPM) which comes with the support of simplified ObjectScript sources folder structure.

What 'simplified' does mean?

Before 0.1.3 ZPM expected the following structure:

/src

---/cls  - for ObjectScript classes

---/cls/package_name/class_name.cls

---/cls/package_name/class_name2.cls

---/mac - or Mac ObjectScript routines

---/mac/package_name/mac_routine.mac

---/mac/package_name/mac_routine2.mac

---/inc - for ObjectScript macro include files.

---/inc/package_name/include_file.inc
3
1 1006
Article Evgeny Shvarov · Feb 24, 2020 9m read

Hi Developers!

Many of you publish your InterSystems ObjectScript libraries on Open Exchange and Github.

But what do you do to ease the usage and collaboration to your project for developers?

In this article, I want to introduce the way how to introduce an easy way to launch and contribute to any ObjectScript project just by copying a standard set of files to your repository.

Let's go!

21
6 2499
Article Wietze Drost · Nov 4, 2020 1m read

Moving over from Studio To VSCode like many other will do now the ObjectScript plugin reached version 1.0, I noticed I was missing some items in the objectscript explorer. For example when creating a Rest API using the spec first approach, 3 classes are generated, an application.impl, application.disp and application.spec class, but the disp class was missing in the Object Explorer.

As the application.disp is a generated class, for showing these classes you need to turn this on by hitting the switch on the object explorer:

There's also a switch to enable/disable System Items.

1
1 550
Question Julian Matthews · Mar 17, 2021

Hey everyone.

I have a process where I create a new %Stream.FileCharacter object, specify the filename (including it's path), write data to the stream, and then save. However for some reason, if the user account does not have write access to the directory, the %Save method is still returning true even though it was unable to actually write the file to the folder.

The location is a UNC path, and I'm wondering if this is tripping me up?

3
0 449
Question Stuart Byrne · Mar 14, 2021

I had a challenge recently where I was asked to parse and iterate JSON to find a patient that has a forename = "Bill" and try to make the function that iterates through the code re-usable.

Being working in Healthcare there isn't much experience or demand for parsing JSON, as most of my work is HL7.

I took this on using the documentation and worked out a way to parse the JSON (see posts below for code and source data).

I've worked out how to iterate through the fields and repeating elements, however I'm having an issue quitting out upon finding a patient with the forename Bill.

6
0 511
Question Thembelani Mlalazi · Mar 12, 2021

In previous versions of cache I used to be able to write click on a class and get a delete class option but in this version I can not find the delete class option was wondering if there is another way to delete a class if you wanted to do some house keeping.

N.B. These are the classes I create not the ones that comes with cache.

1
0 628
Question Alex Kogan · Mar 5, 2021

I have a quick question regarding swizzled objects.

I have an original object, say Object a, I am working with.

I set a property a.something.somethingother.somethingelse.myNewProperty  to some value x.

Then at some point I am saving a and continuing to work with it.  I assume here by saving a, I saved myNewProperty as well. (as it should work)

5
0 482
Question Scott Roth · Feb 23, 2021

So now that I have figured out how to send a Page via HTTP.OutboundAdapter, I have another question. I want to use a Function that all I have to do is pass two variables and it is sent to the HTTP.OutboundAdapter I created to send the Page. 

So.. If I have a class file that ExtendsEns.Rule.FunctionSet, how do I force it to send a Request to my HTTP Business Operation, without having to go through a DTL, or Business Process?

Thanks

Scott

3
0 913
Question Scott Roth · Feb 23, 2021

I am trying to figure out how to send a Page via a HTTP.OutboundAdapter to a URL from Ensemble.

We have a URL that I am able to pass PNo=xxxx%PMsg=xxxx as parameters to send the page to a pager.

http://xxxxx.xxxxx.xxx/Employee/Tools/Paging/SendPage.aspx?PNo=1817&PMs…

When I send the above URL through a REST client I receive a Response of "SENT".

But when I try to send it through the HTTP.OutboundAdpater I do not get a response.

3
0 345
Job Alice Gianni · Feb 8, 2021

As a Belgian leader in developing and operating entertainment solutions in the sports betting and casino games sector, Bingoal is a dynamic and ambitious company looking for a passionate Back-End Software Engineer. Together with the IT team, you will be working to create scalable and easy to maintain software having an impact on the core of Bingoal’s activity.

We are looking for a developer with InterSystems ObjectScript Experience.

0
0 401
Question Scott Roth · Jan 7, 2021

I need another set of eyes to look at the following. Instead of a Data Lookup table, I wanted to try to lookup a value against a Cache table that I had build. So I thought I could write a function to run a simple SQL query against the Cache Table and return me a %Boolean value back to my routing rule. However today I found that it was not working properly.

Can someone take a look at the following method and verify that I am doing this correct?

index = column name

value  = HL7 field that I am passing into the method

4
0 528
Announcement Evgeny Shvarov · Jan 11, 2021

Hi Developers!

Here're the technology bonuses for the InterSystems Multi-Model Contest that will give you extra points in the voting:

  • InterSystems Globals (key-value)
  • InterSystems SQL
  • InterSystems Objects 
  • Your data model
  • ZPM Package deployment
  • Docker container usage

See the details below.<--break->

3
1 319
Article Evgeny Shvarov · Mar 20, 2020 3m read

Hi colleagues!

Every day Johns Hopkins University publishes new data on coronavirus COVID-19 pandemic status.

I built a simple InterSystems IRIS Analytics dashboard using InterSystems IRIS Community Edition in docker deployed on GCP Kubernetes which shows key measures of the disease outbreak.

This dashboard is an example of how information from CSV could be analyzed with IRIS Analytics and deployed to GCP Kubernetes in a form of InterSystems IRIS Community Edition.

Added the interactive map of the USA:

13
3 1118
Article Yuri Marx · Jan 20, 2021 1m read

Sometimes it is necessary to execute commands from the shell of the host operating system, where your ObjectScript program is located, to launch programs, operating system services, schedule crontasks, among other activities. For this, the language has a utility procedure called $ZF(-100). See:

$ZF(-100,flags,program,args)

Where flags is the type of command you want to execute. In our case, the flag is "/ SHELL", to execute shell commands on the host operating system.

Program is the name of the program or service to be executed.

Args are execution arguments passed to the program.

2
2 1192
Article Yuri Marx · Jan 16, 2021 3m read

Hi InterSystems Community!

The ObjectScript language of InterSystems IRIS has the ability to extend classes using a very interesting feature called XData.

It is a section in your class that can be used to create custom definitions to be used within the class itself and also externally.

To create one or more XData definitions for your class is very easy, see the example:

2
0 542
Article Renan Lourenco · Jan 12, 2021 2m read

Tiny web application that allows you to anonymize CSV files. Based on InterSystems IRIS®

Version:store/intersystems/iris-community:2020.3.0.221.0

Application

Sample CSV where Date of Birth and Sex will remain untouched, while the rest should be anonymized.

The application recognizes the header columns and allows the user to chose which ones to ignore.

After processing.

Setup

Make sure you have Docker up and running before starting.

Option 1

Recommended in case you just want to get the application up and running.

0
0 353
Article Igor Titarenko · Sep 10, 2020 3m read

One of the leading benefits of ObjectScript is the speed and efficiency it allows for an experienced developer. Let's look at an example of how you can benefit from ObjectScript today.

Suppose you have a class that stores the names of your users. We'll call the class Data.User, and give it a string property Name. Next, we will need a method to create a new user or update an existing one. A naive, simplistic approach might look like this example:

10
0 781
Article Robert Cemper · Oct 9, 2018 3m read

The question has come up several times and I saw mixed answers and no quick example

My personal preference is using CPIPE device as you get back exactly the output you will get at the command line interface of your OS .
The tricky thing is to stop reading in time.
The example just displays what you normally see in your console.
it becomes useful if you look for things that you can't get from any $system.whatever()

e.g.
- your servers IP address or addresses depending on your configuration.  
- pinging any other server to see if it is still visible on the network
- running nslookup 

GitHub

5
4 2619