I have a case where our EMR is sending data, but not all the values needed for the Ancillary are valued properly and causes that message to error/halt processing on the Ancillary system, not ideal but its what they do. I would expect them to still process the message except that 1 field, but they don't.
I want to add validation to make sure certain fields are valued correctly for the Vendor.
So I add some statements to take those items that don't pass this validation out to a batch file with headers.
(Originally posted by Timur Safin on Intersystems CODE, 3/2/15) This code snippet is a routine that parses options saved in an arguments array. The subroutine "test" runs the code:
I made for fun a bash script that creates csv files from a %GOGEN exported file.
%GOGEN, the utility for exporting globals for Cache 5.xx
First I thought it would be very simply with bash, but ...
- if I want a header in the csv file
- if you export with GOGEN more globals together not only one
- if I want a csv file for every global/indexes has the global ..
The simply bash script goes up 100 lines of code. If I will start again with this, I would use Python or Go, not bash.
ObjectScript doesn't include any built-in method for appending one JSON dynamic array to another. Here's a code snippet I use that's equivalent to the JavaScript concat() method.
Call it with any number of arguments to concatenate them into a new array. If an argument is a dynamic array, its elements will be added. Otherwise the argument itself will be added.
You will receive a string of comma-separated integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive, our challenge will be to find that integer.
As usual shortest solution wins.
How can I remove elements from $lb property? Specifically last element? $list does not work with $lb properties. $listupdate can't remove elements The only solution I found is a temp variable and $list, but isn't there something better?
It is not possible in a COS (Caché Object Script) job/process context to have multiple Named Pipes. It is a one Named Pipe per job/process limited line of communication.
Named Pipes, in Caché, like most pipes on most operating systems are Unidirectional. That means you open them for either Read or Write, but not both.
(Originally posted on Intersystems CODE by @Iain Bray) The following code snippet converts all indices in a package to bitmap indices. The subroutine "test" runs the code:
Environment: Cache for Windows (x86-64) 2015.2.2 (Build 811U) Thu Mar 3 2016 12:55:48 EST [HealthShare Modules:Core:14.01.351
When try the following to send back SOAP Fault, is the following correct way?
Set fault=##class(%SOAP.Fault).%New() Set fault.faultcode=$$$FAULTServer Set fault.faultstring="Processing Error" Set fault.detail= "Error on server" Do ..ReturnFault(fault)
The class method "test" in the following code snippet sends an HTML email with an embedded image. Edit the literal strings to change the embedded image, to address, from address, subject, and body of the email.
We're developing Ensemble PoC and one day our frontend developer (who doesn't have Ensemble production running) said that Populate just doesn't cut it and he needs to see the real data. He needed only one object, but the problem was - it's a big object. Still, I checked ids of everything related and wrote this command (parts omitted, but you get the idea):
I needed to know programmatically if last ran failed or not.
After some exploring, here's the code:
ClassMethod isLastTestOk() As %Boolean
{
set in = ##class(%UnitTest.Result.TestInstance).%OpenId(^UnitTest.Result)
for i=1:1:in.TestSuites.Count() {
#dim suite As %UnitTest.Result.TestSuite
set suite = in.TestSuites.GetAt(i)
return:suite.Status=0 $$$NO
}
quit $$$YES
}
Currently, I'm working on a project that requires highly dynamic event management. In the context of the Java programming language, my first instinct should be to opt for the "Observer Pattern", which is an approach to managing interactions between objects by establishing a notification mechanism. It allows multiple observers to react to changes in the state of a subject autonomously, promoting code flexibility and modularity. If you are not familiar with this design pattern, check out Wikipedia to find more information about it.
While it's natural and commonly used in certain programming languages as Java and C++, in ObjectScript, it's quite a different story.
When I'm writing code in Intersystems Studio code completion is different than in VS Code. It would be greate if VS Code would react the same way on code completion .. This happens is studio
When I do this in VS Code it doesn't show the object but it shows ?? all possible items ??
A few years ago, I was teaching the basics of our %UnitTest framework during Caché Foundations class (now called Developing Using InterSystems Objects and SQL). A student asked if it was possible to collect performance statistics while running unit tests. A few weeks later, I added some additional code to the %UnitTest examples to answer this question. I’m finally sharing it on the Community.
I would like to create a new message of a particular type and append various segments programmatically. I have started with the following snippet. What I am currently finding difficult is to define a segment of a particular segment structure. I would like to append a pid segment of 2.3.1 to my message. I know I could you the importfromstring but I wanted to know whether there was a better way of achieving this.