New post

Find

Question
· Mar 14, 2023

Creating Http Responses

Hello,

I want to generate and return an http response based on the input of a http GET request. For my first steps I used an EnsLib.Http.GenericService, which uses an EnsLib.HTTP.InboundAdapter to receive requests like http://[my server]:[my-port]/some-path?ID=12345678.

On the inbound side I receive a EnsLib.HTTP.GenericMessage Object which contains the parameters and some other useful information that I can work with. What I would like to do now is to create a simple HTML page, which contains some Information specific for the given parameter values. All my different attempts to return something, which can be parsed by a browser (or at least shown as a http response in postman) failed up to now.

I think this task is normally done by a webapp, but using an interoperability production makes other things a lot easier for me.

Could anyone provide a snippet how to create a valid Response object inside the OnRequest method of an Ens.BusinessProcess to make me understand the priciple? The target is to receive the request from any web browser and return a page, which then is shown inside of the browser as the result of the request.

Thanks and regards,

Martin

5 Comments
Discussion (5)1
Log in or sign up to continue
Article
· Mar 12, 2023 1m read

Create FHIR REST Client

Add a credential to login the FHIR REST interface - in this case only consider a basic authentication

 

 

Add Service Registry  - in this case only consider a basic authentication

- setup a HTTP service

- input the Path to the FHIR Server

- input the URL to the FHIR service

- use the credential profiled
 

 

Add a "HS.FHIRServer.Interop.HTTPOperation"

Choose the Service Name

 

Test the FHIR Client

 

Trace the test result

6 Comments
Discussion (6)4
Log in or sign up to continue
Article
· Mar 8, 2023 5m read

Keep your docker iris images in shape ;)

iris-docker-multi-stage-script

A python script to keep your docker iris images in shape ;)

Witout changing your dockerfile or your code you can reduce the size of your image by 50% or more !

TL;DR

Name the builder image builder and the final image final and add this to end of your Dockerfile:

Modify your Dockerfile to use a multi-stage build:

ARG IMAGE=intersystemsdc/irishealth-community:latest
FROM $IMAGE as builder

Add this to end of your Dockerfile:

FROM $IMAGE as final

ADD --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} https://github.com/grongierisc/iris-docker-multi-stage-script/releases/latest/download/copy-data.py /irisdev/app/copy-data.py

RUN --mount=type=bind,source=/,target=/builder/root,from=builder \
    cp -f /builder/root/usr/irissys/iris.cpf /usr/irissys/iris.cpf && \
    python3 /irisdev/app/copy-data.py -c /usr/irissys/iris.cpf -d /builder/root/ 

Boom! You're done!

11 Comments
Discussion (11)4
Log in or sign up to continue
Announcement
· Mar 7, 2023

InterSystems au Hacking Health Camp 2023 !

Salut la Communauté !

Je suis exaltée à vous annoncer qu'InterSystems va prendre part dans le Hacking Health Camp 2023 - la 10ème édition, le plus grand hackathon santé au monde !

Hacking Health Camp est un événement d’innovation en santé numérique qui permet de transformer les idées pour répondre aux problématiques du quotidien en prototypes fonctionnels en 3 jours.

📅 Dates: vendredi 24 mars à partir de 13h jusqu’au dimanche 26 mars vers 18h

📌 Lieu : Faculté de médecine de Strasbourg (4 rue kirschleger, 67000 Strasbourg)

Un programme de 3 jours avec :

  • Conférences inspirantes sur le futur de la santé.
  • Formations et interviews : en format de 25 minutes, dans les domaines : technologique, juridique, médical, design, … 
  • Hackathon : permet de transformer les idées innovantes en prototypes fonctionnels en 50h

Le programme du Hackathon :

VENDREDI

18:00 - LANCEMENT DU HACKATHON

18:40 - PRÉSENTATION DES COACHS

18:45 - PITCHS DES PROJETS : 1min pour présenter votre projet !

19:30 - CONSTITUTION DES ÉQUIPES : Assistance en direct aux porteurs de projets pour lancer les appels à compétences et constituer les équipes. 

20:00 - DINER

21:00 - DÉMARRAGE DES PROJETS

SAMEDI

9:00 – 12:00 - RENCONTRE AVEC LES COACHS : Séance de travail en groupe avec les coachs

10:00 – 11:40 - TRAVAIL EN ÉQUIPE

11:40 – 13:40 - DÉJEUNER

13:40 – 16:30 - TRAVAIL EN ÉQUIPE, INTERVIEWS LIVE

16:10 – 16:20 - PAUSE GOÛTER

16:20 – 20:00 - TRAVAIL EN ÉQUIPE

20:00 - DINER 

21:00 … - NUIT DE CODE 

DIMANCHE

9:00 – 12:00 - TRAVAIL EN ÉQUIPE, DEMO CLINICS : Séances d’entrainement au pitch avec les coachs

12:00 – 13:45 - DÉJEUNER

14:00 – 17:00 - PRÉSENTATION DES PROTOTYPES : 3′ de démo + 2′ de questions réponses

17:00 – 18:00 - DÉLIBÉRATION DU JURY

18:00 - REMISE DES PRIX, CLOTURE

 
Un petit goût pour vous :

✅ Inscrivez-vous ici 

On espère de vous y voir pour cette folie créative de 50 heures pour inventer la santé de demain ! Restez à l'écoute pour plus d'infos.

A bientôt !

------------------------------------------

