Hi, community!

Consider you need to exclude substring(s) from a string.

I did it with the following snippet:

/// excludes all the substrings from the string
ClassMethod ExcludeSubstring(substr,str as %String) As %String

{

 while ($L(str,substr)>1) {

 set str=$Piece(str,substr)_$Piece(str,substr,2,*)

            }

 quit str

}

So, for example:

0 2
0 413

Hi,
I've organized my repository using TortoiseSVN. I was careful to use only svn commands while creating my file structure. Now all Subversion commands are working at the command line but not from within my IDE (Cache Studio). Basically I'm trying to write a plug-in for my IDE to use Subversion from within the Studio. Trying to integrate Subversion into my IDE, something like Subclipse, but for Cache Studio. The error occurred after reorganizing my code into directories. For example at the command-line, svn info and svn status and all other commands work perfectly. All Subversion commands work at the command prompt!

0 8
0 1.3K

How can I prevent large number truncation when using the DynamicObject and DynamicArray classes to create JSON in objectscript and then parsing the result in javascript. Are there any global settings that configure the output when using these classes?

I am looking at converting to the new DynamicObject and DynamicArray classes to build JSON. Our current (homegrown) JSON library forces string representation of numbers too long because of errors we were seeing with long numbers being truncated on the client, I am hoping to accomplish the same with the new classes.

0 2
0 1.2K

Is there any way that I can check the native type of an object script variable? (similar to the typeof check in javascript)

I see that the DynamicArray class uses the type of the variable for its output, I would like to do something similar when I receive a value as an argument to my method.

USER>s var1 = 123 //No quotes, number type

USER>s var2 = "123" //quotes, string type

1 3
0 564

Using the following...

//Get PDF stream object previously saved
   Set pdfStreamContainer = ##Class(Ens.StreamContainer).%OpenId(context.StreamContainerID)
   Try {
     Set pdfStreamObj = pdfStreamContainer.StreamGet()
   }
   Catch {
      $$$TRACE("Error opening stream object ID = "_context.StreamContainerID)
      Quit
   }

Would it be possible to search the pdfStreamObj for certain values like a Medical Record, or Patient Name?

Thanks

Scott

0 1
0 922

Hi,

Thanks for your time.

Plain $ZF(-1) and $ZF(-2) calls from Cache Studio or Terminal have stopped launching the OS shell from Win10.

cmd (Windows Command Prompt) should be launched.

Configuration:

Windows 10 Anniversary Update, Ensemble 2016.2.0.585.0 Developer Edition x64

Is this common? I have enabled both %Developer role and a Cache CallOut privilege for all users that operate in this scenario.

In Terminal, W $ZF(-1) prints -1, W $ZF(-2) prints -1

In Studio, W $ZF(-1) hangs the IDE, W $ZF(-2) prints 0

0 2
0 1.1K

We don't often use SQL within our org, which is mostly due to the performance issue we experience due to the quantity of data we are reviewing.

Aside from the standard performance measures for non-Caché databases, are there any recommended approaches when querying large tables?

The table would have roughly 50M records, but there are not a finite amount of sub-nodes.

0 7
0 901
Question
· Nov 22, 2016
Cache Syntax - Directory Exists

I am trying to write some code to check to see if a directory exists before creating a new directory.

When I do the following I am not getting a response, but the directory exists..

do ##class(%File).DirectoryExists("/ensemble/")

am I missing something?

0 5
0 859
Importance and Collection of Exact Version Information ($zv / $zversion)
The explanation of:
- why collecting $zv is important (The WHY),
- what the components of $zv mean (The WHAT),
- and how to collect $zv (The HOW).
(The Ultimate $zv Guide to the ISC Galaxy in large, friendly letters)
14 4
1 1.5K

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)

0 1
0 674

Here's an easy one for you; before I spend another hour looking for the answer, how do you convert %ArrayOfDataTypes to an array (that could, say, fit into the %session.Data array, or maybe just some array named info()), and of course back again?

NS>s aodt=##class(%ArrayOfDataTypes).%New()

NS>w aodt.SetAt("lcavanaugh","username")
1
NS>w aodt.SetAt("organization","coolcompany")
1
NS>w ##class(%ArrayOfDataTypes).BuildValueArray(aodt,.array)

<LIST>zBuildValueArray+1^%Library.ArrayOfDataTypes.1

1 3
0 950

I try to run the cmd command in the studio terminal, but i am getting the <NOTOPEN> Error.

Even ZF(-1) also not working. Any help, Please!!!

Note: i restart the Cache instance service with full privilege

Code:

Set Path="mkdir E:\Sample\New"

Open Path:"QR":10

Error:<NOTOPEN>

This command working on my PC, but on server throws error.

Many Thanks

0 3
0 1K
Question
· Nov 3, 2016
Simple Arithmetics

Can somebody explain this behaviour of Cache (and many other calculating machine as well) :

WRITE 1/3*12

4

WRITE 1/3*5

1.666666666666666667

W 1/3*18

5.999999999999999999

W 1/3*21

6.999999999999999999

W 1/3*24

7.999999999999999999

How can we make more occurate caculations in Cache ?

1 2
0 639

I was recently asked whether we have a function to convert LDAP date time stamps into $HOROLOG format or other formats and the answer is not at the moment, but there is a simple method to do the conversion.

Let us look at the facts and figures involved...

1) Active Directory's (AD) date 0 (zero) is 1601-01-01 00:00:00.000 or January 1st, 1601 at midnight (00:00:00)

2) AD timestamps are calculated as the number of 100 nanosecond intervals from date 0

3) 864000000000 is the number of 100 nanosecond intervals per day

6 1
0 1K

Here are a few examples of conversions and operations you might need, along with links to documentation where you can learn more.

At the time I wrote this, Eastern Daylight Time was in effect for my Caché system.

How Caché keeps the time and date

Caché has a simple time format, with a longer range of recognized dates compared to some other technologies.

The current time is maintained in a special variable $HOROLOG ($H):

8 4
0 14K

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.

12 4
5 13.9K