#Python

0 Followers · 456 Posts

Python is an interpreted high-level programming language for general-purpose programming. Created by Guido van Rossum and first released in 1991, Python has a design philosophy that emphasizes code readability, notably using significant whitespace

Official site.

InterSystems Python Binding Documentation.

Question Dmitry Maslennikov · Nov 4, 2022

I have a table, with autoincremented id

CREATETABLEusers (
    idSERIALNOTNULL,
    nameVARCHAR(30) NOTNULL,
    PRIMARY KEY (id)
)

I can add a new item there with an explicit id 

INSERTINTOusers (id, name) VALUES (2, 'fred')

And while my id is autoincremented, I can omit it

INSERTINTOusers (name) VALUES ('ed')

So, this time, I don't know the id, and I want to somehow get it.

I could do it with LAST_IDENTITY() function, but it just uses %RowID, and have no relation to the primary id

11
0 766
Article Lucas Enard · Nov 29, 2022 5m read

Hello everyone, this is with great pleasure that I announce the V2 of my application 'Contest-FHIR'.

In this new version, I used new tools and techniques I discovered at the EUROPEAN HEALTHCARE HACKATHON in which I was invited by InterSystems as a guest and as a mentor to display the multiple projects I did in my intership back in April 2022.

Today I present to you the V2 of my application, it can now transform CSV to FHIR to SQL to JUPYTER notebook.

This is for me a really huge step in InterSystems technologies and I think this tool will be used for many other purpuse and cases.

0
0 545
Article Lucas Enard · Nov 27, 2022 9m read

Hello everyone, I’m a French student in academical exchange for my fifth year of engineering school and here is my participation in the FHIR for Women's Health contest.

This project is supposed to be seen as the backend of a bigger application. It can be plugged into a Front End app and help you gather information from your patients. It will read your data in local and use a Data Transformation to make it into a FHIR object before sending it to the included local FHIR server.

1
1 1043
Question Dmitry Maslennikov · Oct 23, 2022

This is not an issue in ObjectScript, due to its typeless nature. But it's essential for external programming languages that care a bit more about types of variables.

And in any case, it's still reproducible in ObjectScript. I have table

CREATETABLE some_table (
        idINTEGERNOTNULL, 
        x INTEGER, 
        y INTEGER, 
        z VARCHAR(50), 
        PRIMARY KEY (id)
)

And data

11
0 837
Article Piyush Adhikari · Oct 19, 2022 3m read

I am demonstrating a use case of how we can create an IRIS Interoperability Production for special use in an external language. InterSystems IRIS, within Interoperability has a framework called Production Extension (PEX), using which we can create productions and program them as per their purpose using external languages like Java, Python etc, and also develop custom inbound and outbound adapters to communicate with other applications. Here in this demo, I will demonstrate a PEX framework-based production created by @Guillaume Rongier on Python, and I am using ‘task-specific’ business

5
0 429
Article Lucas Enard · Aug 17, 2022 9m read

In this GitHub based on this InterSystems community rest api template Guillaume and I have created this example of all the import CRUD operations usable using ONLY Python on IRIS and using Flask.

Using the IRIS ORM or by simply doing SQL requests as both methods are seen in the GitHub.

1. intersystems-iris-docker-rest-template

This is a template of a REST API application built in python in InterSystems IRIS. It also has OPEN API spec, can be developed with Docker and VSCode.

13
0 822
Article Henry Pereira · Aug 2, 2021 8m read

Easy, easy, I'm not promoting a war against the machines in the best sci-fi way to avoid world domination of Ultron or Skynet. Not yet, not yet 🤔

I invite you to challenge the machines through the creation of a very simple game using ObjectScript with embedded Python.

I have to say that I got super excited with the feature of Embedded Python on InterSystems IRIS, it's incredible the bunch of possibilities that opens to create fantastic apps.

Let's build a tic tac toe, the rules are quite simple and I believe that everyone knows how to play.

8
5 1493
Article Guillaume Rongier · Sep 30, 2022 8m read

grpc-iris-interop

The aim of this proof of concept is to show how the gRPC protocl can be implemented with the IRIS ineroperabilty module.

architecture

On this schema, we can see that the gRPC Service is hosted by IRIS.

This service must invoke the IRIS interoperability module. For that it transforms the protobuf messages to IRIS messages.

The gRPC client is host by a Flask server for demo purpose, the gRPC client can also be invoke by the python script.

definition of each file

users.proto

0
0 652
Article Muhammad Waseem · Sep 20, 2022 8m read

Hi Community,
In this article, I will introduce Python Flask Web Framework. Together we will create a minimal web application to connect to IRIS and get data from it.
Below you can find the steps we will need to follow:

  • Step 1 : Introduction to Python Flask Web Framework
  • Step 2 : Installation of Flask module
  • Step 3 : Creation of web application using Flask
  • Step 4 : Use of HTML Templates 
  • Step 5 : Installation of IRIS Python Native module
  • Step 6 : Establishment of a connection with IRIS 
  • Step 7 : Transferring data from IRIS to Flask and displaying it

So Let's start with step 1

2
1 879
Question Kevin McGinn · Sep 19, 2022

