Hi devs!
How one can understand the classnames of request and response messages of a given operation?

E.g. when I build the data transformation, how do I know which message will come to the operation?
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 devs!
How one can understand the classnames of request and response messages of a given operation?

E.g. when I build the data transformation, how do I know which message will come to the operation?
Now the Classes/Rutines/DeepSee files will be automatically exported to the working directory after saving or compiling and files will be automatically deleted .
To install isc-dev , you just need to download and import the file isc-dev.xml from last release.
Some ways to import isc-dev .xml file:
NS>do $system.OBJ.Load("yourpath/isc-dev.xml","ck")
NS>zpm
zpm: NS>install isc-dev
NS>do ##class(dev.code).workdir("/path/to/your/working/directory/src/")
dev.FileManExtension class as the main one and save it.Hi,
I'm trying to figure out why I'm unable to iterate through a dynamic array and access the nested objects.
Using the NHS PDS FHIR API in the NHS sandbox environment, I'm querying the PDS endpoint using a sample NHS Number to retrieve a patient's demographics. My Business Operation reads the response data and passes it back to my Business Process where I intend on iterating through certain nested objects. The data present in these nested objects will decide what happens next in the process.
In the JSON snippet below, I'm attempting to access the values of code and display.
Hi folks!
How can I change the production setting programmatically?
I have a production that is a solution that uses some api-keys, which are the parameters of Business Operations but of course cannot be hard-coded into the source code.
E.g. here is the example of such a production that runs a connection of Telegram and ChatGPT.
And it can be installed as:
zpm "install telegram-gpt"
But now one needs to setup the key manually before using the production, having the following setting:
.png)
I'd like to set up it programmatically so one could install it as:
zpm "install telegram-gpt -D Token=sometoken"
How can I make it work?
I had attempted to create a REST Operation before but did not have success. As I am going through the Tutorials and Documentation everything references REST services, but I have a case where I want to create a REST Operation that makes Epic API calls against Interconnect. I have done SOAP operations before and we currently have one in our Production Namespace, but from what I understand SOAP has the wsdl which defines al the structures and etc, where REST does not.
So how does one go about creating a REST Operation if Learning Tutorials and Documentation always talks about REST services?
The InterSystems ObjectScript language does not allow you to define methods of the same name with different arguments. It is generally classified as a programming language called a dynamic language.
In ObjectScript, you can freely control which arguments are used when executing a method, so unlike languages such as Java, which are not dynamic programming languages, there is no need to strictly distinguish methods by the number of arguments at the compilation stage.
The Caché epoch is January 1, 1840 and the Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 . How do you convert the current date and time to Unix epoch time?
It is with great pleasure that the CIUSSS de l'Estrie - CHUS is sharing the mocking framework it developed and presented at the InterSystems Summit 2017. I will update this post with more detailed instructions in the next few weeks but I wanted to share the code and presentation quickly :
https://gitlab.com/ciussse-drit-srd-public/Mocking-Framework
I hope you'll find this useful for your unit testing. We are using this extensively for the last 2 years and it really works well! The repo is public, feel free to submit enhancements!
Do not forget to enable the %UnitTest in your SMP.
Hi All,
See code below. We don't want to %FromJSON interpret the data.
We're creating a method to convert json to csv but we don't want to convert/interpret any of the data
The write in the code snipped below will give 220 as weight instead of 220.00.
Does anyone now a way/method to don't interpret the data without put "" on the values?
Class Tmp.test
{
ClassMethod help()
{
set src = "{""name"" : ""greg"", ""weight"" : 220.00 }"
set obj = ##class(%DynamicAbstractObject).%FromJSON(src)
write obj.name,!
write obj.weight,!
return $$$OK
}
}Hi folks!
How can I refer to a classmethod of the same class while coding another classmethod with Embedded python?
I know that I can call it with iris.cls(classname).MethodName(), but it's more cumbersome even comparing with ObjectScript, where I can call ..MethodName().
Compare ObjectScript:
do ..SetupGame()and the same call in EmbeddedPython:
iris.cls('eshvarov.sample.SeaBattle.GamePython').SetupGame()Thoughts?
Has anyone come across a good using Embedded Python to convert a Python List object to an IRIS %List object?
My use case is I want to open an SQL entry with an Objectscript class method, then pass some information from that row into a separate Python class method which will then create a Python List object, then have the Python class method return that list back to the Objectscript class method in such a way that the Python List can be converted to an IRIS %List object for me to then use in the Objectscript code.
Hi folks!
I have a need to use symilar to $property function from Python. Here is the code:
obj=iris.cls('some.persistent.class')._New()
for property, value in data.items():
$property(obj.property)=value ; I invented thisHow could I do this? Any trick?
For now I plan to implement a helper function in iris that I will call, but I doubt also how can I transfer oref to IRIS.
Thoughts?
I am creating a class code below
Class Sample.Header
{
Property Key As %String;
Property Show As %Boolean;
}
when I am trying to create an object of this class
using set obj = ##class(Sample.Header).%New()
getting error <METHOD DOES NOT EXIST> %New, Sample.Header
I need to convert "dd/MMM/yy" to "YYYYmmdd".
Input = dd/MMM/yy
Output = YYYYmmdd
example
Input = 13/Jun/23
Output = 20230613
I used below , I get 1923 as year but I need 2023.
$ZDATE($ZDATEH("13/Jun/23",8),8) = 19230613
Hi folks!
Just curious, how can I use $znspace in embedded python code?
How does other $functions work, e.g. $zv, $job, etc
Hi folks!
Consider I need to call a python function which name contains "_" symbol (which is quite often in Python). How it could be called from ObjectScript?
E.g. here is the code:
Set sm = ##class(%SYS.Python).Import("sample")
write sm.helloworld() ; function without _
white sm.hello_world() ; function with _ - won't compile.Thanks in advance!
Sorry, somewhat of novice here, but how is a mac or a routine created into a binary or is there a way to hide your routines so that no other user can edit them? Like remove source code and have an executable?
I would like to do this MAC and CSP pages
How Job command can be used with Embedded Python code?
Excuse if this is obvious to Python programmers but for those crossing over from ObjectScript this may be a useful tip.
The scenario is developing some Embedded python commands.
Testing out functionality is being confirmed via the shell:
$SYSTEM.Python.Shell() Python 3.9.5 (default, Mar 14 2023, 06:58:44) [MSC v.1927 64 bit (AMD64)] on win32 Type quit() or Ctrl-D to exit this shell. >>>
When Python evaluates an expression in the shell, it prints the result of the expression to the terminal.
>>> 1 + 2 3
It is quite easy to accidentally evaluate and print out values
>>> iris.cls("%Dictionary.I am working with a REST API JSON Response that contains a list of integers (departmentids).
JSON Response:
{
"status":"ACTIVE",
"departmentids":[
72
],
"subscriptions":[
{
"eventname":"LabResultAdd"
},
{
"eventname":"LabResultUpdate"
},
{
"eventname":"LabResultClose"
}
]
}I am having trouble getting that to parse into my custom message structure using the %JSONImport method.
Here is my custom message class (pResponse):
Class AH.AHLIB.Custom.Athena.Message.GetEventsSubscribedResponse Extends (Ens.Response, %JSON.Hello!
I would like to find all classes not up to date in a namespace programmatically.
With IRIS Studio, we can see the single "+", but I don't know how to do that with a script.
Set sql = "SELECT ID, Name FROM %Dictionary.ClassDefinition WHERE NOT ID %STARTSWITH ?"
Set params($Increment(params)) = "%"
Set tResult = ##class(%SQL.Statement).%ExecDirect(, sql, params...)
If (tResult.%SQLCODE'=0)&&(tResult.%SQLCODE'=100) Set sc = $$$ERROR($$$SQLError, tResult.%SQLCODE, tResult.%Message) Quit sc
While tResult.%Next() {
// if class not up to date ??
}I am writing a custom business class. I need to use the business service name that will be using the class within a SQL statement. How can I get the business service name that is using the class?
Good morning,
I was wondering:
Given the following scenario where we have a string where each two items are being splitted by "|" as follows: "squadName|initialLetter"
"Alfa|A|Bravo|B|Charlie|C|Delta|D|Echo|E|Foxtrot|F|Golf|G|Hotel|H|India|I|Juliett|J|Kilo|K|Lima|L|Mike|M|November|N|Oscar|O|Papa|P|Quebec|Q|Romeo|R|Sierra|S|Tango|T|Uniform|U|Victor|V|Whiskey|W|X-ray|X|Yankee|Y|Zulu|Z"
And we would need to generate a String structure like:
[
{
"number": "number 1",
"squad": "Alfa",
"answer": [
{
"initialLetter": "A"
}
]
},
[.Hi folks!
Those who actively use unittests with ObjectScript know that they are methods of instance but not classmethods.
Sometimes this is not very convenient. What I do now if I face that some test method fails I COPY(!) this method somewhere else as classmethod and run/debug it.
Is there a handy way to call the particular unittest method in terminal? And what is more important, a handy way to debug the test method?
Why do we have unittest methods as instance methods?
Using the Config.Configuration class and SYS.Database class methods, you can create and register a namespace database from the terminal.
Below is a series of execution examples that create database file /CacheDB/AAA/cache.dat and register database AAA and namespace AAA in the configuration file (cache.cpf).
* Execute in the %SYS namespace. *
* Make sure that this script runs as the user that is used for all IRIS processes to ensure that the directory has appropriate ownership and permissions *
I have the following method call (have included html and css as well). when I debug the code in a browser, JavaScript seems to work fine. Loading image is coming up, table is getting hidden. But when I close the debug and just load the page and run it, loading image is not coming up, neither the table is hidden. Not sure what is going on? I need help to understand what I am doing wrong?
We are looking at what we need to do to migrate from our current usage of Zen reports to InterSystems Reports. One of the hurdles for us is figuring out ways to interact with InterSystems reports programmatically from ObjectScript routines. There is a Java API for it, but it is possible to generate a report from InterSystems reports to a stream object in ObjectScript without diving into Java by using a %Net.HttpRequest.
I am trying to call to a website that renders a xml structure as a response.if I put the url on the browser an xml rendered page is returned but if i call to this using the below code I get an object reference error which I am finding had to understand is there anyone who could help understand this error or point me in the right direction thanks.
Set httpRequest = ##class(%Net.HttpRequest).%New() Set httpRequest.Server = "msedgewebdriverstorage.blob.core.windows.net"
Set httpRequest.Port=443
Set httpRequest.
Hi,
I'm trying out VS Code with IRIS for Health 2023.2 (not available in above dropdown) in a local container. I can open read-only files in the Objectscript viewer and have a local folder connected to the correct namespace. However, when I make changes and try the "import and compile" option, I get:
ERROR #16006: Document <filepath> name is invalid
The first four chars of <filepath> appear to have been truncated
Here is my settings.json
{
"security.workspace.trust.untrustedFiles": "open",
"workbench.colorTheme": "InterSystems Default Dark",
"intersystems.
Hi,
just want to know if indexes in IRIS / SQL are autobuilding.
I define an index in a table and then i costantly do a lot of insert/delete in that table. Will i face index problem? Do i need to rebuild it often?
Thanks