Find

Question
· Mar 2, 2023

How Does InterSystems FHIR profile validation works?

Hi folks!

Examining FHIR profile validation with InterSystems FHIR server. FHIR profiles is a very useful feature of FHIR standard that helps an organization or solution to establish constraints to a very disperse FHIR standards that are relevant to a particular business solution. Learn more on FHIR profiles.

I created a very simple FHIR profile with the following JSON:

 
Spoiler

As you can see in "differential" section it makes mandatory fields of id, name and gender.

I managed to successfully submit the profile via the POST request to:

localhost:52773/fhir/r4/StructureDefinition

Then I submitted the following test Patient profile, where I omitted the "id" field and included the FHIR profile link in the meta section to:

localhost:52773/fhir/r4/Patient

 

{

"resourceType": "Patient",

"meta": {

"profile": [

"http://example.org/fhir/StructureDefinition/TutorialPatient"
]

},

"text": {

"div": "‹div xmlns=\"http://ww.w3.org/1999/xhtml\"><h1>Elon Musk</hi>/div>",

"status": "generated"
},

"name": [

{

"use": "official",

"given": [

"Elon"
],

"family": "Ramesh"
}

],

"gender": "male",

"birthDate": "1997-09-08",

"telecom": [

{

"value": "9876543210",

"use": "mobile",

"system": "phone"
},

{

"system": "email",

"value": "elon.musk@gmai.com"
}

]

}

And instead of the expected error I'm getting the successfully created patient.

What am i doing wrong? How are the FHIR validation profiles supposed to be used in InterSystems FHIR server?

9 Comments
Discussion (9)2
Log in or sign up to continue
Article
· Feb 28, 2023 2m read

Break the limits of your server

Hi developers!

You are experts in IRIS and know all tricks. The functionality of $ZF(-1,-2,-100, ......)
is nothing new to you And you know the limits of this functionality.
Both give you access to your local server command line environment. And that's it.

And this is sufficient in most cases.
BUT:
When you run IRIS in a Docker container you are locked into it and isolated.
That's the basic concept of containers. You can access IRIS from outside and
collect data. But nothing goes outside without any external request. Well educated!
That means that your $ZF(..) and also CPIPE is useless in this setup. Enough moaning! You have understood the problem. You are imprisoned!
I have thought about the problem of how to escape from this jail.
And it would be attractive to get the same or better functionality.  How better?
Out of IRIS/Caché you can't get more privileges in your operating system than your
instance or the terminal you run. It's an awkward limitation. Especially in a container.

My solution looks like this:
(Through Hollywood movies I learned you need help from outside to escape wink )
I need to start a slave program in the environment where I want to run my commands.
Not a CHILD process as it should follow exactly my orders. And nothing else!
It became a slave that is not only useful with Docker containers but more generally for
any situation where I don't just talk to my local host, but to any other listening system.

Technical design:
I have created two slave programs (in Python and C++) that listen to a fixed TCP port.
And a commander in COS that transmits his orders. As I talk over TCP my slaves can be 
located anywhere on the net as far as firewalls allow it. In addition, I can provide my
slaves exactly with the appropriate privileges for the target environment independent
of my instance of IRISI/Caché. This was an unplanned but welcome side effect.

You find the code of the slaves and the commander with examples for Linux and
Windows and additional information on how to use and install it on  GitHub.

Orginal in Spanish “Rompe los límites del servidor

1 Comment
Discussion (1)2
Log in or sign up to continue
Question
· Feb 24, 2023

IHE Inbound CCD Result Categorisation Customisation

Hi,

I'm currently working on an IHE implementation, and we've hit some issues around categorising inbound CCD results (i.e. mapping lab and rad results to their relevant SDA types).

