Nova postagem

Pesquisar

Pergunta
· Mar. 25, 2024

Is the Implementation Partner program still open?

Anyone here know if the Implementation Partner program is still open, and if so, is there anyone we can contact to get more details? I've tried reaching out via the form on the website, I've called and left a message, and then I called and talked to someone a few weeks ago who said they would "forward my info over", but we still haven't heard back from anyone. We just want to get more info on what it entails, but can't seem to get in touch with anybody to talk about it. 

1 Comment
Discussão (1)2
Entre ou crie uma conta para continuar
Artigo
· Mar. 24, 2024 5min de leitura

Quickstart guide to IRIS DB on Linux Systems

Introduction

This is a quickstart guide to IRIS for Linux systems administrators who need to be able to support the IRIS DB as well as other normal infrastructure tasks.

IRIS is a DB system from Intersystems. An IRIS DB can hold code (in the form of a Class) or data (in the form of Globals). IRIS DB are Linux files called IRIS.DAT.

IRIS was previously called Cache. There may be some references to Cache in the Intersystems documentation or forums or in some of your system documentation.

IRIS classes are coded in language call ObjectScript. IRIS classes have properties and methods.

IRIS classes can be run as interactive jobs or as scheduled tasks all within IRIS.

 

IRIS code can be in terms of a procedure.

 

IRIS DBs are typically journalled in case transactions need to be rolled back or DBs need to be recovered from a backup via a rolled forward process.

 

IRIS DBs can be mirrored to provide a level of redundancy across 2 servers. If DBs are mirrored then the transaction updates must be committed to both mirror members before the application is advised that the update is successful. Intersystems terms the mirror members as “failover members”. One of the failover members is termed the PRIMARY and the other member is termed BACKUP.

 

There is also an arbiter node(server) so that there is a quorum. Quorum members “vote” as to which failover member has failed.

 

There can be a asynchronous mirror node. The asynchronous mirror node is updated on a store and forward basis from journals.

 

IRIS DB has a product called Ensemble that supports productions. There can be only one production per name space. Ensemble can be used to develop applications using a concept of Services (input queues), Processes (how to process the input queue) and Operations (output queue).

 

IRIS DB has a product called JReports for developing reports. The development of reports is intended to be like Crystal reports.

 

Interacting with IRIS

You can connect to IRIS with:

iris session <instance name>

 

You can find out how many instances there are defined on your system:

iris list

 

You can also connect to IRIS via the Management Portal which is GUI/web based.

 

There is also a command like interface called WebTerminal which is often installed.

 

IRIS is configured via a configuration/parameter file typically called iris.cpf.

The iris.cpf file will show the location of the IRIS.DAT file for each defined database. The iris.cpf file will also show the mirror configuration.

 

Namespace vs DB

DB files by convention live in a directory that has the name of the DB itself.

 

Namespace are a logical concept that stores data or code.

 

A namespace provides access to data and to code, which is stored (typically) in multiple databases. Databases (IRIS.DAT) are the physical manifestation of the namespace.

 

All InterSystems IRIS systems will have a namespace of “%SYS” and “USER”. There are other default namespaces:

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_enviro#GORIENT_enviro_namespace_system

 

Journalling

Journal records are written to journal files which are located on one of 2 directories/filesystems – a primary and secondary area. When the primary area is full then journals will be written to the  secondary area. When the secondary area is full then journals will be written to the  primary area.  When the primary area is full then journals will be written to the  secondary area….

Journal files are switched when backups start, backups finish, under operator control or when the configured journal size is exceeded.

When both journal areas are full then all transactions stop.

There is usually a scheduled task that deletes old journal based on the age (number of days prior to today) or the number of previous backups. The default is 2 days old or 2 backups completed. 

 

 

Objectscript

These are some basic commands:

DO <- run a class method or procedure that is stored in the namespace/database

SET <- assign a value to a variable. Variable can be set to a literal or output from a method or class property. Variables do not need to be declared.

KILL <- deletes a variable

WRITE <- write text or variable contents or combination

 

Variable names are case-sensitive.

 

If the variable name starts with a ^ then it is a global. Global are multi dimensional storage areas. Where the variable is a global (variable name starting with ^) this structure is written persistently to the namespace then to the database(s).

Intersystems documentation says:

In InterSystems IRIS, a database contains globals and nothing else; even code is stored in globals. At the lowest level, all access to data is done via direct global access — that is, by using commands and functions that work directly with globals.”

 

All other variables only exist in current user session.

 

If the name with DO  starts with a ^ then it is a procedure. For example

DO ^MIRROR

DO ^JOURNAL

 

ZN “%SYS” <- Change namespace

set status=##class(%SYS.Journal.System). GetState() <- Get the journal status

write $CASE(status,                                                          <- Print the journal status using a case statement

            0:"Enabled",1:"Disabled",2:"Suspended",

            3:"Frozen",4:"Paused")

 

List all namespaces

DO ##class(%SYS.Namespace).ListAll(.result)

zwrite result

1 Comment
Discussão (1)1
Entre ou crie uma conta para continuar
Artigo
· Mar. 24, 2024 3min de leitura

What more can be done with lists in SQL (%DLIST, %INLIST, FOR SOME)

