#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.

Discussion Stefan Cronje · Feb 12, 2023

Hi Community,

A long time ago, I create a package for a String datatype that works with Regular Expression. It is quite a simple solution.

This can work well with packages like the OpenAPI-Suite, where you can then use the "Regular Expression String" as the type for properties of the validator objects where the Swagger contained a Regular Expression.

I am proposing we start a common package of datatypes for use. The package name to use can be provided by the admins.

3
0 290
Question Dmitry Maslennikov · Feb 18, 2016

XData blocks in Caché classes has a MimeType property, and dcoumentation says

MimeType — The MIME type (more formally, the internet media type) of the contents of the XData block. The default is text/xml

But unfortunately I can't set any other values, such as text/html or application/javascript, because XData still expect only XML. 

So, question is, for what reasons this property was appeared?

It would be very usefull to set in this property anything other then text/xml, and Studio would highlighted it as developer expected.

3
0 554
Article Stefan Cronje · Jan 25, 2023 3m read

Hi folks,

I am announcing a new package I have loaded on the OEX, which I am also planning on entering into the contest this month.

In a nutshell, what it offers you are the following.

  • Base classes to use on Persistent (table) classes for InterSystems IRIS to keep record history  
  • These classes enable the historizing of persistent class records into another persistent class when touched.  
  • This provides for a full history of any record. 
  • It allows for record rollback to a specific version.  
  • It can automatically purge old history records.

Do you need it?

2
0 429
Article Evgeny Shvarov · Jun 24, 2020 3m read

Hi Developers!

Suppose you have a persistent class with data and you want to have a simple Angular UI for it to view the data and make CRUD operations.

Recently @Alberto Fuentes described how to build Angular UI for your InterSystems IRIS application using RESTForms2. 

In this article, I want to tell you how you can get a simple Angular UI to CRUD and view your InterSystems IRIS class data automatically in less than 5 minutes.

Let's go!

3
4 1368
Article 王喆 👀 · Feb 7, 2023 5m read

Hello, friends who are developing IRIS. I recently participated in the InterSystems Developer Tools Contest. This time, I made a tool based on the idea described in an article I published earlier as a template for quick query of messages. Currently, you only need to establish entity classes in IRIS, Then record the message corresponding to the entity class in the specified lookup table, and all the key fields generated in the message can be inverted indexed (the concept in ElasticSearch), which is convenient for quick query. The following is the design idea of my program.

1
0 292
Question Stefan Cronje · Feb 7, 2023

Hi all,

In the days when I was still using studio, the indentation character of choice was tab, due to misalignment of code when using non-monospaced fonts.

In VSCode when I create new class files, this defaults to 4 spaces. Where and how do I set the default indentation for ObjectScript class files?

Also, with python it should be spaces. So what is recommended when doing python script inside objectscript classes?

Thank you.

2
0 1631
Question Chris Pursey · Jan 31, 2023

We have created a number of REST adapters that extend %CSP.REST and these have been working fine.  However, we are now facing a problem with a new one where very large XML documents are being posted.  This is the pattern we are following:

Set inMsg = %request.Content.Read()

Set tSC = ##class(Ens.Director).CreateBusinessService("Epro_ItkHttp",.tBusinessService)

Set tSC = tBusinessService.ProcessInput(inMsg, .tBusinessServiceOutput)

However, when the %request is particularly long, it is being truncated, and working with %XML.Reader then fails in the business service class.

4
0 613
Question Dmitrij Vladimirov · Feb 3, 2023

When requesting /MDX2JSON/PivotVariables/Patients?Namespace Patients shoud be passed to a method but its not. When argument passed directly into the method it works.

<Route Url="/PivotVariables/:Cube" Method="GET" Call="WritePivotVariablesForCube"/>

Has something changed in IRIS and this syntax is deprecated, or is there a bug and the colon is ignored? What could it be?
This question is continuation from https://community.intersystems.com/node/534811

1
0 222
Question Scott Roth · Jan 27, 2023

I have a system that is sending Line Breaks\Carriage Returns within the text of a field that is breaking the parsing of the message. Does anyone have a way to get around this?

here is what I receive... 

ZPR|29|937952|UH|Physician Assistant - Certified|Primary Privileges:  Physician Assistant|Care of simple fractures including extremity, rib and clavicle; including skeletal
immobilization||

as EnsLib.HL7.Service.FileService parses the message it puts immobilization on a new line because of the hidden line break, and the rest of the message is lost.

5
0 283
Question Stefan Cronje · Jan 25, 2023

Hi *,

I want to dynamically generate the arguments of a method during compile time.

'For example, I want the following method

ClassMethod DoCleverStuf() As %Status [ CodeMode = objectgenerator ]
{
    do %code.WriteLine("    Set tSC = $$$OK")
    ...
}

to look like this in the .int code.

ClassMethod DoCleverStuf(pValue1 As %Integer, pValue2 As %String) As %Status [ CodeMode = objectgenerator ]
{
    // some generated code will be here
}

Is this possible? Or alternativel;y, can I generate a whole method at compile time?

Thanks.

2
0 333
Question Joe Jones · Jan 24, 2023

Hi Community,

I have created a HL7 production in my working environment, Ens.Alert ,EMailAlert, PagerAlert, and  BadMessageHandler are created.

Can anyone explain how Ens.Alert and BadMessageHandler will work when an HL7 message in Passed in Business service and how these 2 are related when any error occurs in the Production envinorment?