I know that this is handled by the \CSP\xslt\SDA3\CDA-Support-Files\Import\Section-Modules\DiagnosticResults.xsl out of the box which can be overridden to use different logic, but I was wondering whether there's a standard/best practice approach for handling different sets of logic depending on the supplier of the CCD? We're going to be onboarding multiple data sources, so we're likely going to end up with lists of thousands of procedure codes, each mapped to a different specialty (e.g. Rad, Cell Path, Micro etc.), so I just wanted to get some thoughts on whether there's a common approach to make this as reusable (and painless) as possible.

This may end up being more of an XSLT-related question as I assume it'll likely involve referencing an external list of values from within a particular stylesheet, or is there maybe a way to call out to some objectscript to use a LUT?

Any advice or ideas would be great.

Thanks!

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

Export to JSON - relationships and inheritance

Why I've decided to write this

Once again I had a challenge that costed me some time and a lot of testing to reach the best solution. And now that I've managed to solve it, I'd like to share a little bit of my knowledge.
 

What happened?

In a namespace there were a lot of similar classes, so to make them simpler there were a superclass with comon properties. Also, there are relationships between them. I had to export one of them to JSON, but I couldn't change the superclasses, or I would break down the flow of many other integrations.

What made it all difficult was the problem that my JSON couldn't have the properties of the superclass. Ouch! I could export and take them off one by one, but.. what if someone changes the superclass?

And even worse... what happens with the relationships? If we export a relationship, we export another whole object, with all of its properties, but I couldn't have them either in the JSON.

 

A light in the end of the tunnel

Luckily, there is always a light in the end of the tunnel, and my light is the XData.

The solution is very simple: lets call the class that I had to export ClassToExport, the class with the relationship RelatedClass and the superclass SuperClass.

We'll have:

Class project.SuperClass Extends %Persistent {
    Property CommonProperty As %String;
}
Class project.ClassToExport Extends project.SuperClass {
    Property PropertyToExport As %String;
    Relationship RelationshipToExport As project.RelatedClass [ Cardinality = many, Inverse = RelatedProperty ];
}
Class project.RelatedClass Extends project.SuperClass {
    Property DontExportThis As %String;
    Property ExportThis As %String;
    Relationship RelatedProperty As project.ClassToExport [ Cardinality = one, Inverse = RelationshipToExport ];
}

 

In ClassToExport, I write the XData: there must be a name and a tag <Mapping> with the tags <Property>. The tag <Mapping> carries the xml namespace, xmlns="http://intersystems.com/jsonmapping", and the tags <Property> carry the properties described in %JSON.MappingProperty¹ (of the official documentation).

 

The magic trick is that everything that is not specified in the mapping will be ignored. So, if we change ClassToExport to:

Class project.ClassToExport Extends project.SuperClass {
    Property PropertyToExport As %String;
    Relationship RelationshipToExport As project.RelatedClass [ Cardinality = many, Inverse = RelatedProperty ];
    XData MappingJSON {
        <Mapping xmlns = "http://intersystems.com/jsonmapping">
            <Property Name = "PropertyToExport" FieldName = "Property-JSON"/>
            <Property Name = "RelationshipToExport" FieldName = "RelatedClassJSON"/>
        </Mapping>
    }
}

we'll have in the JSON something like:

{
   "Property-JSON":"value",
   "RelatedClassJSON": [
      {"CommonProperty":"value", "DontExportThis":"value", "ExportThis":"value"},
      {"CommonProperty":"value", "DontExportThis":"value", "ExportThis":"value"}
   ]
}

So the names of the ClassToExport are ready, and only the properties we want are in the JSON, but the RelatedClass still has work to do.

 

Then, we change RelatedClass with an XData with the same name to arrange their properties:

Class project.RelatedClass Extends project.SuperClass {
    Property DontExportThis As %String;
    Property ExportThis As %String;
    Relationship RelatedProperty As project.ClassToExport [ Cardinality = one, Inverse = RelationshipToExport ];
    XData MappingJSON
    {
        <Mapping xmlns = "http://intersystems.com/jsonmapping">
            <Property Name = "DontExportThis" Include="None"/>
            <Property Name = "ExportThis" Include="INOUT"/>
            <Property Name = "CommonProperty" Include="INOUT"/>
        </Mapping>
    }
    
    
}

 

