Hello developers!

Share the best practices: 1) saving frequently used code sections, 2) quickly finding it, and 3) quickly including it into the current program?
There was a thought for 1,2 to use DC(this resource), but the search is not always convenient not only for me

The idea on the surface is to use the git repos wiki.
Are there any other best practices?

0 12
0 202

Common macro def as following

#def AnyNumber(%args) for i=1:1:$listlength(%args) { Write $listget(%args, i)}

Using this marcro in objectscript code:

ClassMethod Test() as %Status {

$$$AnyNumber($lb(1,2,3))

}

if ths args is literal value , Iit worked great. But When I want pass Objects, It's not working

$$$AnyNumber($lb(##class(someClass).%New()))

I know I can pass a %ListObjects , If I want more shorter Line. How can I do this.

Tks

0 1
0 201

In Cache WIndows environment:

Trying to use the $SYSTEM.SQL.DDLImport to import XML File that has ClassMethods, no SQL Table, but it doesn't appear to be working. I can use this ClassMethod to create SQL Tables. The manual method I have been using is to go into Cache Management Portal, Classes, Import.

I create an XML file first, then run the following to import but get no errors. Any ideas?

0 2
0 201

I am trying to do package mapping in the %ALL NameSpace.

I create a new Package Mapping entry and select my database bu the "Package Name" combo box never populates the packages in this database so I cannot select it, see screenshot below, the "Package Name" list remains empty. There definately are packages in that database. Why is this happening? Did I miss a setting?

0 1
0 200
Question
· Sep 16, 2020
More than 1 cursor in a class

I have a class that has 2 different cursors for different queries, audit1 and audit2. which are in 2 different methods. The first query runs fine, but the second one generates a 102 error.

Is there an issue with having more than 1 cursor in a class?

Has anyone seen this before?

0 2
0 198

I have a list of 300 code combinations in the following format, which I plan to load into a global

X123, Internal health

X234, external health

X345, Peripheral health etc..

I want to get the code from the DG1 segment, compare to the global, and add a description. Is there an easy way to do it?

So in my DG1 segment If I get the code X123, what I want to do is check if the code is in the global and if it does add the description in the field.

So DG1 will look like this:

0 7
0 198

Hey folks - I'm working on some training materials and I'm looking for a paragraph or two and/or a diagram that illustrates their record IO flow. Does anyone know of a good outline of how records are moved into the database and committed?

0 2
0 196
Question
· Nov 4, 2020
IRISReference in Native Api

I am trying to use IRIS Native API in .NET code I see following code snippet here https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

  IRISReference valueRef = new IRISReference(""); // set inital value to null string
  iris.ClassMethodString("%SomeClass","SomeMethod",valueRef);
  String myString = valueRef.value;               // get the method result

But IRISReference is not available as a type.

0 3
0 196

I'm looking for any codes that match my parameter that we have received since 1/01/2020 based on the FromTime, EnteredOn or Status (if both are empty).

(Problem[Problem/Code='%1' and FromTime>"2020-01-01"]) | (Problem[Problem/Code='%1' and (count(FromTime)=0 or FromTime="") and EnteredOn>"2020-01-01"])
| (Problem[Problem/Code='%1' and (count(FromTime)=0 or FromTime="") and (count(EnteredOn)=0 or EnteredOn="") and Status/Description="Active"])

This works like a charm with standard XPATH query tools but HS does not like it.

1 2
1 195

I currently have a batch job that performs many functions. Two of them are below. I was wondering how this can be done in a custom class

mv $TEMPDIR/$FILE $TEMPDIR/$FILEa"_$DATESTAMP.txt"
mv $TEMPDIR/$FILE1 $TEMPDIR/$FILE1a"_$DATESTAMP.txt"
mv $TEMPDIR/$FILE2 $TEMPDIR/$FILE2a"_$DATESTAMP.txt"
mv $TEMPDIR/$FILE3 $TEMPDIR/$FILE3a"_$DATESTAMP.txt"
mv $TEMPDIR/$FILE4 $TEMPDIR/$FILE4a"_$DATESTAMP.txt"
#Gzip files
find $TEMPDIR -type f ! -iname '*gz' -exec gzip '{}' \;

Thank you

0 2
0 195
Question
· May 24, 2020
calling AIX command failed

I can run the following commands from the AIX command line prompt without any problem

-bash-2.05b$ echo t
t
-bash-2.05b$ echo œ
œ

When I call from insider cache, I have problem.

USER>D $ZF(-1,"echo t")
t

USER>D $ZF(-1,"echo œ")

D $ZF(-1,"echo œ")
^
<TRANSLATE>

I am using cache 2017.2. Can someone shed some light?

Thank you.

0 5
0 195

As the title mentions, I'm trying to determine how best to handle an issue with nested data. Essentially I have a setting like the following:

Object A has a transient property with an array of Object B. I want to create a level with a list of Object B. I also want this level to contain properties belonging to each object B.

So I have a layout of something like

0 1
0 195

I noticed when creating Record Map's within Ensemble that it is creating a Persistent cache table as it translates the file and puts it into the Record Map data structure.

I was wondering if there was a way to add a column to the cache table that is Hidden from the record map, but is a calculated date value on when that record was inserted?

0 4
0 195
Question
· Apr 7, 2020
CSP Translation

Hi guys,

I have read thos two links how to translate CSP application

https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCSP_localization_tags#GCSP_localization_tags_compile

https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=ASTRLOC#ASTRLOC_localization_util_export

I have exported strings to XML

<?xml version="1.0" encoding="UTF-8"?>

<MsgFile Language="sk">

<MsgDomain Domain="webshop">

1 1
0 193

From my recent post, I uploaded a set of values into a global, and I am trying to compare the first field, and then

$GLOBAL("123", "bone issue")=""

$GLOBAL("234","joint issue")=""

Now, I want to compare and see if the DG1:4.1 segment has the code $GLOBAL and then replace the DG14.1 segment with the code and the description

so For Eg: if DG1:4.1 exists in $GLOBAL("123") then replace the segment with the code and description

Can someone guide me on how I can achieve this?

0 4
0 192

I have developed a pos and tested my bit map on multiple sites, but the switch is not responding,
what do you think the error is:
<log realm="channel/192.168.23.23:4988" at="Fri Jun 12 14:42:03 EAT 2020.15" lifespan="64ms">
<connect>
192.168.23.23:4988
</connect>
</log>
<log realm="channel/192.168.23.23:4988" at="Fri Jun 12 14:42:17 EAT 2020.802" lifespan="1ms">
<send>
<isomsg>
<!-- org.jpos.iso.packager.XMLPackager -->

0 1
0 191

Im exporting our xml project from a QA server that has NOT upgraded to a production server that has been upgraded to HealthShare.

We are importing the exported xml over to this production server that is on HealthShare.

Now I havent been able to find the document link today, but I remember reading HealthShare puts all of the imports under a csp/healthshare/ directory.

We are able to view our .csp pages after importing them as xml into Studio on the production server running on HealthShare

0 2
0 191

HI,

I have sample %session like this

%session.Data("product", "1") = "Product 1"

%session.Data("product", "2") = "Product 2"

%session.Data("product", "3") = "Product 3"

%session.Data("product", "4") = "Product 4"

%session.Data("product", "5") = "Product 5"

How can i loop in tag based CSP application over %session?

if i have <csp:while condtion=""> Is there something like %session.Data("products").Next() ?

0 1
0 191

i've noticed a strange bug in the 'problem highlighting' of VSCODE and i wasn't sure if this is a problem with the internal library definitions of iris, or with the plug-in itself.

The first line is the correct macro call, but the second one is the one throwing the error. (preprocess vs prepOrocess)

How is this syntax checker's list of strings compiled?

0 1
0 189

I like to be able to call an "autohotkey" executable message box from within a running Cache routine executing as a jobbed routine. The autohotkey executable displays a small pop-up window with a message and an "OK" button .. and will time out in 10 seconds if the user does not press the OK button.

Although $ZF(-1,cmd) executes (where "cmd" contains a simple batch command e.g. @c:\autohotkey\warning.exe), no interactive window appears and, once the autohotkey routine times out, the calling cache routine simply continues.

0 5
0 186

Hi all,

I added an additional shard node to an existing shard by accident.

After the add, it can not be removed and query from the master shard now fails. I did not find any data from shard master in the shard node.

How to recover it and remove the shard node from the shard master?

Thanks.

0 2
0 186

Hi ,

I tried to import Custom schema with 'Z' segment. I executed "Do ##class(EnsLib.InteropTools.HL7.MessageAnalyzer).Interactive()" in IRIS Terminal.

After executed the steps, i am getting below message, So i could not able to add z segment into my customschema 'Test_2.3'
------------------------------------------------------------------------------------------------
Summary Report for workspace C:\Demo\Migration\Workspace
Schema is Test_2.3
ALL: 0 matched, 1 unmatched

0 1
0 186