Another good way is to set the header :

Prefer: return=representation

The payload will be sent you back with the id.

Example :

POST http://localhost:33783/fhir/r4/Patient HTTP/1.1
Content-Type: application/json+fhir
Accept: application/json+fhir
Prefer: return=representation

{
  "resourceType": "Patient",
  "active": true,
  "name": [
    {
      "use": "official",
      "family": "Donald",
      "given": [
        "Duck"
      ]
    }
  ]
}

Response :

HTTP/1.1 201 Created
Date: Wed, 29 Mar 2023 12:13:40 GMT
Server: Apache
CACHE-CONTROL: no-cache
ETAG: W/"1"
EXPIRES: Thu, 29 Oct 1998 17:04:19 GMT
LAST-MODIFIED: Wed, 29 Mar 2023 12:13:40 GMT
LOCATION: http://localhost:33783/fhir/r4/Patient/2011/_history/1
PRAGMA: no-cache
CONTENT-LENGTH: 177
Connection: close
Content-Type: application/fhir+json; charset=UTF-8

{
  "resourceType": "Patient",
  "active": true,
  "name": [
    {
      "use": "official",
      "family": "Donald",
      "given": [
        "Duck"
      ]
    }
  ],
  "id": "2011",
  "meta": {
    "lastUpdated": "2023-03-29T12:13:40Z",
    "versionId": "1"
  }
}
nc -z -v localhost 1972

Use netcat, it will tell you if the port is open, if not then it's may be because superserver is not ready

Hi Joe,

The 2 dots syntax is used to access the properties and methods of the current object.
You can also use $this to access the current object.

For example, if you have a class called "MyClass" and you have a property called "MyProperty" in that class, you can access the property value by using the following syntax:

User.MyClass Extends EnsLib.BusinessService
{
    Property MyProperty;

    Method MyMethod()
    {
        set ..MyProperty = 10;
        set $this.MyProperty = 10;
    }
}

In your case, you can use the following syntax to access the methods of the EnsLib.File.InboundAdapter class:

User.MyClass Extends EnsLib.BusinessService
{
    Parameter ADAPTER = "EnsLib.File.InboundAdapter";
    Property Adapter = "EnsLib.File.InboundAdapter";

    Method MyMethod()
    {
        do ..Adapter.AdapterMethod()
        do $this.Adapter.AdapterMethod()
    }
}

Hope this helps.

Hi,

You need to fill in some environment variables that allow you to authenticate yourself and therefore connect.

The variables are :

IRISUSERNAME
IRISPASSWORD
IRISNAMESPACE

In a docker file for example :

# environment variables for embedded python
ENV IRISUSERNAME "SuperUser"
ENV IRISPASSWORD "SYS"
ENV IRISNAMESPACE "IRISAPP"

In a shell :

export IRISUSERNAME=SuperUser
export IRISPASSWORD=SYS
export IRISNAMESPACE=IRISAPP

query is the way to go :

import iris

g = iris.gref("^MyGlobal")

# Insert some data
g[1] = "my first line"
g[2] = "my second line"
g[1,"a"] = "my first line with a key"
g[1,"b"] = "my first line with a key"
g[2,"a"] = "my second line with a key"
g[2,"b"] = "my second line with a key"
g[3,"a",1] = "my third line with a key and a subkey"

for (key, value) in g.query():
    print(f"{key} -> {value}")

result :

['1'] -> my first line
['1', 'a'] -> my first line with a key
['1', 'b'] -> my first line with a key
['2'] -> my second line
['2', 'a'] -> my second line with a key
['2', 'b'] -> my second line with a key
['3'] -> None
['3', 'a'] -> None
['3', 'a', '1'] -> my third line with a key and a subkey

I have partially found a solution:

First I create an SQL function with python code :

CREATE FUNCTION sqliknowparser(tText VARCHAR(50000))
    RETURNS VARCHAR(50000)
    LANGUAGE PYTHON
{
    import iknowpy

    engine = iknowpy.iKnowEngine()

    # index some text
    text = tText
    engine.index(text, 'en')

    t_output = ""

    # or make it a little nicer
    for s in engine.m_index['sentences']:
        for e in s['entities']:
            if e['type'] == 'Concept':
                t_output = t_output  + e['index']+ "|"

    return t_output[:-1]
}

Then I use this function in my query :

SELECT 
ID, sqliknowparser(Text) as entities
FROM AA.Goal 

Then I "piece" it an use a union query :

SELECT 
ID, $piece(sqliknowparser(Text),'|',1) as entities
FROM AA.Goal 
union
SELECT 
ID, $piece(sqliknowparser(Text),'|',2) as entities
FROM AA.Goal 

Any improvement are welcome :)

Hi, BTW, starting with IRIS 2021.1+ you can enable the interoperability metrics with those command lines :

// Enable Intero metrics for SAM
zw ##class(Ens.Util.Statistics).EnableSAMForNamespace()
zw ##class(Ens.Util.Statistics).EnableSAMIncludeHostLabel()

Since the launch of IRIS, ENSDEMO namespace is gone.

Now to have demo or anything else you have to go with ZPM : https://community.intersystems.com/post/install-zpm-one-line (the package manager).

Check the list here :

https://openexchange.intersystems.com/

If you still want EnsDemo check those githubs :