In my Python script I import intersys2.pythonbind3 to create the connection and define a database object as db

I execute the method 

     res = self.db.run_class_method("%Library.GlobalEdit", "GetGlobalSize",[<db>, allocated,used])

This executes correctly as I loop through a list of databases.

Upon success I see that the return arg of "res" contains the string "status(0,)" which I interpret as successful. This is verified by the returned values of allocated and used being accurate. But I want to use the class/methods to get the status values from the returned structure

5
0 269
Article Lucas Enard · Sep 11, 2022 16m read

Hello everyone, I’m a French student that just arrived in Prague for an academical exchange for my fifth year of engineering school and here is my participation in the interop contest.

I hadn’t much time to code since I was moving from France to Prague and I’m participating alone, so I decided to make a project that’s more like a template rather than an application.

I wanted to participate since my field (Data Science and AI) is not often linked with sustainability and the contest was a way for me to express myself in this important subject that is sustainability and Environnement.

4
0 339
Question Fred Gustafsson · Sep 8, 2022

I'm after some more in-depth information about how the embedded python is implemented with regards to how it works when a python method is called from a CSP page. Will it run in the same Windows process? Will there be any issues with multitasking (considering python doesn't seem very good at this)?

Also, is there a performance penalty to pay for running embedded python vs "using IRIS APIs from Python". 

Another question is what python interpreter the embedded python is using? Is it an Intersystems one or the regular c.python? Version?

Excited to go Python!

2
0 335
Job Spencer Frey · Aug 31, 2022

Hi everyone!

I am recruiting on a fully remote Intersystems Developer.  This role will be a long term contract to begin with high likelihood of extensions or conversion permanent.  Please check out the job description down below and feel free to send me an email with your resume: Spencer.Frey@insightglobal.com 

1
0 375
Article José Pereira · Dec 27, 2021 12m read

In the previous articles, we learned the basics of using IMAP protocol to handle messages from mailboxes in an e-mail server. That was cool and interesting, but you could take advantage of implementations created by other ones, available in libraries ready to use.

One of the improvements to the IRIS data platform is the ability to write Python code alongside ObjectScript in the same IRIS process. This new feature is called Embedded Python. Embedded Python lets us bring to our ObjectScript code the power of the huge Python ecosystem’s libraries.

1
1 650
Article Lucas Enard · Aug 17, 2022 8m read

In this GitHub we gather information from a csv, use a DataTransformation to make it into a FHIR object and then, save that information to a FHIR server all that using only Python.

The objective is to show how easy it is to manipulate data into the output we want, here a FHIR Bundle, in the IRIS full Python framework.

1. Fhir-orga-dt

3
0 575
Article Lucas Enard · Aug 17, 2022 7m read

In this GitHub we fine tune a bert model from HuggingFace on review data like Yelp reviews. The objective of this GitHub is to simulate a simple use case of Machine Learning in IRIS :We have an IRIS Operation that, on command, can fetch data from the IRIS DataBase to train an existing model in local, then if the new model is better, the user can override the old one with the new one.That way, every x days, if the DataBase has been extended by the users for example, you can train the model on the new data or on all the data and choose to keep or let go this new model.We are aware that training

2
1 459
Article Dmitry Maslennikov · Jul 30, 2022 5m read

Continuing to  observe the possibilities of Django, and usage with IRIS. The first we have looked how to define models and connect to tables already existing in IRIS, than we extended embedded Django Administration portal, with an ability to see what data we have in that models, with filters, editing and even pagination.

Time to go to real action, now we a going to create some REST API, on Django, based on the same data, we used before from the package posts-and-tags.

To do so, we will use Django REST Framework

Django REST framework is a powerful and flexible toolkit for building Web APIs.

0
0 411
Article Ramil TK · Jul 29, 2022 4m read

In this article, I am trying to identify the multiple areas to develop the features we can able to do using python and machine learning.

Each hospital is every moment trying to improve its quality of service and efficiency using technology and services. 

The healthcare sector is one of the very big and vast areas of service options available and python is one of the best technology for doing machine learning.

In every hospital, humans will come with some feelings, if this feeling will understand using technology is make a chance to provide better service.

2
2 416
Article Lucas Enard · Jul 27, 2022 7m read

Following this GitHub we will see how the FIX protocol can be implemented easily using IRIS and Python.

If you don't have much time focus on the Send a Quote before the Order part near the end, as it will, in a matter of minute, tell you how to send a Quote Request followed by an Order Request and show you the result from the server, and that in no more than five clicks.

IRIS-fix-protocol

Implementation of the fix protocol using an IRIS python container for the initiator and a regular python container for the acceptor.

4
0 991
Article Oliver Wilms · Jul 25, 2022 3m read

Hello,

I became aware of Python in the early 2000s when I started automating tasks. Some of our processes utilized python scripts. I never figured it out very well, and we decided to do away with Python because nobody on our team was familiar with it.

Along the way, I heard a lot about Python. My interest was renewed when InterSystems offered bonus points for using Python in contests.

The things I like the most about Python so far is how easy it is to find the mean of the ages of all Titanic passengers. For my test-data app I wanted to find the largest value in the ‘Qty’ column in a CSV file.

0
0 252