NB. On a 10 billets gratuits à offrir aux équipes de participants qui envisagent de réaliser des projets basés sur les technologies InterSystems ! Répondez simplement dans les commentaires ou envoyez-moi un message.

4 Comments
Discussion (4)4
Log in or sign up to continue
Article
· Mar 2, 2023 4m read

Tutorial - Streams in Pieces

This tutorial is a follow on to Working with %Query    
It was displaying the content of the input stream chopped in fixed-size chunks.
But often those streams are structured and have well-defined separators (e.g HL7)
So as a side subject of this tutorial, this chapter shows how to break a stream into PIECES.

It is exactly the same idea as the $PIECE() function for strings with some add-ons.


The query takes these input parameters:

  • idfrom = first ID to show
  • idto = last ID to show - missing shos al higher IDs available
  • maxtxt = maximum size of output text from the stream. Default = 25
  • separator = characters as know from $Piece function 
  • startpiece = first piece to display
  • endpiece = last piece to display - if missing only the first is displayed
  • grouped = number of pieces in output text.  limited by maxtxt - default = 1
  • before = number of characters before the limiter from the previous piece

Implementation

The base for the Query was shown in the previous chapters.
Again the Source Object is kept local while processing the related Stream.
And as for the fixed-sized chunks also the Stream Object is kept while
processing the resulting output lines.

To find the pieces and count them method FindAt() scans the whole Stream
as a first action and builds a list of start points. It is used when the pieces
are collected into their groups by line.
The Streàm-Function used is ReadSQL(start, end). It is somewhat sensitive
and honors unprecise values with no result or ERROR. So besides locating all
pieces correctly composing precise and meaningful limits is the major challenge
for this part of the exercise.
It is all packaged in the method Piece() of the example code 

To enable multiple reentrances in the Fetch method all parameters are kept in
the common JSON object of the customized Query.

Here are some examples

  • Record #3 was deleted
  • Record#4 has no stream
  • PieceCnt shows the total pieces in the first row and number of pieces following
  • PieceId shows the number of the first Piece displayed

Some variations to the previous Tutorials:

  • the common variable qHandle that hat holds all requirements changed its name to qj to demonstrate independence from docu and for less typing.
  • the layout of the output in ROWSPEC is changed to also show the number of the starting piece, the total number of pieces in the first row, and the number of pieces in the following rows.

The first example shows objects 1..5 with max 33 chars
separated by || pieces 2..4  grouped by 2  with 3 previous characters

 

[SQL]USER>>call rcc.Q3(1,5,33,'||',2,4,2,3)
7.     call rcc.Q3(1,5,33,'||',2,4,2,3)

Dumping result #1
ID      City    Name    Age     pcCnt   PieceId PieceTxt
1       Bensonh Kovalev 16      52      2       ty.||Scope ||An AmAn LoIcA On
_       _       _       _       2       4        On||Iso
2       Queensb Yeats   15      52      2       00.||LoI||IesMorphSy
_       _       _       _       2       4       hSy||Re Uni
4       Newton  Evans   61      0       2
5       Hialeah Zemaiti 47      52      2       ks.||TwoToLy Wa||LoGraphIc Theti
_       _       _       _       2       4       eti||Ism LoToTri AticViaOpOp
 
7 Rows(s) Affected
statement prepare time(s)/globals/lines/disk: 0.0064s/2159/18029/0ms
          execute time(s)/globals/lines/disk: 0.0060s/186/21480/0ms
                          cached query class: %sqlcq.USER.cls86
---------------------------------------------------------------------------

Next example:
All records from 5 to end, maximum 33 characters, separated with || pieces 50 ..55 and 1 by line

USER>>call rcc.Q3(5,,33,'||',50,55,1)
9.     call rcc.Q3(5,,33,'||',50,55,1)

Dumping result #1
ID      City    Name    Age     pcCnt   PieceId PieceTxt
5       Hialeah Zemaiti 47      52      50      ||LoOp Am TriAmGeo LookMuch ReAble
_       _       _       _       1       51      ||AnIAn I GeoIc Ly Copter A IcA
_       _       _       _       1       52      ||***Done***
6       Elmhurs Jenkins 29      52      50      ||Re PhotoTech Ies
_       _       _       _       1       51      ||A
_       _       _       _       1       52      ||***Done***
7       Islip   Drabek  61      52      50      ||Thetic Status Cycle AmAm To Tech
_       _       _       _       1       51      ||Ly SoundCo CoCo AmCo Am ToRePus
_       _       _       _       1       52      ||***Done***
8       Islip   Kovalev 88      52      50      ||IcGeoType PhysicalLyIsm Ies To T
_       _       _       _       1       51      ||ComI An GeoRange On AnOnTo Two P
_       _       _       _       1       52      ||***Done***
 
12 Rows(s) Affected
statement prepare time(s)/globals/lines/disk: 0.0065s/2158/18091/0ms
          execute time(s)/globals/lines/disk: 0.0082s/245/28753/0ms
                          cached query class: %sqlcq.USER.cls103
---------------------------------------------------------------------------

Just a reminder:
All test data are generated using the System method %Populate
So your output will be different. I suggest you run our tests also with other parameters
than the shown examples to get the full power of this tool.

The full code example is again available on GitHub  

The Video is available now. See section Streams in Pieces 

For immediate access, you can use Demo Server WebTerminal  
and the related system Management Portal on Demo Server SMP

I hope you liked it so far and I can count on your votes.

1 Comment
Discussion (1)1
Log in or sign up to continue