What I find really useful about IRIS when teaching my subject of Postrelational databases is the fact that it is a multi model database. Which means that I can actually go into architecture and structure and all that only once but then show the usage of different models (like object, document, hierarchy) using the same language and approach. And it is not a huge leap to go from an object oriented programming language (like C#, Java etc) to an object oriented database.

However, along with advantages (which are many) come some drawbacks when we switch from object oriented model to relational. When I say that you can get access to the same data using different models I need to also explain how it is possible to work with lists and arrays from object model in relational table. With arrays it is very simple - by default they are represented as separate tables and that's the end of it. With lists - it's harder because by default it's a string. But one still wants to do something about it without damaging the structure and making this list unreadable in the object model.

So in this article I will showcase a couple of predicates and a function that are useful when working with lists, and not just as fields.

Let's say that we have a class Restaurant.Dish which will have all our dishes:

Class Restaurant.Dish Extends %Persistent
{
Property Name As %String;
Property Description As %String(MAXLEN = 1000);
Property Category As %String;
Property Price As %Float;
Property Currency As %String;
Property Calories As %Integer;
}

Which we somehow populated with data:

And there is a class Restaurant.Account which contains the favourite dishes of the patrons:

Class Restaurant.Account Extends %Persistent
{
Property Name As %Name;
Property FavouriteFood As list Of %String;
}

And it also contains data:

First, let's look at the aggregate function %DLIST. It returns an ObjectScript %List structure containing the values in the specified column as list elements. In general, the syntax is as follows:

%DLIST([ALL | DISTINCT [BY(col-list)]] 
  string-expr 
  [%FOREACH(col-list)] [%AFTERHAVING])

Now, let's say we need to group all the dishes by categories and get a list of all dishes in those categories:

select Category,
       %DLIST(Name) AS AllDishes,
       %DLIST(Distinct (Name)) AS AllDistinctDishes
  from Restaurant.Dish
GROUP BY Category
ORDER BY Category

Another one is a predicate condition %INLIST. It matches a value to the elements in a %List structured list. It resembles the predicate IN but expects to get a $LB as an argument, instead of a values, separated by comas. Its syntax is as follows:

scalar-expression %INLIST list [SIZE ((nn))]

For example, now we want to see what dishes out of favourites of our patrons we have on a menu:

select Name, Description, Price
  from Restaurant.Dish
WHERE name %INLIST (select FavouriteFood 
                      from Restaurant.Account 
                     where ID = 1)  SIZE ((10))

And the last predicate condition I want to highlight here is FOR SOME %ELEMENT. It matches the list elements in field with the specified predicate. The SOME keyword specifies that at least one of the elements in the field must satisfy the specified predicate clause. The predicate clause must contain either the %VALUE or the %KEY keyword, followed by a predicate condition. These keywords are not case-sensitive. The syntax is as follows:

FOR SOME %ELEMENT(field) [[AS] e-alias] (predicate)

As for the last example, let's say we got a deal for Sprite and Diet Coke and we wish to see if it will have traction with our patrons. 

select *
  from Restaurant.Account 
 where FOR SOME %ELEMENT(FavouriteFood) f
     (f.%VALUE IN ('Sprite','Diet Coke') and %KEY IS NOT NULL)

So this is just to attract your attention to these 3 possibilities of working with lists in SQL. For further details, please visit the documentation pages I referenced in the article. And of course, you can always use built-in functions when working with $lb in SQL.

2 Comments
Discussão (2)1
Entre ou crie uma conta para continuar
Pergunta
· Mar. 23, 2024

FHIR Data not return content

Hi,

I found an issue while fetching records from FHIR DB, I am getting below error thou FHIR repository have the records with the corresponding id

{

    "resourceType": "OperationOutcome",

    "issue": [

        {

            "severity": "error",

            "code": "not-found",

            "diagnostics": "<HSFHIRErr>ResourceNotFound",

            "details": {

                "text": "No resource with type 'Appointment' and id '21'"

            }

        }

    ]

}

5 Comments
Discussão (5)2
Entre ou crie uma conta para continuar
Artigo
· Mar. 21, 2024 2min de leitura

Left Side Functions in ObjectScript

In ObjectScript you have a wide collection of functions that return some value
typically:

set variable = $somefunction(param1,param2, ...)

There is nothing special about that.
But there is a set of functions that I classify as LEFT SIDED 
The specialty of them is that you can use them also on the left of the equal operator 
as a target in the SET command:

set $somefunction(param1,param2, ...) = value

The reason to raise that subject is that with IRIS 2024.1 there is after may years  a "new kid on this block"

$VECTOR()

Assigns, returns, and deletes vector data at specified positions
especially
set $VECTOR(MyVector , position , type) = value

I do not want to elaborate on the details. The documentation is really complete.
There are also 3 other new vector-related right sided functions 
$VECTORDEFINED (),  $VECTOROP(), $ISVECTOR()  
You find the description following the links.

If you follow the examples in the documentation, you see that the new related
SQL Function TO_VECTOR () does pretty much the same in SQL notation
(actually it's not visible in InterSystems SQL Reference )

As a reminder / overview a list of the traditional left side functions:

  • $BIT – Returns and or sets the bit value of a specified position in a bitstring.
  • $EXTRACT – Extracts a substring from a character string by position, or replaces a substring by position.
  • $LIST – Returns or replaces elements in a list.
  • $PIECE – Returns or replaces a substring, using a delimiter.
  • $WEXTRACT – Extracts a substring from a character string by position, or replaces a substring by position, recognizing surrogate pairs.

It's a short list but can be highly efficient in some cases to avoid duplicated content and confusing manipulations.

3 Comments
Discussão (3)3
Entre ou crie uma conta para continuar