Sylvain Guilbaud · Sep 6, 2022 go to post

Thanks Robert for this information.
It helps me to write my kill method in Python


ClassMethod kill(classname As %String = "data.test") As %Status [ Language = python ]
{
import iris
for x in ["D","I","S"]:
g = iris.gref("^" + classname + x)
g.kill([])
}

Sylvain Guilbaud · Sep 19, 2022 go to post

You are proof that all it takes is an internship of a few months to become a real expert.
Well done.

Sylvain Guilbaud · Dec 1, 2022 go to post

Now, with Python, you can choose your preferred way of operator precedence wink

USER>w 1 + 1 * 2
4
USER>do ##class(%SYS.Python).Shell()

>>> print(1 + 1 * 2)
3

Sylvain Guilbaud · Apr 19, 2023 go to post

Very good video indeed. The proof that COLUMNAR STORAGE can be explained clearly in 5 minutes  ; thanks for sharing

Sylvain Guilbaud · May 30, 2023 go to post

Hello Cyrille,
is it a fresh install or an upgrade from SAM 1.1. ?
Did you try to remove the sam_irisdata and sam_grafdata volumes ?

Sylvain Guilbaud · Jul 31, 2023 go to post

The approach 1 doesn't "raises your limit to 99900 properties" but rather to 6600 properties.

You can test it through large.utils.cls

w ##class(large.utils).init(66,100)
deleting large.serial100
creating large.serial100
compiling large.serial100

Compilation started on 07/31/2023 14:48:16
Compiling class large.serial100
Compiling routine large.serial100.1
Compilation finished successfully in 0.218s.

creating large.c66
compiling large.c66

Compilation started on 07/31/2023 14:48:16
Compiling class large.c66
Compiling table large.c66
Compiling routine large.c66.1
Compilation finished successfully in 8.356s.

1
w ##class(large.utils).init(67,100)
deleting large.serial100
creating large.serial100
compiling large.serial100

Compilation started on 07/31/2023 14:48:27
Compiling class large.serial100
Compiling routine large.serial100.1
Compilation finished successfully in 0.213s.

creating large.c67
compiling large.c67

Compilation started on 07/31/2023 14:48:27
Compiling class large.c67
Compiling table large.c67
Compiling routine large.c67.1
ERROR #5002: ObjectScript error: <MAXSTRING>CompileRtns+286^%occRoutine
ERROR #5002: ObjectScript error: <NOROUTINE>DescribePhase2+9^%occSysDescriptor *large.c67.1
Detected 2 errors during compilation in 6.896s.

