The last days I've work with the great new feature: LOAD DATA With this post I would like to share my first experiences with you. The following points do not contain any order or other evaluation. These are only things that I noticed when using the LOAD DATA command. It should also be noted that these points are based on the IRIS Version 2021.2.0.617 which is a preview release. So it may be that my observations do not apply to newer IRIS versions.

6 5
2 944
Article
· Aug 26, 2020 3m read
Updating Patient Resource using fhir.js

Hi Community,

I shared my experience working with FHIR for the first time in this article.

In that article, I wrote how I explored the FHIR Resources and talked about the information that I found useful in FHIR documentation.

The first version of my app only shows the information that FHIR Resource provides.

I wanted to make the user able to update the patient details, so I to search for an example of how to do it.

2 2
0 921
Article
· Sep 20, 2018 2m read
Get Day of the Week from Date

This code snippet determines the day of the week associated with a date. The class method "test" takes a date as a string in "mm/dd/yyyy" format, and returns an integer corresponding to a day of the week:


Class cartertiernan.getDayfromDate Extends %RegisteredObject
{
    classmethod test(date) as %Integer {
        //Set date = $ZDATE(date) //  Looks like: mm/dd/yyyy
     
        Set monthList = $LISTBUILD(0,3,3,6,1,4,6,2,5,0,3,5) // (Jan,Feb,Mar,Apr,...)
        Set centuryList = $LISTBUILD(6,4,2,0) // first two digits divisiable by 4, then subsequent centuries. EX (2000, 2100, 2200, 2300)
        Set dayList = $LISTBUILD("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") // Index goes from 0-6
         
        Set day = $PIECE(date,"/",2) // get the day 
        Set monthVal = $LIST(monthList,($PIECE( date,"/",1 ))) // get the month value
        Set first2DigsYear = $PIECE( date,"/",3 ) \ 100 // get the last 2 digits of the year
        Set last2DigsYear = $PIECE( date,"/",3 ) # 100 // get the first 2 digits of the year
         
        // Used for DEBUG perpouses
        /*write !,"day: ",day
        write !,"Month: ",monthVal
        write !,"last2: ",last2DigsYear
        write !,"first2: ",first2DigsYear
        write !,"cen Val: ",$LIST(centuryList,(first2DigsYear # 4) + 1),!!*/
         
        // Look here for formula explination (its the "Basic method for mental calculation")
        // http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week
        Set dayOfWeekVal = ( day + monthVal + last2DigsYear + (last2DigsYear\4) + $LIST(centuryList,(first2DigsYear # 4) + 1 ) ) # 7
     
        Quit dayOfWeekVal
    }
}

Here's a link to the code on GitHub

(originally posted to CODE by Carter Tiernan, 6/18/14)

2 1
1 893

Process-private Globals can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:

  • add elements to a pool (ignoring duplicates)
  • check if an element exists in the pool

Here's the class:

4 2
0 886
Article
· Nov 27, 2017 1m read
Upgrading TLS configurations

Caché will not change the cryptographic settings in an existing TLS configuration when you upgrade. This means that unless you've updated them yourself, you're still using the values from the very first version you started using SSL in.

5 2
0 830
Article
· Mar 2, 2020 2m read
SQL -99 error while viewing a listing

This error is sometimes seen while viewing a listing in InterSystems IRIS Business Intelligence:
ERROR #5540: SQLCODE: -99 Message: User <USERNAME> is not privileged for the operation (4)

As the error suggests, this is due to a permission error. To figure out which permissions are missing/needed, we can take a look at the SQL query that is generated. We will use a query from SAMPLES as an example.

1 0
0 799

Have you ever been editing files in VS Code, but needed to check a global value or run a few ObjectScript commands? Now you can, with no setup required! If you have vscode-objectscript extension version 2.10.0 or later and are connected to InterSystems IRIS 2023.2 or later, you can now open a terminal connection to your server, regardless of where it's located.

There are three ways to open this new terminal:

17 2
9 777
Article
· Mar 15, 2019 2m read
Tar compress tool in ObjectScript

I'm sure most of you have already familiar with the possibility of using GZIP in InterSystems products. But, the problem is that GZIP working only with one file or stream, and it does not support folders. When you work in Unix systems, there is a possibility how to solve it, using tar compress tool which goes with every Linux system from out of the box. But what to do if you have work on Windows as well, which does not have it.

I am pleased to offer you my new project isc-tar, which will help you do not care about operating system, and deal with tar files anywhere.

6 1
4 759

Hi,

It turns out that on windows if you run a command with a windows command file you need to escape the % character as %%

In my case I could test freeze and thaw calls at the command line successfully as

..\bin\cache -s. -U%SYS ##Class(Backup.General).ExternalFreeze()

...but when my freeze script ran it would fail.

it turns out that a single '%' is striped when run in a windows command file, and it must be escaped as '%%' windows gets:

1 3
0 755
Article
· Apr 25, 2018 4m read
DNI functions

Hi everyone!

I want to share four functions with you. I hope that you can use it at some time.

DNI: the initials of the type of national identity document, is composed of different series of numbers and letters. That proves the identity and personal data of the holder, as well as the Spanish nationality. Example: 94494452X

NIE: The NIE or foreigner identity number is a code for foreigners in Spain.


In this page you can generate examples of DNI or NIE https://generadordni.es/

3 8
0 752

If you are seeing this error during import: ERROR #6301 Line: 2 Offset: 118 This does not appear to be a Cache exported file, unable to import.

This error is caused by exporting from InterSystems IRIS and trying to import into Caché. If you plan on exporting from IRIS to Caché, you can use the following qualifier to export your classes so that Caché does not throw an error on import:

w $SYSTEM.OBJ.Export(<items>,<filename>,"/exportversion=cache2018.1")

7 3
0 738

This short article was motivated by a problem of one of my customers. They use Ensemble to integrate many systems, some of them use just plain files.

So they naturally selected File Outbound Adapter to write into target file. Things were running smoothly for years, until recently, when the volume of data being written to the file reached large size of tens of megabytes. The operation took around half an hour to complete, causing timing problems where subsequent operations within the process had to wait, and third party system was not happy to wait so long.

13 2
0 714

Points to remember before you start:

  1. 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.
  1. 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.
3 0
0 678
Article
· Nov 26, 2019 3m read
Designing valid hierarchies in DeepSee

When designing a hierarchy in DeepSee, a child member must have only one parent member. In the case where a child corresponds to two parents, the results can become unreliable. In the case where two similar members exist, their keys must be changed so that they are unique. We will take a look at two examples to see when this happens and how to prevent it.

5 1
0 670
Article
· Mar 28, 2017 2m read
Map, Reduce and Filter Collections

Inspired by the article "Declarative development in Caché" that's still trending on the dev com. The OP explored a functional style of iterating over a collection. A comment today suggested "Caché would need syntax support for anonymous functions".

With Macros you can kind of get anonymous like syntax using dot notation.

This is not production code, but it does work. First the macros...

2 15
0 669