Embedded Python refers to the integration of the Python programming language into the InterSystems IRIS kernel, allowing developers to operate with data and develop business logic for server-side applications using Python.
Hi all, I am trying to execute a query like the below code. set statement = ##class(%ResultSet).%New("some_class:query_method"). // here query method is empty and with rowspec some columname
statement.Execute(param1)
I want to fetch data type of column value returned from above. eg - Name - VARCHAR, amount - INTEGER etc. How can I get it. Or if not possible directly. Is there any other way to validate or get datatype of values returned. Line we have type() in python3
Recently, I've been working on a Business Process that processes a large JSON FHIR message containing up to 50k requests in an array within the JSON.
Currently, the code imports the JSON as a dynamic object from the original message stream, obtains an iterator from it, and processes each request one at a time in a loop.
My general question is how to convert to a %Library.ListOfObjects to a Python "array-like" structure for use in Matplotlib.
Specifically, I have a Line Object which is comprised of a list of Points (see classes below). I want to pass the line to Python to create a Matplotlib Path.
Has anyone come across a good using Embedded Python to convert a Python List object to an IRIS %List object?
My use case is I want to open an SQL entry with an Objectscript class method, then pass some information from that row into a separate Python class method which will then create a Python List object, then have the Python class method return that list back to the Objectscript class method in such a way that the Python List can be converted to an IRIS %List object for me to then use in the Objectscript code.
I'm currently facing an issue with a Python script in my IRISHealth environment and would appreciate your insights.
I've written a class method, `getTokenCount`, in Python, which uses the `tiktoken` module. However, when I run the script in the terminal using `do ##class(python.openaiUtils).getTokenCount("")`, I encounter the following error:
How can I refer to a classmethod of the same class while coding another classmethod with Embedded python?
I know that I can call it with iris.cls(classname).MethodName(), but it's more cumbersome even comparing with ObjectScript, where I can call ..MethodName().
Those who code IRIS solutions in VSCode using Docker often use the convenient ObjectScript menu, which contains links to Management Portal, Class Reference, Unittest portal, Productions, etc.
While drilling down to a Dev Container to code Embedded Python there is no such option, at least within my settings:
We're having a problem with the way Python modules are being cached in Iris. If we modify some code and then reimport a module it is still processing the old code.
I'm attempting to compile a basic Python code on a remote server, but it appears that the compiler doesn't recognize the language.
The remote server is running a virtual machine with Oracle Linux Server 7.9 (64-bit), and it has IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) [HealthConnect:3.3.0] installed.
When I try to compile a script that includes a Python ClassMethod, such as this "testpy.cls":