0 a(<MAXSTRING>CompileRtns+286^%occRoutineÛCompileRtns+286^%occRoutine  IRISAPP³e^ReturnError+2^%occSystem^1!e^CompileList+229^%occCompile^1e^CompileList+23^%apiOBJ^1e^Compile+1^%apiOBJ^1e^Compile+1^%SYSTEM.OBJ.1^1^init+50^large.utils.1^1e^^^0K0 G¦
                                                                          large.c67/    IRISAPP#!e^CompileRtns+388^%occRoutine^1
IRISAPP>

Sylvain Guilbaud · Aug 14, 2023 go to post

A very good high level presentation of FHIR and what is behind this concept. To be shared broadly in our community and healthcare ecosystem.
Thanks @Russ Leftwich 
 

Sylvain Guilbaud · Aug 16, 2023 go to post

The use of docker obviously simplifies the solution to the problem and completely meets the need.
However, sometimes our customers don't use docker, even in their dev/test or staging environments.

Sylvain Guilbaud · Aug 17, 2023 go to post

These shortcuts are really handy 😀

Many of them are pre-installed with IRIS.

 

2023.2

USER>w $zv
IRIS for UNIX (Ubuntu Server LTS for ARM64 Containers) 2023.2 (Build 227U) Mon Jul 31 2023 17:43:25 EDT
USER>:?
 :<number>    Recall command # <number>
 :?           Display help
 :py          Do $system.Python.Shell()
 :mdx         Do $system.DeepSee.Shell()
 :sql         Do $system.SQL.Shell()
 :tsql        Do $system.SQL.TSQLShell()
 :alias       Create/display aliases
 :clear       Clear history buffer
 :history     Display command history
 :unalias     Remove aliases

USER>
 

2023.1.1

USER>w $zv
IRIS for UNIX (Ubuntu Server 22.04 LTS for ARM64) 2023.1.1 (Build 380U) Fri Jul 7 2023 23:52:03 EDT
USER>:?
 :<number>    Recall command # <number>
 :?           Display help
 :py          Do $system.Python.Shell()
 :mdx         Do $system.DeepSee.Shell()
 :sql         Do $system.SQL.Shell()
 :tsql        Do $system.SQL.TSQLShell()
 :alias       Create/display aliases
 :clear       Clear history buffer
 :history     Display command history
 :unalias     Remove aliases

USER>
Sylvain Guilbaud · Aug 17, 2023 go to post

Very efficient example showing how to export global from a simple CSP page

This application shows you how a simple CSP page can allow you to export in XML any global.
Very efficient and simple.

Thanks @Robert Cemper 

Sylvain Guilbaud · Aug 18, 2023 go to post

Hi Muhammad,

thanks for this very interesting app ; it wide opens a lot of possibilities 😀

I'm trying to run it locally, but I'm facing this error :
 

%SYS>zn "user"

USER>zw ^ChatGPTKey

USER>set chat = ##class(dc.irisChatGPT).%New()

USER>do chat.SetAPIKey("--- my key ---")

USER>zw ^ChatGPTKey
^ChatGPTKey(1)="--- my key ---"

USER>write chat.irisDocs("Give me details of %$PIECE function with syntax")
You exceeded your current quota, please check your plan and billing details.

WRITE chat.irisDocs("Give me details of %$PIECE function with syntax")
^
<THROW> *%Exception.PythonException  230 ^^0^ <class 'UnboundLocalError'>: local variable 'ret' referenced before assignment - 
USER>

Then after a re-run I get the result successfully ; any idea ?

USER>write chat.irisDocs("Give me details of %$PIECE function with syntax")

 The %$PIECE function is used to extract a substring from a string of text. The syntax for the %$PIECE function is %$PIECE(string, delimiter, piece_number). The string is the text from which you want to extract a substring. The delimiter is the character or characters that separate the pieces of the string. The piece_number is the number of the piece you want to extract.

The docs is not always linked to IRIS :

USER>write chat.irisDocs("Give me details of $zn function with syntax")

 The $zn function is a MongoDB operator that returns the index of a given value in an array. The syntax for the $zn function is: {$zn: [<array>, <value>]}.

USER>write chat.irisDocs("Give me details of zn function with syntax")

 The zn function is a mathematical function that takes two arguments, x and n, and returns the remainder of x divided by n. The syntax for the zn function is zn(x, n).

USER>write chat.irisDocs("Give me details of SET function with syntax")

 The SET function is a built-in function in Microsoft Excel that allows you to assign a value to a variable. The syntax for the SET function is: SET(variable, value).

USER>write chat.irisDocs("Give me details of %kill function with syntax")

 The %kill function is used to terminate a SAS session. The syntax for the %kill function is %kill;

USER>write chat.irisDocs("Give me details of kill function with syntax")

 The kill function is a command line utility used to terminate a process. The syntax for the kill function is: kill [signal] PID, where signal is an optional argument that specifies the signal to be sent to the process and PID is the process ID of the process to be terminated.
Sylvain Guilbaud · Aug 18, 2023 go to post

HI Muhammad,
I'm not able to run streamlit : 

I've restarted the streamlit container with no success.

Any idea ?

Sylvain Guilbaud · Aug 22, 2023 go to post

Very good demo of Python native API in interactive mode

This app is a very good example of how to use the IRIS native Python API to run an interactive routine from a pure Python code.
Very useful.

If you want to use it by connecting to an external instance (ie: other than your local container), you'll have to install the %ZX routine as this is the function used in the rcc.py code :

ans=iris.function("","%ZX",what+" quit 0")

To install %ZX routine or your remote IRIS instance, you can either execute from the Management Portal > System Explorer > SQL :

CREATE PROCEDURE %Zrcc.X()    
LANGUAGE OBJECTSCRIPT     
{     
 set %rcc=##class(%Routine).%New("%ZX.int")    
 set %rccline="x(%rcc) try {return $xecute(%rcc)} catch %rcc {return %rcc.DisplayString()}"    
 do %rcc.WriteLine(%rccline)     
 do %rcc.Save()   
 quit %rcc.Compile()   
}

Or simply add it from ZPM :

USER> zpm "install nacl-server"

Then from your local container, just execute rcc.py :

% docker compose exec iris python3 src/rcc.py
>>> serverIP [127.0.0.1]: host.docker.internal
>>> serverPORT [1972]: 51770
>>> namespace [USER]: 
>>> username [_SYSTEM]: 
>>> password [SYS]: 

Connected to Instance I4H on Server DEMOSERVER.EXTERNAL.COM
Select Demo to exercise
 0 = free ObjectScript
 1 = $ZV from Server
 2 = Actual Time in Server
 3 = TimeZone Offset of Server
 4 = Server Architecture*Vendor*Model
 5 = List Global in ZWRITE style
 * = Terminate demo
>>> take a choice [1]:
Sylvain Guilbaud · Aug 24, 2023 go to post

Hi @Sandeep K C 
would it be possible for you to share your code in CSS.CSP.Login and IBA.CSP.Page (after cleansing of all confidential information) ?