Hi,
I was struggling with a procedure that was meant to receive a string and use it as a filter, I've found that since I want the procedure to do some data transformation and return a dataset, I needed to use objectScript language.
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,
I was struggling with a procedure that was meant to receive a string and use it as a filter, I've found that since I want the procedure to do some data transformation and return a dataset, I needed to use objectScript language.
Hello!
I wonder if anyone has a smart idea to extract an XML fragment inside a text document (incoming from a stream)?
The XML fragment is surrounded by plain text.
Example:
text...........
text...........
<?xml version="1.0" encoding="UTF-8 ?>
<Start>
...etc
</Start>
text...........
text...........
The XML is not represented by any class or object in the Namespace.
The XML can look different from time to time
Appreciated if anyone knows how to use Objectscript to extract the XML content.
Regards Michael
Hello everybody,
I've been experimenting with Embedded Python and have been following the steps outlined in this documentation: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
I'm trying to convert a python dictionary into an objectscript array but there is an issue with the 'arrayref' function, that is not working as in the linked example.
This is a snapshoot of my IRIS terminal:
USER>do ##class(%SYS.Python).Shell()
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.Hi developers!
Just want to share an old but always relevant best practice on namespaces changing @Dmitry Maslennikov shared with me (again).
Consider method:
classmethod DoSomethingInSYS() as %Status
{
set sc=$$$OK
set ns=$namespace
zn "%SYS"
// try-catch in case there will be an error
try {
// do something, e.g. config change
}
catch {}
zn ns ; returning back to the namespace we came in the routine
return sc
}And with new $namespace the method could be rewritten as:
classmethod DoSomethingInSYS() as %Status
{
set sc=$$$OK
new $namespace
set $namespace="%SYS"
// do something
return sc
}So! The difference is that we don't need to change the namespace manually as it will be back automatically once we return the method.
and we don't need try-catch (at least for this purpose) too.
Is it possible to use a variable instead the actual class name when calling a class method?
Ex.
s var = "MyPackage.MyClass"
d ##class(var).Main()
Have successfully installed the Intersystems ObjectScript Extension Pack (version last updated 2024-03-26) in VS Code version 1.88 and when creating a new Class (in a New File of type ObjectScript-class) I am presented only with the following snippets:
.png)
When watching the Intersystems training videos (I am fairly new to IS) I notice there are far more options provided. For example from the video "Creating a Custom HL7 V2 Search Table" the following snippets are presented:.png)
Is there an additional extension I am missing or possibly a configuration setting?
If you have system tables implementing the "VERSIONPROPERTY" functionality, you may encounter error 5800. This article explains how this error occurs and provides solutions to resolve the issue.
When version checking is implemented, the property specified by VERSIONPROPERTY is automatically incremented each time an instance of the class is updated (either by objects or SQL).
For example:
ClassMethod RunVersionChange() As %Status
{
Set sample = ##class(dado.TblSample).%OpenId("42")
Write !,"VERSIONPROPERTY value: "_ sample.VersionCheck
Do sample.I'm currently making some changes to legacy code and I've noticed that it uses "i $i(" all over the place. Testing in terminal seems like this does the same thing as "do $i()". Is there a difference between these two (and if not is there some interesting history around this)?
We are writing a custom Business Operation to interact with a downstream SOAP web-service. Classes for the SOAP operation were originally generated using the SOAP Wizard, then modified. This is functioning OK, but we'd now like to set the ReplyCodeActions setting on the operation and are struggling to make it visible via the management portal. How can we achieve this?
The classes are structured like this:
Hi Community,
I am trying to read a JSON file and convert into HL7 message.Please find the example below
Set Jsonobj={"Doctype":"ADT^A01","PatientId":"123","PatientName":"Alex"}
Set Dynjsonobj=
Error :<THROW>%FromJSON+37^%Library.DynamicAbstractObject.1 *%Exception.General READ error while reading input stream 10 Line 1 Offset 0
I am getting this error while reading the file,Can you please tell me where i am doing wrong in converting the file?
Joe
There is a Link Procedure Wizard option within the Management Portal (System > SQL >Wizards > Link Procedure) which I had reliability issues with so I decided to use this solution instead.
You need to query an external SQL database to use the response within a namespace. This guide is assuming that you already have a working stored procedure in SSMS although you could instead use a SQL block within the operation. Stored procedures in SSMS are preferred to maintain integrity, Embedded SQL can get very confusing if you have a complicated SQL statement.
Visual Studio Code releases new updates every month with new features and bug fixes, and the March 2024 release is now available.
Version 1.88 includes:
Using VECTOR_COSINE() in SQL query to perform a text similarity search on existing embeddings in a %VECTOR column.
Code is below.
Commented out sql query returns this error: SQLCODE: -29 Field 'NEW_EMBEDDING_STR' not found in the applicable tables^ SELECT TOP ? maxID , activity , outcome FROMMain .AITest ORDER BY VECTOR_COSINE ( new_embedding_str ,
Sql query as written returns ERROR #5002: ObjectScript error: <PYTHON EXCEPTION> *<class 'OSError'>: isc_stdout_write: PyArg_ParseTuple failed!
Hi everyone.
This is a full example how to use a %ScrollableResultSet for results pagination using %DynamicQuery:SQL and build a JSON response including page details.
Feel free to use, share, comment or improve it.
In cache studio there are features, dialog boxes, that help map data from a global to class properties.
I have used %CacheSQLStorage quit a bit, or have in the past, to map globals to classes.
I haven't been able to find a similar feature in VisualStudio.
Do I need to upgrade to IRIS to be able to use VisualStudio to map global properties to classes?
Thanks for your time,
Richard
In the Business Operation, how do we get to know which source is currently sending primary request if there are multiple requests coming at the same time?
In the next few weeks, my coworkers are planning to start using VSCode to code with InterSystems' products. Among the many advantages of that, I would emphasize being able to connect with other technologies, such as GitHub, with ease. Besides, VSCode also offers an extensive extensions store, where you can find many free add-ons that make coding faster and more efficient. Last but not least, to conquer the heart of every developer, it is open source.
With that being said, let's start the tutorial. Feel free to skip some steps if you're comfortable doing them alone.
Hi all,
For a requirement of the customer, we have a BS Rest api with a lot of methods, we need to get the IP of the caller, the method and what is the time that the API has taken to process.
I've found the event onPreDispatch where I can take the IP, ClassMethod, etc.
.png)
Visual Studio Code (VS Code) is a free source code editor made by Microsoft for Windows, Linux, and macOS. It provides built-in support for JavaScript, TypeScript, and Node.js. You can add extensions to provide support for numerous other languages including ObjectScript.
The InterSystems extensions enable you to use VS Code to connect to an InterSystems IRIS server and develop code in ObjectScript. The Visual Studio Code Documentation is an excellent resource on VS Code, so it is a good idea to be familiar with it.
Hello,
First of all thanks for your time and help with this question.
We wonder how could we convert a String which represents an XML, to a class which extends from Ens.
Hi,
I am having an issue when I am publishing data to FHIR which is hosting in AWS. I am sending the data to the Cloud FHIR url but getting the below error.
Any idea how to resolve this issue? Any example to cretae FHIR repository using Object script?
:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL was not found on this server.</p> </body></html>
I need to write test cases for Object script but need help for understanding the mock library in IRIS? Or need Suggestion for how to use mocking
Hello everyone,
I am looking for the syntax or the way to use a class created in the "BNA" Namespace (my application) from the %SYS Namespace.
Here is the context:
I have a "BNA" application contained in the "BNA" NS, this application provides a user creation functionality. This feature creates both the user in a table in the application and in the Iris system.
I created an initialization script for my database to be able to reset it at will, this script starts by emptying the database of this data, then initializes the basic data.
Hi Developers!
I want to share with you the approach you can use working with Unit Testing which I personally find very convenient and robust.
Will not talk much here about Unit Testing, we have documentation, enough good articles on the topic not only on the Internet but here on Developers Community too, e.g. this one.
How can you manage the Unit Testing of your ZPM module?
This is pretty handy with ZPM. It has a special command "test" which runs all the tests you mentioned in the module. You can execute it as shown below:
zpm:USER>module-name test
And this command runs all the tests you mentioned in module.xml.
Let's see how it works.
Your may not realize it, but your InterSystems Login Account can be used to access a very wide array of InterSystems services to help you learn and use InterSystems IRIS and other InterSystems technologies more effectively. Continue reading to learn more about how to unlock new technical knowledge and tools using your InterSystems Login account. Also - after reading, please participate in the Poll at the bottom, so we can see how this article was useful to you!
Work Queue Manager (WQM) is a feature of InterSystems IRIS that enables you to improve performance by distributing work to multiple concurrent processes programmatically. The idea is that you split the work into chunks, and WQM distributes the chunks across worker processes and can provide the info that the work is done.
However, recently, I got an interesting question: there's a large logical transaction composed of ~1,000,000 individual objects and SQL inserts and updates. Some updates are CPU-intensive, so the original idea was to use WQM to split an update into chunks to speed things up.
But, here's a catch: if one of the individual 1,000,000 changes fails (there's a variety of application-level checks so that it can fail, and that's not even that abnormal a behavior), the entire transaction must be rolled back. That creates a problem: each chunk must report success before committing their individual transactions, and someone must get all these reports and decide if we are committing or not.
Unfortunately, it looks like WQM does not have a bidirectional communication between workers and manager, so I suggested an approach using events:
I had a question about using ZSTART, ZSTOP, and ZMIRROR.
Hi Everyone,
My name is Vignesh and I'm from Virtusa HR Team, we are hiring for a InterSystems Developer in US (Remote), If anyone is interested You can share your resumes avignesh@virtusa.com, also refer your friends.
-Building new and debugging and fixing existing HL7, CCD and custom data interfaces (JSON and XML) to internal and external destinations.
Most server-client communication on the web is based on a request and response structure. The client sends a request to the server and the server responds to this request. The WebSocket protocol provides a two-way channel of communication between a server and client, allowing servers to send messages to clients without first receiving a request. For more information on the WebSocket protocol and its implementation in InterSystems IRIS, see the links below.