1
0 334
Question Omar Ali Ateen · Jan 24, 2023

Dear Friends

Please help me to create  %ZEN.proxyObject same in below example:

{

    "dynamicLinkInfo": {

        "domainUriPrefix""link.example.com",

        "link""https://www.examplelink.com"
    },

    "suffix": {

        "option""SHORT"
    }

}

 

My Code

2
0 355
Question Stefan Cronje · Jan 22, 2023

Hi all,

I am trying to use some process private variables (percent variables) in Triggers.

I am referring to values from $System.Process, like the ClientIPAddress and CSPSessionID.
These do to not contain values and I suspect it is bacause of scope. I also checked, and the %session variable is not available if the change originated from a CSP request.
I know that in triggers the scope of the variables are to be kept local, that is why NEW is to be used.

Is there a way to access the Process Private Variables in Triggers or get $System.Process to return the correct values?

Thanks.

10
0 485
Question Menno Voerman · Nov 4, 2022

Hi All,

Hopefully  someone can help me with this case. I need to encrypt a text(querystring) with an AES265 encryption. An other vendor is decrypting this information. I have a working class in C#. I've tried to build the same in Objectscript for the encrypt part but there's a missing link somewhere.  What's the difference between the C# and Objectscript implementation?

Objectscript code (until now):

7
0 788
Article Jeff Morgan · Oct 21, 2016 3m read

This article will describe and include an example of how to embed an external PDF file into an HL7 segment, specifically ADT_A01:2.3.1 OBX().  This can be useful when attempting to insert pictures or other external data into an HL7 message.  In this example, the name of the PDF file to be embedded is provided in the incoming HL7 message in OBX(1):ObservationValue field.

The basic stipulations for this example are as follows:

  1. Accept a PDF file
  2. Accept an HL7 message
  3. Using the name of the PDF file, embed the PDF data into the HL7 message
  4. Output the message to file

  

4
6 15851
Question Julian Matthews · Jan 16, 2023

Hi everyone.

I have a use case where I'm using embedded SQL within a Business Process to interact with a SQL table. However, when it comes to deployment into our production, the table wont form part of the deployment package created from the production.

Beyond manually creating the table on the production system, is there a standard way of ensuring that a table needed for a class is created during deployment?

2
0 244
Question Chip Gore · Jan 12, 2023

In trying to define a Class Parameter that I can use in SQLComputeCode I can't seem to get any of the syntaxes for the using of the parameter where the SQL compute code will actually evaluate the parameter values. There is nothing specific that I can find in the docs about SQLCompute Code and Parameter usage.

Is there some specific syntax for accessing a class defined parameter in the SQL Compute Code that works?

This is on: IRIS for Windows (x86-64) 2022.1.1 (Build 374U) Tue Oct 18 2022 17:37:34 EDT

4
0 337
Article Evgeny Shvarov · Jan 25, 2020 4m read

Hi Developers!

"objectscript.conn" :{
      "ns": "IRISAPP",
      "active": true,
      "docker-compose": {
        "service": "iris",
        "internalPort": 52773
      }

I want to share with you a nice new feature I came across in a new 0.8 release of VSCode ObjectScript plugin by @Dmitry Maslennikov and CaretDev.

The release comes with a new configuration setting "docker-compose" which solves the issue with ports you need to set up to make your VSCode Editor connect to IRIS. It was not very convenient if you had more than one docker container with IRIS running on the same machine. Now, this is solved!

Read below how it works now.

8
3 919
Question Anna Golitsyna · Dec 14, 2022

I am familiar with $TEXT which can get you any line in the current routine provided you know the offset. For example, $T(+1) will get you the first line of the current routine at the run time. In the same vein, how do I reference the current line number/offset at the run time? Something like $T(+$CURRENTLINENUMBER) where $CURRENTLINENUMBER is not yet known to me function. The sample below would write 3 as the line number.

RTNNAME
 S A=1
W $CURRENTLINENUMBER

13
1 718
Announcement Anastasia Dyubaylo · Dec 29, 2022

Hey Community,

Our huge thanks to everyone for participating in the Advent of Code 2022! We're pleased to present the winners and distribute all the prizes. 

Big applause goes to these developers: 

🥇 @Kevin An (w/ repo)

🥈 @Robert Barbiaux (w/ repo)

🥉 @Yuval Golan (w/ repo)

🏅  @Maksym Shcherban (w/ repo)

Here's the final InterSystems leaderboard:

1
1 542
Announcement Emily Geary · Dec 27, 2022

While you don't need to take your exam before the end of 2022, the vouchers provided to the UK&I Summit 2022 must be redeemed before January 1, 2023. Please register for an exam before time runs out. 

You can find additional information about the InterSystems Certification Program here.

0
0 241
Article Rizmaan Marikar · Jul 27, 2022 6m read

What is Web Scraping:

In simple terms, Web scrapingweb harvesting, or web data extraction is an automated process of collecting large data(unstructured) from websites. The user can extract all the data on particular sites or the specific data as per the requirement. The data collected can be stored in a structured format for further analysis.

What is Web Scraping? — James Le
Steps involved in web scraping:

  1. Find the URL of the webpage that you want to scrape
  2. Select the particular elements by inspecting
  3. Write the code to get the content of the selected elements
  4. Store the data in the required format

It’s that simple !!

12
9 1871