hi guys!
while
.png)
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 guys!
while
.png)
Visual Studio Code releases new updates every month with new features and bug fixes, and the June 2024 release is now available.
Version 1.91 includes:
Hi, I have a controller which handles accounts, and forwards to the relevant controller based on the path, example below:
XData UrlMap
{
<Routes>
<Map Prefix="/:accountId/anothercontroller" Forward="AnotherController"/>
</Routes>
}Problem is that inside AnotherController, the accountId path parameter is lost, I assume that's because the map forward simply checks if there's a match then forwards.
$ZTIMESTAMP returns the date and time in UTC format, so to change it to the local time zone, use the following system method:
$SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP)The above output will be in the format ddddd,sssss.fff.
ddddd: Same format as $HOROLOG dates
sssss: An integer indicating the number of seconds elapsed since midnight on the current date
fff: Variable number of digits indicating the fractional part of a second
* Similar to $HOROLOG, except that $HOROLOG does not include fractional seconds.
SAMPLES>write $SYSTEMUtil.I have a class with two methods
Class Foo.Bar
{
ClassMethod Helper()
{
// do something
}
ClassMethod Generated() [ CodeMode = objectgenerator ]
{
do ..Helper()
// do something else
}
}
Since the method Generated is run before the class is compiled, the call to do ..Helper() fails. Is there a way around this other than manual inlining?
Has anyone noticed weird behavior when upgrading to HealthShare Health Connect 2024.1?
Wednesday I upgraded our TEST environment from IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2022.1.4 (Build 812_0_22913U) [HealthConnect:3.5.0-1.m1] [HealthConnect:3.5.0-1.m1] to IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) [HealthConnect:3.5.0-1.m1].
Some of our Business Processes have been throwing...
This is an attempt to run a vector search demo completely in IRIS
There are no external tools and all you need is a Terminal / Console and the management portal.
Special thanks to Alvin Ryanputra as his package iris-vector-search that was the base
of inspiration and the source for test data.
My package is based on IRIS 2024.1 release and requires attention to your processor capabilities.
I attempted to write the demo in pure ObjectScript.
Only the calculation of the description_vectoris done in embedded Python
Calculation of a vector with 384 dimensions over 2247 records takes time.
The SYS.Mirror CatchupDB() method requires a System File Number/Inode value as a parameter. I have not yet found a suitable internal method to get this value. Is anyone aware of a utility method that would do this? I do know I can get this value with a small amount of Python or by calling out to the OS. However I wanted to stick with pure Objectscript in this project if possible.
Failing in this I will use embedded python to run the line or two of Python needed to get this value.
Thank you for any hints
Hey everyone.
I was wondering if anyone had come across a way of reformatting ObjectScript within VSCode.
I have the various Intersystems Extensions installed (InterSystems Language Pack, InterSystems ObjectScript, InterSystems ObjectScript Extension Pack, InterSystems Server Manager) but a formatter does not seem to be something included within this variety of extensions.
Hello,
Thanks for reading this question.
We need to remove the line feeds and carriage returns from start and end, but not from the middle of a string
We have tested the following ways:
set output = $ZStrip("[line feed](carriage return) str [line feed](carriage return) ing [line feed](carriage return)","<>C")But it removes also control characters which we need to preserve.
The procedure for uploading/downloading from an FTP server is as follows.
1. Upload the image file to the FTP server
set tmpfile="c:\temp\test.jpg"
set ftp=##class(%Net.FtpSession).%New()
// connect to FTP server
do ftp.Connect("","<username>","<password>")
// set transfer mode to BINARY
do ftp.Binary()
// Move to the directory to upload
do ftp.SetDirectory("/temp/upload")
// Prepare a stream of files to upload
set file=##class(%File).%New(tmpfile)
do file.
I'm scraping my way through some code that's been around for a while, and came across the use of $ZTRAP and (dear GOD) GOTO for trapping and handling errors.
In an effort to "modernize" it and make it, I don't know, less M-ish (sorry old-timers!), I'm replacing it with Try/Catch blocks.
Some questions:
And if the answer to number 3 is Yes, my deepest apologies ... I love you guys! 🤩
Let's say I have an InterSystems IRIS instance with 6 Namespaces:
And the number of Foo# namespaces can increase at any time for a number of reasons. I need to ensure that they all have identical configuration globals stored in a DB called CONFIG, so I do the following in my configuration file:
[Map.%ALL]
Global_SYS=%DEFAULTDB
Global_SYS("CommonConfig")=CONFIG
Global_SYS("CommonOtherSettings")=CONFIG
Global_SourceControl=CONFIG
This will ensure that all Namespace see the exact same settings when they reference ^SYS("CommonConfig") or ^SourceControl, etc.
Now.
Hello everyone,
Recently, I've been working on a Business Process that processes a large JSON FHIR message containing up to 50k requests in an array within the JSON.
Currently, the code imports the JSON as a dynamic object from the original message stream, obtains an iterator from it, and processes each request one at a time in a loop.
The performance meets the requirements, even with much larger requests than the one exposed above.
I have a table that is already created and contains data. I need to create a unique constraint that is a combination of two fields. Is there a way to do this in a SQL statement? Also, I would lke to know how to add it in the table class.
Hello,
I am interested about reading the source code of the primitives of the system. For example, I want to see how WRITE is implemented.
Can you help me to get a reflexive interrogation of the system ?
Kind regards,
Alin C Soare.
Hello Everyone,
The Certification Team of InterSystems Learning Services is developing an InterSystems ObjectScript Specialist certification exam, and we are reaching out to our community for feedback that will help us evaluate and establish the contents of this exam. Please note that this is one of two exams being developed to replace our InterSystems IRIS Core Solutions Developer exam. You can find more details about our InterSystems IRIS Developer Professional exam here.
How do I provide my input? Complete our Job Task Analysis (JTA) survey!
Note: this was originally posted on June 5, 2024 but presented as being posted on May 9, 2024 so this re-post fixes the date.
Recent updates to the Intersystems Language Server introduce many significant enhancements aimed at improving developer experience and productivity. I'll talk about some of the key ones here, while the complete list, including numerous bug fixes, can be found in the Language Server's CHANGELOG.
In the past, all syntax errors were reported simply as "Syntax error.
Hi Community,
My old code:
Translated from the Spanish Community Article Contest.
Following the latest programming contest on OEX I had some surprising observation.
There were almost exclusive applications based on AI in combination with pre-cooked Py modules.
But digging deeper, all examples used the same technical pieces of IRIS.
Seen from point of view of IRIS it was pretty much the same whether searching for text
or searching for images or other pattern. It ended in almost exchangeable methods.
This reminds me my private situation at home.
Hi Community
In this article, I will introduce my application irisChatGPT which is built on LangChain Framework.
First of all, let us have a brief overview of the framework.
The entire world is talking about ChatGPT and how Large Language Models(LLMs) have become so powerful and has been performing beyond expectations, giving human-like conversations. This is just the beginning of how this can be applied to every enterprise and every domain!
Trying to pass pdf to save to custom file using default Trying to pass pdf to save to custom file and %f. but oriignal filename didn't send (it does in terminal). What is missing from setting filename from stream? can the file passthrough not out of box use outputfilename or has wrong default one been sent.
set fname="ThisHasBeenChanged.pdf"
Set test = ##class(File.EpacsPDF).%OpenId(1)
set tempStream=##Class(%Stream.FileCharacter).%New()
Set sendstream = ##Class(Ens.StreamContainer).%New()
set sendstream.OriginalFilename=fname
set sendstream.We have a yummy dataset with recipes written by multiple Reddit users, however most of the information is free text as the title or description of a post. Let's find out how we can very easily load the dataset, extract some features and analyze it using features from OpenAI large language model within Embedded Python and the Langchain framework.
First things first, we need to load the dataset or can we just connect to it?
The TIMESTAMP type corresponds to the %Library.TimeStamp data type (=%TimeStamp) in InterSystems products, and the format is YYYY-MM-DD HH:MM:SS.nnnnnnnnn.
If you want to change the precision after the decimal point, set it using the following method.
1) Set system-wide
Management Portal: [System Administration] > [Configuration] > [SQL and Object Settings] > [General SQL Settings]
Default time precision for GETDATE(), CURRENT_TIME, CURRENT_TIMESTAMP. You can specify the number of digits in the range 0 to 9.
Hello,
I would like you to propose this challenge.
It has been created by the CodeWars community here: https://www.codewars.com/kata/6523a71df7666800170a1954/python
I will copy and paste the description:
A number is Esthetic if, in any base from base2 up to base10, the absolute difference between every pair of its adjacent digits is constantly equal to 1.
We have a custom business service that is triggered by a scheduled task. The service queries a table, iterates over the result set and sends a message on to a business process for each result. Happy path functionality is all fine.
However, when there is an error detected in the business service code, neither throwing an exception nor returning an error %Status behaves as we'd expect.
Our error handling scheme, which is working for the other business processes and operations, is to throw an exception on error.
Hello Community,
My Intersystems Caché Version: 1.2014 (Can't update now.)
I have the following issue:
I have for example an articlenumber with 15049950, which is numeric. But sometimes it can also be an alphanumeric string like PK15049950.
How can i set numbers always to string in Json Stream with quotes like "15049950".
Code Example:
set object = ##class(%ZEN.proxyObject).%New()
set articlenumber = "15049950"
set object.articlenumber = articlenumber
set x = ##class(%ZEN.Auxiliary.jsonArrayProvider).%WriteJSONStreamFromObject(.
Hi
I'm new to DTL. I'm playing with Code action and run into some syntax error with a simple assignment statement. Please see the screenshot below.
Can someone direct me to some sample code in a Code action for processing HL-7 messages please? Thanks
In our previous article, we explored how to send emails through Microsoft 365 using the Graph API. Since then, an anonymous client reached out to me about setting up some other methods of notifications through that API. He was particularly interested in Outlook’s tasks and calendar events.
If you still have your client ID, client secret, and application ID from the last exercise, you may continue utilizing them. We will reuse the globals we stored from before with the GetToken method. Most of the setup in Microsoft Entra will not need to be repeated.
The basic idea is to use Vectors in the mathematical sense.
I used geographic coordinates. These are of course only 2-dimensional
but much easier to follow as vectors in text analysis with >200 dimensions.
The example loads a list of worldwide capitals with their coordinates
The coordinates are interpreted as vectors from geographic point 0°N/0 W
(some very wet spot in the Gulf of Guinea, >400 km from the African Coast)
Finding common directions from that spot is a quite theoretical case.
So adjustment to your preferred starting point is implemented.