Clear filter
Announcement
Anastasia Dyubaylo · Dec 1, 2021
Hey Developers,
Learn about the use and design of the InterSystems FHIR Transformation Service and the InterSystems FHIR Server, and what to expect next:
⏯ FHIR in the Cloud: Understanding New InterSystems FHIR Server
🗣 @Mitchell.Tyson, Senior Cloud Engineer, InterSystems🗣 @Regilo.Souza, Product Owner - Cloud Strategy, InterSystems
Subscribe to the InterSystems Developers YouTube channel and stay tuned!
Announcement
Anastasia Dyubaylo · Mar 11, 2022
Hi Community,
Get a first look at InterSystems HealthShare's next-generation healthcare decision support and notification capabilities:
⏯ Introducing InterSystems HealthShare Extended Decision Support
🗣 Presenter: @Frank.Pandolfe, Clinical Product Specialist, InterSystems
Subscribe to the InterSystems Developers YouTube channel and stay tuned!
Question
Ben Spead · Feb 3, 2022
(I wasn't able to find this in the docs or the Community, so feel free to point me to a reference that I missed)
How can I determine the effective User and Group that will be used when an InterSystems IRIS process is doing file I/O on the file system for UNIX? Bonus points if you can tell me how to do it from within InterSystems IRIS as well as from the host OS.
Thanks! From the OS side in AIX, I can see it in parameters.isc (example from a QA env I'm playing with)
security_settings.iris_user: irisusr
security_settings.iris_group: irisusr
security_settings.manager_user: irisusr
security_settings.manager_group: irisusr
I do not recall how to see it in IRIS itself (or if it's even possible) but I remember wanting to figure out how to change the values after installation (due to someone goofing up an entry on a dev environment) and without a lot of effort, it is pretty difficult. Thank you @Craig.Regester for the response. Looking up that file in the docs (https://docs.intersystems.com/iris20201/csp/docbook/DocBook.UI.Page.cls?KEY=GCI_unixdist) it tells me that "For security reasons, the parameters.isc file is accessible only by the root user." I am pretty sure there is a way to tell what it is currently running as without needing that level of access. But it is good to know about this in the cases where root access is an option Interesting question. I didn't see anything for this in the class reference either. I'll be following this post. ##class(%SYS.ProcessQuery).GetOSUsername() You could try:ps -ax -o uname,cmd | grep "irisdb WD" | grep -v "grep"-ax will get all the running processes including ones that aren't running on a terminal, retrieve the username, and command that started the process. We then use grep to filter out the exact process we need. Thanks @Jean.Millette and @Timothy.Leavitt for the help with this! great way to do it within InterSystems IRIS - thanks Tim! Perfect!! Exactly what I was looking for - thank you @Sarmishta.Velury (and @Jean.Millette and @Timothy.Leavitt ) If you're doing file I/O, why not %File.GetOwnerGroup()? Or is this something you need to know before you open (or create) a file? @Jeffrey.Drumm - it is important to have this run from a process that is already running in the InterSystems IRIS instance (or something spun off from the SuperServer) so that it doesn't pick up your UNIX username if you enter via console. So being able to run an API like Tim's will work nicely as I can run it via the Output window from Studio: Understood ... but I'm curious as to how IRIS is getting my environment:
w ##class(%SYSTEM.Util).GetEnviron("USER")
jdrumm
w ##class(%SYS.ProcessQuery).GetOSUsername()
irisusr
No idea, but I don't think it's tied to the IRIS name. When I am logged into Studio as bspead I see the following:
[quote]
w ##class(%SYSTEM.Util).GetEnviron("USER")rootw ##class(%SYS.ProcessQuery).GetOSUsername()cacheusr
[/quote]
Announcement
Jeff Fried · Mar 2, 2022
NOTE: we previously found an issue with the 2021.1.1.324.0 builds. The 2021.1.1 maintenance releases have been removed from the WRC and have been replaced with 2021.1.2.336.0 builds. 2021.1.2 containers will be available shortly.
Two new sets of maintenance releases are now available:
Caché 2018.1.6, Ensemble 2018.1.6, and HSAP 2018.1.6
InterSystems IRIS 2020.1.2, IRIS for Health 2020.1.2, and HealthShare Health Connect 2020.1.2
Installation kits and containers can be downloaded from the WRC Software Distribution site. Container images for the Enterprise Editions of InterSystems IRIS and IRIS for Health and all corresponding components are available from the InterSystems Container Registry.
These are maintenance releases with many updates across a wide variety of areas. For information about the corrections in these releases, refer to the documentation for that version, which includes a Release Notes and Upgrade Checklist, and a Release Changes list, as well as the Class Reference and a full set of guides, references, tutorials, and articles. All documentation can be reached via docs.intersystems.com.
Build numbers for these releases are shown in the table below:
Version
Product
Build number
2018.1.6
Caché and Ensemble
2018.1.6.717.0
2018.1.6
Caché Evaluation
2018.1.6.717.0su
2018.1.6
HealthShare Health Connect (HSAP)
2018.1.6HS.9063.0
2020.1.2
InterSystems IRIS
2020.1.2.517.0
2020.1.2
IRIS for Health
2020.1.2.517.0
2020.1.2
HealthShare Health Connect
2020.1.2.517.0
2020.1.2
IRIS Studio
2021.1.2.517.0
2021.1.2
InterSystems IRIS
2021.1.2.336.0
2021.1.2
IRIS for Health
2021.1.2.336.0
2021.1.2
HealthShare Health Connect
2021.1.2.336.0
2021.1.2
IRIS Studio
2021.1.2.336.0
Container images InterSystems IRIS and IRIS for Health and all corresponding components are available from the InterSystems Container Registry using the following commands for the 2020.1.2 release:
docker pull containers.intersystems.com/intersystems/iris:2020.1.2.517.0
docker pull containers.intersystems.com/intersystems/irishealth:2020.1.2.517.0
docker pull containers.intersystems.com/intersystems/iris-arm64:2020.1.2.517.0
docker pull containers.intersystems.com/intersystems/irishealth-arm64:2020.1.2.517.0
For a full list of the available images, please refer to the ICR documentation. Do I understand correctly that Caché Evaluation and IRIS Studio (full kit) are only available through WRC, which is not available to everyone, but only for supported customers?
It seemed to me that these products are designed for everyone.
By the way, the same goes for ODBC, JDBC and CSPGateway. @Vitaliy.Serdtsev - you could download the Community Edition of InterSystems IRIS from evaluation.InterSystems.com and just install Studio from that if you wish. Also, is there a reason you want the SingleUser version of Caché rather than the InterSystems IRIS Community Edition (which is freely available to everyone)? It's only 2 weeks ago when WRC said that 2018.1.5 will be last ever version of Cache and Ensemble!
But it's really nice to have new version, hopefully it fixes known bugs. What you heard from the WRC was in error - 2018.1.6 has been planned for over a year. It definitely fixes known bugs (otherwise why release a maintenance release? ;) ) you could download the Community Edition of InterSystems IRIS and just install Studio from that if you wish
That's exactly what I'm doing now. But agree, downloading hundreds of megabytes for the sake of Studio and drivers is inefficient.
Also, is there a reason you want the SingleUser version of Caché rather than the InterSystems IRIS Community Edition
IRIS does not interest me in this case.
Over the years I have "tormented" WRC about the bugs I found in Caché (in some way I acted as a free beta tester), until the technical support ended.
Some fixes at that time were included only in future versions of Caché , which I can no longer check. I would be interested to check out these fixes on the free version.
Maybe there are other reasons why there is still a single-user version of Caché, especially only for those who already have a full-featured version, but for me they are not obvious. Hi Vitaliy -
InterSystems IRIS has been on the market more than 3 years now and is the platform the general market is developing on. We've worked to make it easy to get InterSystems IRIS and the VS Code dev tooling, and are working to make independent components available easily as well.
By far the vast majority of users that want Caché are existing customers - so you can get this easily through the WRC. @Vitaliy.Serdtsev - you make a fair point about downloading the full Eval kit just for a few pieces of it ... unfortunately that is the only distribution mechanism that I know of currently available for non-supported customers.
Thank you for all the time you've spent over the years helping to find ways to make Caché more robust!! It sounds like you've been able to identify quite a few areas of improvement. There was significant effort put into streamlining things and solving known issues in the rebirth of Caché as InterSystems IRIS. You might find it interesting to download the Community Edition (IRIS version of the SU kit but much more powerful with fewer restrictions) and see if the bugs you reported are still present there or not. What do you think about that approach?
I got clarification that we still create an SU version of Caché which is available in the WRC because some of our large partners/APs rely on it for people to learn on (which makes sense). Obviously we won't want new prospects playing with it, which is why it is no longer publicly available and instead we provide the InterSystems IRIS Community Edition. Hi Jeffrey.
By far the vast majority of users that want Caché are existing customers - so you can get this easily through the WRC.
I have indicated why I already can't get Caché now, even the SU version:<..>, until the technical support ended.
<..> in future versions of Caché, which I can no longer check. You might find it interesting to download the Community Edition <..> and see if the bugs you reported are still present there or not. What do you think about that approach?
<..> we still create an SU version of Caché <..> because some of our large partners/APs rely on it for people to learn on <..>
I have already written that, as well as your large partners/APs who prefer to stay on Caché, IRIS does not interest me in this case.
Why would I check something that I won't be using in the foreseeable future, even if there are fixes there?
And yes, for the sake of hobby, I have been using IRIS CE for a long time.
Announcement
Anastasia Dyubaylo · Feb 23, 2022
Hey Community,
Enjoy watching the new video on InterSystems Developers YouTube channel:
⏯ Creating Virtual Models with InterSystems IRIS Adaptive Analytics
See how InterSystems IRIS Adaptive Analytics lets you quickly and easily create virtual data models, helping you make better business decisions. Adaptive Analytics includes built-in AI to improve query speed based on common requests by automatically creating data aggregates. Business users and analysts can access data using their business intelligence tool of choice.
Stay tuned!
Announcement
Anastasia Dyubaylo · Apr 15, 2022
Hey Developers,
New video is already on InterSystems Developers YouTube channel:
⏯ Creating Pivot Tables with InterSystems IRIS Business Intelligence
Learn how to use the Analyzer tool from InterSystems IRIS Business Intelligence to create pivot tables for display on a dashboard. This video shows the central components of the Analyzer tool and demonstrates how to construct a pivot table.
Enjoy and stay tuned!
Announcement
Anastasia Dyubaylo · May 3, 2022
Hey Community,
New video is already on InterSystems Developers YouTube channel:
⏯ Embed Business Intelligence into your Applications with InterSystems IRIS
Learn how InterSystems IRIS Business Intelligence works, and get an introduction to commonly used dashboards and user interfaces. InterSystems IRIS® Business Intelligence offers a complete set of tools for embedding business intelligence into your applications, making it easier to get insights into your data.
Enjoy and stay tuned!
Announcement
Evgeny Shvarov · Aug 29, 2022
Hi Developers!
Here're the technology bonuses for the InterSystems "Sustainability" Interoperability Contest 2022 that will give you extra points in the voting:
Sustainability Topic
Sustainability Dataset
Business Process BPL or Business Rule DTL Usage
Custom Interoperability Adapter
Production EXtension(PEX) Python, Java, or .NET usage
Embedded Python usage
Docker container usage
ZPM Package Deployment
Online Demo
Code Quality pass
Article on Developer Community
The second article on Developer Community
Video on YouTube
See the details below.
Sustainability Solution - 5 points
Collect the bonus of 5 points if your solution is related to solving the global challenge of Sustainability. Check the contest announcement for more details on the problem.
Sustainability Dataset - 3 points each
Get 3 bonus points per each sustainability dataset (for the first 3 datasets) submitted to Open Exchange and used in a solution. Dataset should be published as a ZPM package, check Datasets Contest for dataset publishing examples.
Business Process BPL or Business Rules Usage - 3 points
One of the key features of IRIS Interoperability Productions are business processes, which could be described by BPL (Business Process Language).
Learn more about Business Processes in the documentation.
Business Rules it's a no-code/low-code approach to manage the processing logic of the interoperability production. In InterSystems IRIS you can create a business rule which you can create visually or via the ObjectScript representation.
You can collect the Business Process/Business Rule bonus if you create and use the business process or business rule in your interoperability production.
Business Rule Example
Learn more about Business Rules in the documentation.
Custom Interoperability Adapter Usage - 2 points
InterSystems Interoperability production can contain inbound or Outbound adapters which are being used to communicate with external systems by business services and operations of the production. You can use out-of-the-box adapters (like File, or Email) or develop your own.
You get the bonus if you develop your own custom inbound or outbound adapter and use it in your production.
Example of an adapter.
Learn more on adapters.
Production EXtension (PEX) Usage - 3 points
PEX is a Python, Java, or .NET extension of Interoperability productions - see the documentation.
You get this bonus if you use PEX with JAVA or .NET in your interoperability production.
PEX Demo.
Learn more on PEX in Documentation.
Embedded Python - 3 points
Use Embedded Python in your application and collect 3 extra points. You'll need at least InterSystems IRIS 2021.2 for it.
Docker container usage - 2 points
The application gets a 'Docker container' bonus if it uses InterSystems IRIS running in a docker container. Here is the simplest template to start from.
ZPM Package deployment - 2 points
You can collect the bonus if you build and publish the ZPM(ObjectScript Package Manager) package for your Full-Stack application so it could be deployed with:
zpm "install your-multi-model-solution"
command on IRIS with ZPM client installed.
ZPM client. Documentation.
Online Demo of your project - 2 pointsCollect 3 more bonus points if you provision your project to the cloud as an online demo. You can do it on your own or you can use this template - here is an Example. Here is the video on how to use it.
Code quality pass with zero bugs - 1 point
Include the code quality Github action for code static control and make it show 0 bugs for ObjectScript.
Article on Developer Community - 2 points
Post an article on Developer Community that describes the features of your project. Collect 2 points for each article. Translations to different languages work too.
The Second article on Developer Community - 1 point
You can collect one more bonus point for the second article or the translation regarding the application. The 3rd and more will not bring more points but the attention will all be yours.
Video on YouTube - 3 points
Make the Youtube video that demonstrates your product in action and collect 3 bonus points per each. Example.
The list of bonuses is subject to change. Stay tuned!
Good luck with the competition! Sustainability Datasets bonus is introduced - 3 points for a dataset, up to 3 datasets per project.
Announcement
Olga Zavrazhnova · Sep 19, 2022
Hi Community! Are you in Dubai on October 10-13? Join us at the Global DevSlam conference for developers with 15,000 participants expected in person!📍Let's meet here: Hall 9, Stand № H9-E30🌟 We will host the event: "The hands-on workshop on InterSystems IRIS Data Platform"Speaker: @Guillaume.Rongier7183, Sales Engineer at InterSystemsOctober 10, 2pm - 3:30pm Register here ❕We have free promo passes for our Community Members, partners, and customers. Please drop me a line if you are willing to attend!
I will be there! Looking forward to meeting everyone! me too! ;) I'll be there! Thanks all, now I'm feeling pressured ;)
Announcement
Anastasia Dyubaylo · May 29, 2022
Hey Developers,
Join us as we share lessons learned from standing up the initial InterSystems cloud offerings. We'll cover the challenges of standing up a SaaS and how to meet them:
⏯ Running InterSystems IRIS Workloads in the Cloud: Lessons Learned
🗣 Presenter: @Eduard.Lebedyuk, Sales Engineer, InterSystems
Stay tuned for the latest videos on InterSystems Developer YouTube!
Announcement
Anastasia Dyubaylo · May 26, 2022
Hi Community,
We're pleased to invite you to the upcoming webinar in Spanish called "SAM: Monitoring InterSystems IRIS with Grafana and Prometheus".
Date & Time: June 15, 4:00 PM CEST
Speaker: @Pierre-Yves.Duquesnoy, Sales Engineer, InterSystems Iberia
The webinar is aimed at system administrators who want to monitor one or some InterSystems IRIS platforms and its applications at a glance. It is also aimed at DevOps who have to add application or interoperability metrics to the monitoring.
SAM (System Alerting & Monitoring) is the perfect tool to monitor InterSystems IRIS data platforms. It offers an overall picture of the systems to be monitored, and facilitates alert management in any monitored systems.
During the webinar, we'll show SAM architecture and its installation; and we'll start to monitor different InterSystems IRIS clusters. We'll also extend the existing metrics to monitor other application metrics.
➡️ Register today and enjoy!
Announcement
Riccardo Andriuzzi · May 27, 2022
MSC Mediterranean Shipping Company continues to invest and lead the world container market with ships, an extensive container fleet, intermodal and dedicated staff for its customers. The Company’s evolution to its leading brand needs consistency to market, and therefore it is paramount to standardise data, processes and management information. Established in 1998, MSC Technology provides development and technology support for the MSC transportation divisions and is composed by highly accomplished technology professionals. Today, with a team of 1000 plus, MSC Technology provides the best, most interactive maritime software solutions available in the industry. With an emphasis on equal employment opportunities and a collaborative approach to growing our expertise and solving complex problems, we are a trusted strategic partner with a great journey ahead of us.
Intersystems Developer
Under the governance of the internal program, the Intersystems developer designs, develops and helps the operations of the Event Processing solution based on the IRIS Data Platform. MSC Logistics department is the main customer of this platform. It’s applicable to computing of the equipment activities and their corresponding message streams. The main area of design and development regard data integration and validation through predefined business rules and processing to Database. Subsequent integration technologies will be required to complete the process automation. The developer will work with the global teams (India, USA, Europe), with external partners / vendors and in coordination with the in-place Community of Practices to ensure the coherence of the development with the program architecture. The developer will need to deliver several work packages with local/offshore resources. The developer will play a key role during the release process in coordination with both the development teams and the Application operational teams. The developer will need to understand a) business and application requirements, performance, upgrade and maintainability requirements, and b) existing components available on the market and within MSC, to provide his expertise in a proactive manner to the projects teams.
Key Responsibilities
Design, develop, document and maintain his/her work packages with transparency
Enforce non-functional requirements such as reliability and performances in his/her project designs
Work closely with the development teams and existing system providers to provide and design solutions
Ensure knowledge transfer with development and operation teams for the corresponding platforms
Problem isolation and resolution, with expectation that continuous improvement and enhancements are implemented
Perform and coordinate development and operation across our multi-regions environment
Work with external 3rd parties to integrate the technologies
Additional Responsibilities
Identify opportunities for integration technical components
Advise, promote, coach, coordinate the use of these tools
Actively participate in the solution identification; review, assess and prepare decisions to be taken by Program’s Management and Architecture.
The developer ensure that all Projects and Applications effectively use technical components as per the validated Technical Architecture Design
Applications performance (response time and availability) will be paramount to the success of the Program. Thus, the developer is to propose and lead the setup of a specific governance model to ensure that the right emphasis and focus is given to performance related topic.
Participate in the building of applications development standards, best practices repository, and control mechanisms.
Build technical components user guides for other IT and Program’s Teams
Contribute to the development of training material and processes documentation
Qualifications and Experience
At least 4 years’ experience with InterSystems technology (IRIS/CACHE) with experience in the following subjects: COS (cache object script) & OO (object oriented) development using classes SQL (both embedded and dynamic), class queries & SP (stored procedures)
Proven experience with Interoperability (aka Ensemble) in both design & implement solutions in a complex production, experience with use of various adaptors (e.g. SQL, REST, HTTP)
Working with XML & JSON files
Developing with a modern IDE (e.g. Visual studio code) or eclipse, with some Studio knowledge
Developing with source control (preferable Dev-Ops) with experience using GIT
Benefits? Healthcare? comp band? remote possible? Hello Fabian,
we offer a relocation package for people coming from abroad and so full-remote working is not possible. An healthcare coverage is included.
I remain at your disposal for any details
Best regards,
Riccardo
Riccardo Andriuzzi
riccardo.andriuzzi@msc.com
Article
Lucas Enard · Aug 17, 2022
[In this GitHub](https://github.com/grongierisc/iris-python-flask-api-template) based on [this InterSystems community rest api template](https://github.com/intersystems-community/iris-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.
- [1. intersystems-iris-docker-rest-template](#1-intersystems-iris-docker-rest-template)
- [2. Prerequisites](#2-prerequisites)
- [3. Installation](#3-installation)
- [3.1. Installation for development](#31-installation-for-development)
- [3.2. Management Portal and VSCode](#32-management-portal-and-vscode)
- [3.3. Having the folder open inside the container](#33-having-the-folder-open-inside-the-container)
- [4. How it works](#4-how-it-works)
- [5. How to Work With it](#5-how-to-work-with-it)
- [5.1. POST request](#51-post-request)
- [5.1.1. Testing POST request](#511-testing-post-request)
- [5.1.2. How POST request works](#512-how-post-request-works)
- [5.2. GET requests](#52-get-requests)
- [5.2.1. Testing GET request](#521-testing-get-request)
- [5.2.2. How GET request works](#522-how-get-request-works)
- [5.3. PUT request](#53-put-request)
- [5.3.1. Testing PUT request](#531-testing-put-request)
- [5.3.2. How PUT request works](#532-how-put-request-works)
- [5.4. DELETE request](#54-delete-request)
- [5.4.1. Testing DELETE request](#541-testing-delete-request)
- [5.4.2. How DELETE request works](#542-how-delete-request-works)
- [6. How to start coding](#6-how-to-start-coding)
- [7. What's inside the repo](#7-whats-inside-the-repo)
- [7.1. Dockerfile](#71-dockerfile)
- [7.2. .vscode/settings.json](#72-vscodesettingsjson)
- [7.3. .vscode/launch.json](#73-vscodelaunchjson)
# 2. Prerequisites
Make sure you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker desktop](https://www.docker.com/products/docker-desktop) installed.
It is to be noted that the table Sample.Person was already created in advance for the demo using in the management portal in the sql tab:
```sql
CREATE TABLE Sample.Person (
Company VARCHAR(50),
DOB DATE,
Name VARCHAR(4096),
Phone VARCHAR(4096),
Title VARCHAR(50)
)
```
# 3. Installation
## 3.1. Installation for development
Clone/git pull the repo into any local directory e.g. like it is shown below:
```
$ git clone https://github.com/grongierisc/iris-python-flask-api-template.git
```
Open the terminal in this directory and run:
```
$ DOCKER_BUILDKIT=1 docker-compose up -d --build
```
## 3.2. Management Portal and VSCode
This repository is ready for [VS Code](https://code.visualstudio.com/).
Open the locally-cloned `formation-template-python` folder in VS Code.
If prompted (bottom right corner), install the recommended extensions.
## 3.3. Having the folder open inside the container
**It is really important** to be *inside* the container before coding.
For this, docker must be on before opening VSCode.
Then, inside VSCode, when prompted (in the right bottom corner), reopen the folder inside the container so you will be able to use the python components within it.
The first time you do this it may take several minutes while the container is readied.
[More information here](https://code.visualstudio.com/docs/remote/containers)

By opening the folder remote you enable VS Code and any terminals you open within it to use the python components within the container. Configure these to use `/usr/irissys/bin/irispython`
# 4. How it works
The `app.py`, once launched (inside the container) will gather CRUD request.
Depending on the type of the request, the right message will be created to send to the `FlaskService`, this service will call the CrudPerson operation that will, depending on the type of the message send from the service to it, dispatch the information needed to do the action requested.
For more details you can check the `How it works` part of [this fully documented demo](https://github.com/grongierisc/interoperability-embedded-python).
# 5. How to Work With it
This template creates /crud REST web-application on IRIS which implements 4 types of communication: GET, POST, PUT and DELETE aka CRUD operations.
These interface works with a sample persistent class `Person` found in `src/python/person/obj.py`.
First of all, it is needed to start the 'app.py' situated in `src/python/person/app.py` using flask.
To do this, go in the `app.py` file, then to the `run and debug` window in VSCode and select `Python: Flask` then run.
This will run the app.
## 5.1. POST request
### 5.1.1. Testing POST request
Create a POST request, for example in Postman or in RESTer for mozilla, with raw data in JSON like:
```json
{"name":"Elon Musk","title":"CEO","company":"Tesla","phone":"123-123-1233","dob":"1982-01-19"}
```
Using `Content-Type` as `application/json`
Adjust the authorisation if needed - it is basic for container with default login and password for IRIS Community edition container.
Send the POST request to `localhost:5000/persons/`
This will create a record in the table Sample.Person of IRIS and return the `id` of the newly added `Person`
 of the POST request to add `Elon Musk` to the table.
### 5.1.2. How POST request works
```python
def create_person(self,request:CreatePersonRequest):
"""
> Create a new person in the database and return the new person's ID
:param request: The request object that was passed in from the client
:type request: CreatePersonRequest
:return: The ID of the newly created person.
"""
# sqlInsert = 'insert into Sample.Person values (?,?,?,?,?)'
# iris.sql.exec(sqlInsert,request.person.company,dob,request.person.name,request.person.phone,request.person.title)
# IRIS ORM
person = iris.cls('Sample.Person')._New()
if (v:=request.person.company) is not None: person.Company = v
if (v:=request.person.name) is not None: person.Name = v
if (v:=request.person.phone) is not None: person.Phone = v
if (v:=request.person.title) is not None: person.Title = v
if (v:=request.person.dob) is not None: person.DOB = v
Utils.raise_on_error(person._Save())
return CreatePersonResponse(person._Id())
```
Using IRIS ORM we can create a new `Person` and save into our database.
## 5.2. GET requests
### 5.2.1. Testing GET request
To test GET you need to have some data. You can create it with a [POST request](#41-testing-post-request).
This REST API exposes two GET requests: all the data and one record.
To get all the data in JSON call:
```
localhost:5000/persons/all
```
To request the data for a particular record provide the id in GET request like 'localhost:5000/persons/id', here is an example:
```
localhost:5000/persons/1
```
This will return JSON data for the person with ID=1, something like that:
```json
{"name":"Elon Musk","title":"CEO","company":"Tesla","phone":"123-123-1233","dob":"1982-01-19"}
```
### 5.2.2. How GET request works
```python
def get_person(self,request:GetPersonRequest):
"""
> The function takes a `GetPersonRequest` object, executes a SQL query, and returns a
`GetPersonResponse` object
:param request: The request object that is passed in
:type request: GetPersonRequest
:return: A GetPersonResponse object
"""
sql_select = """
SELECT
Company, DOB, Name, Phone, Title
FROM Sample.Person
where ID = ?
"""
rs = iris.sql.exec(sql_select,request.id)
response = GetPersonResponse()
for person in rs:
response.person= Person(company=person[0],dob=person[1],name=person[2],phone=person[3],title=person[4])
return response
def get_all_person(self,request:GetAllPersonRequest):
"""
> This function returns a list of all the people in the Person table
:param request: The request object that is passed to the service
:type request: GetAllPersonRequest
:return: A list of Person objects
"""
sql_select = """
SELECT
Company, DOB, Name, Phone, Title
FROM Sample.Person
"""
rs = iris.sql.exec(sql_select)
response = GetAllPersonResponse()
response.persons = list()
for person in rs:
response.persons.append(Person(company=person[0],dob=person[1],name=person[2],phone=person[3],title=person[4]))
return response
```
This time, using the `iris python` `sql.exec` function, we can directly run SQL code inside the IRIS database, gather the information needed and send it back to the API and to the user.
## 5.3. PUT request
### 5.3.1. Testing PUT request
PUT request could be used to update the records. This needs to send the similar JSON as in POST request above supplying the id of the updated record in URL.
For example we want to change the record with id=5. Prepare the JSON in raw like following:
```
{"name":"Jeff Besos","title":"CEO","company":"Amazon","phone":"123-123-1233","dob":"1982-01-19"}
```
and send the put request to:
```
localhost:5000/persons/5
```
### 5.3.2. How PUT request works
```python
def update_person(self,request:UpdatePersonRequest):
"""
> Update a person in the database
:param request: The request object that will be passed to the service
:type request: UpdatePersonRequest
:return: UpdatePersonResponse()
"""
# IRIS ORM
if iris.cls('Sample.Person')._ExistsId(request.id):
person = iris.cls('Sample.Person')._OpenId(request.id)
if (v:=request.person.company) is not None: person.Company = v
if (v:=request.person.name) is not None: person.Name = v
if (v:=request.person.phone) is not None: person.Phone = v
if (v:=request.person.title) is not None: person.Title = v
if (v:=request.person.dob) is not None: person.DOB = v
Utils.raise_on_error(person._Save())
return UpdatePersonResponse()
```
Using IRIS ORM we can check if the id leads to a `Person`, if it does, we can update it using our new information and save it into our database.
## 5.4. DELETE request
### 5.4.1. Testing DELETE request
For delete request this REST API expects only the id of the record to delete. E.g. if the id=5 the following DELETE call will delete the record:
```
localhost:5000/persons/5
```
### 5.4.2. How DELETE request works
```python
def delete_person(self,request:DeletePersonRequest):
"""
> Delete a person from the database
:param request: The request object that is passed to the service
:type request: DeletePersonRequest
:return: The response is being returned.
"""
sql_select = """
DELETE FROM Sample.Person as Pers
WHERE Pers.id = ?
"""
rs = iris.sql.exec(sql_select,request.id)
response = DeletePersonResponse()
return response
```
This time, using the `iris python` `sql.exec` function, we can directly run SQL code inside the IRIS database and delete the person.
# 6. How to start coding
This repository is ready to code in VSCode with InterSystems plugins.
Open `/src/python/person/app.py` to change anything on the api.
Open `/src/python/person/bo.py` to be able to change things related to the internal requests, this is where you can use SQL - it will be compiled in running IRIS docker container.
# 7. What's inside the repo
## 7.1. Dockerfile
The simplest dockerfile to start IRIS.
Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
## 7.2. .vscode/settings.json
Settings file to let you immedietly code in VSCode with [VSCode ObjectScript plugin](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript))
## 7.3. .vscode/launch.json
Config file if you want to debug with VSCode ObjectScript
If you are interested, check out the formation I made on the tools I used in this GitHub :
https://github.com/LucasEnard/formation-template-python As Issues are disabled in the GitHub Repo I place my issue here.
Container starts fine
Postman fails:POST http://localhost:5000/persons/
Error: connect ECONNREFUSED 127.0.0.1:5000
Network
agent: "Desktop Agent"
Request Headers
Content-Type: application/json
User-Agent: PostmanRuntime/7.29.2
Accept: */*
Cache-Control: no-cache
Postman-Token: d40ec7c2-5b24-4944-8a76-c4cbf2685bf7
Host: localhost:5000
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Request Body
{"name":"Elon Musk","title":"CEO","company":"Tesla","phone":"123-123-1233","dob":"1982-01-19"}
as port 5000 is not mapped in docker-compose.yml this might be related ???
DONE!I found my solution and placed it in a PullRequest.it was slightly more than just a missing port. Thanks Robert for the PullRequest and making sure of the quality of the demos/articles.
Sometimes it's hard do build and test at the same time, this is why in medium to large projects the development teams are different from the testers.
Thanks again :) You're welcome. Those things keep my mind in speed. I failed in testing.where can I find the pull request and how to use it? my PR contains an update on docker-compose.ymland a bash script startflask.shall available here https://github.com/rcemper/iris-python-flask-api-template
Sep.23 all merged I'm getting 403 when I do a Post request on localhost:5000/persons/. What am I doing wrong? Yes, the flask app run on 8080 and map on docker compose to 4040.
I update the github to make flask run on 5000 and map to 5000. @Guillaume.Rongier7183 , just curious, why do you need CallIn service enabled?
Still have Forbidden after update and rebuild:
Because underneath embedded python is using CallIn Service of IRIS.
And by default this service is off. So, every time I need to use embedded python with IRIS I need to turn CallIn on?
Announcement
Anastasia Dyubaylo · Nov 2, 2022
Hi Community,
In this video, you will learn about exciting new ways to perform analytics using data in your HL7® FHIR® repository:
⏯ InterSystems IRIS FHIR SQL Builder: Sneak Peek @ Global Summit 2022
🗣 Presenter: @Patrick.Jamieson3621, Product Manager, InterSystems
Subscribe to InterSystems Developers YouTube to get updates about new videos!
Announcement
Anastasia Dyubaylo · Aug 25, 2022
Hey Community!
We've always had this idea on the back burner about improving the process of collecting, analyzing, and responding to product enhancement requests from our members. We knew we needed a good user experience and even better internal processes to make sure the best ideas were gathered, heard, and responded to. And finally, this thought has come to fruition!
So in case you missed it, let me introduce to you the Official InterSystems feedback portal:
💡 >> InterSystems Ideas << 💡
InterSystems Ideas is a new and improved method for you to submit product enhancement requests and ideas related to our services (Documentation, Dev Community, Global Masters, etc.), see what others have submitted, vote on your favorite ones, and get feedback from InterSystems.
We are starting active development and promotion of both the Ideas portal and your ideas. We wish for you to have a public way to get feedback from our product managers and members of the Community.
✅ The ideas with the most votes will be sent to the Product Management Department for review.
Share your ideas with the community, and contribute by voting and commenting on other ideas – the more votes the more influence!
See you on the InterSystems Ideas portal!