so we'll have in the JSON somehting like:

{
   "Property-JSON":"value",
   "RelatedClassJSON": [
      {"CommonProperty":"value", "ExportThis":"value"},
      {"CommonProperty":"value", "ExportThis":"value"}
   ]
}

which is what we want.

It is interesting to observe that for the property "DontExportThis", I specified a tag with INclude="None". This is the same of not putting any ta at all for that property.

 

¹ read also %JSON.PropertyParameters to understant what each property does.
 

Thank you for reading and I hope the article was useful!

Feel free to ask me for doubts or to get in touch if you think I can help in some specific case. I'll be happy to help!

Discussion (0)1
Log in or sign up to continue
Article
· Feb 21, 2023 3m read

InterSystems Developer Hub:クリック1回で開始できるチュートリアル(4種)のご紹介

開発者の皆さん、こんにちは!

開発者向け情報を集めた「Developer Hub」ページが新たに登場しました!

(2025/10/9更新: 新たなチュートリアルが加わりましたので情報更新しました。)

 

このページには、5種類のチュートリアルが用意されています。チュートリアはブラウザ上で動作し、VSCodeやIRISターミナル、管理ポータルなどチュートリアルで使用するすべての画面が1つのタブ内で開くようになっています。

チュートリアルを試すための事前準備は不要で、クリック1回ですぐにお試しいただけます!(ユーザ登録も不要です)(チュートリアル開始方法は、ページ末尾をご覧ください。)

 

以下、5種類のチュートリアルの内容をご紹介します。

1) フルスタックチュートリアル

このチュートリアルでは、IRISの管理ポータルを使用してテーブル作成やデータの登録を行ったり、PyODBC経由でSQLを実行してみたり、SQLで登録したデータをオブジェクト操作で修正登録してみたり、サーバ側プログラミングを少し体験したり、RESTサーバの機能をIRISで作成してみたりと、サンプルコードを利用しながら様々な内容をお試しいただけます。

また、作成したRESTサーバの機能を利用して、Vue.jsを使用したオンラインページも作成しています(サンプルの用意があります)。

 

2) REST + Angular アプリケーション

このチュートリアルでは、IRISだけを利用してRESTサービスで使用するテーブル、データ、RESTサーバの機能を作成していく流れを、サンプルコードをコピーしながらご体験いただけます。

 

3) InterSystems Interoperability(相互運用性)

このチュートリアルでは、Redditに投稿されているデータを定期的にポーリングし、新しい投稿の中からタイトルに「cat」が含まれる投稿のみファイル出力する流れをご体験いただけます。

このチュートリアルを通して、Interoperability(相互運用性)機能の主要なコンポーネントの役割や、提供されているGUIの使い方などをご確認いただけます。

 

4)  InterSystems IRIS for Health 相互運用性

このチュートリアルでは、あるシステムから入力される HL7 メッセージを他のシステムに送信する流れをご体験いただけます。

また、データ変換が必要な場合の対応方法や HL7 メッセージの一部をテーブルに保存する流れなどもご体験いただけます。

 

5) InterSystems IRIS ベクトル検索を使用した RAG

このチュートリアルでは、生成 AI アプリケーションの精度向上に向けて、ベクトル検索と検索拡張生成(Retrieval Augmented Generation)の活用を体験できます。

具体的には、InterSystems IRIS のベクトル検索機能を活用し、生成 AI チャットボット向けのナレッジベースをサンプルコードを利用して作成します。

また、Streamlit を使用して作成したチャットボットを動かしながら、ナレッジベースの情報を追加することで生成 AI からの回答が変化していくことを確認していきます。

 

チュートリアルのイメージは以下の通りです。(フルスタックチュートリアルを途中まで進めた状態です)

 

もしよろしければ、チュートリアルのご意見、ご感想を ディスカッションページ にご記入くださいlaugh(もちろん、この記事への返信でも大丈夫です!)

ぜひ、お試しください!

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