Skip to content

Commit e3a097c

Browse files
authored
Initial commit
0 parents  commit e3a097c

32 files changed

+176435
-0
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/.DS_Store
2+
.git

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.sh text eol=lf
2+
*.cls text eol=lf
3+
*.mac text eol=lf
4+
*.int text eol=lf
5+
Dockerfil* text eol=lf
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: objectscriptquality
2+
on: push
3+
4+
jobs:
5+
linux:
6+
name: Linux build
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Execute ObjectScript Quality Analysis
11+
run: wget https://raw.githubusercontent.com/litesolutions/objectscriptquality-jenkins-integration/master/iris-community-hook.sh && sh ./iris-community-hook.sh
12+

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
3+

.vscode/launch.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "objectscript",
6+
"request": "launch",
7+
"name": "ObjectScript Debug Class",
8+
"program": "##class(PackageSample.ObjectScript).Test()",
9+
},
10+
{
11+
"type": "objectscript",
12+
"request": "attach",
13+
"name": "ObjectScript Attach",
14+
"processId": "${command:PickProcess}",
15+
"system": true
16+
}
17+
]
18+
}

.vscode/settings.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"files.associations": {
3+
4+
"Dockerfile*": "dockerfile",
5+
"iris.script": "objectscript"
6+
},
7+
"objectscript.conn" :{
8+
"ns": "FHIRSERVER",
9+
"active": true,
10+
"username": "_SYSTEM",
11+
"password": "SYS",
12+
"docker-compose": {
13+
"service": "iris",
14+
"internalPort": 52773
15+
},
16+
"links": {
17+
"FHIR UI Portal": "http://localhost:${port}/fhir/portal/patientlist.html",
18+
"FHIR UI Demo": "http://localhost:${port}/fhirUI/FHIRAppDemo.html",
19+
"FHIR server test": "http://localhost:${port}/fhir/r4/metadata"
20+
}
21+
},
22+
"sqltools.connections": [
23+
{
24+
"askForPassword": false,
25+
"connectionMethod": "Server and Port",
26+
"driver": "InterSystems IRIS",
27+
"name": "iris-fhir-template",
28+
"namespace": "FHIRSERVER",
29+
"password": "SYS",
30+
"port": 32783,
31+
"previewLimit": 50,
32+
"server": "localhost",
33+
"showSystem": false,
34+
"username": "_SYSTEM"
35+
}
36+
]
37+
38+
}

Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG IMAGE=intersystemsdc/irishealth-community:latest
2+
FROM $IMAGE
3+
4+
WORKDIR /home/irisowner/irisdev
5+
#RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
6+
7+
# run iris and initial
8+
RUN --mount=type=bind,src=.,dst=. \
9+
iris start IRIS && \
10+
iris session IRIS < iris.script && \
11+
iris stop IRIS quietly

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 InterSystems Developer Community
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README-JP.md

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# iris-fhirserver-template について
2+
FHIR サーバとして IRIS for Health Community Edition を使用するための開発テンプレートです。
3+
4+
開発テンプレートの中では、FHIR サーバの設定、テストデータのインポート、REST API の使用例を含む簡単な Web ページが用意されます。
5+
6+
7+
## 前提条件
8+
このテンプレートを利用するために、[git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)[Docker desktop](https://www.docker.com/products/docker-desktop) のインストールが必要です。
9+
10+
11+
## インストール方法
12+
13+
clone/git pull を使用してローカルディレクトリにリポジトリをダウンロードします。
14+
15+
```
16+
$ git clone https://github.com/intersystems-community/iris-fhir-template.git
17+
```
18+
19+
clone したディレクトリでターミナルを開き、以下実行します。
20+
21+
```
22+
$ docker-compose up -d
23+
```
24+
25+
## Patient data
26+
このテンプレートでは、[/fhirdata](https://github.com/intersystems-community/iris-fhir-server-template/tree/master/fhirdata) フォルダに5人の患者データのサンプルを用意していて、[docker build](https://github.com/intersystems-community/iris-fhir-server-template/blob/8bd2932b34468f14530a53d3ab5125f9077696bb/iris.script#L26) のときにロードしています。
27+
28+
また、[synthea-loader.sh](/synthea-loader.sh) を使用して任意数の患者データを生成できます。
29+
ターミナルを開き、git clone で生成されたディレクトリに移動し以下実行します(Windowsで実行する場合は、synthea-loader.bat をご利用ください。)。
30+
31+
```
32+
#./synthea-loader.sh 5
33+
```
34+
35+
上記実行により、5人の患者データ用ファイルが data/fhir 以下に追加されます。
36+
IRIS のターミナルを開き、FHIRSERVER へ移動します。
37+
38+
```
39+
docker-compose exec iris iris session iris -U FHIRServer
40+
```
41+
42+
FHIRSERVER のプロンプトが表示されたら以下実行します。
43+
44+
```
45+
FHIRSERVER>do ##class(fhirtemplate.Setup).LoadPatientData("/irisdev/app/output/fhir","FHIRSERVER","/fhir/r4")
46+
```
47+
48+
より多くの患者データサンプルを作成されたい場合は、こちら [following project](https://github.com/intersystems-community/irisdemo-base-synthea) をご利用ください。
49+
50+
51+
## FHIR R4 API のテスト方法
52+
53+
開発テンプレートが提供する FHIR サーバの Capability Statement をご参照ください。
54+
以下 URL から FHIR サーバの Capability Statement を参照できます。
55+
56+
http://localhost:32783/fhir/r4/metadata
57+
58+
59+
## Postman を利用して Capability Statement を参照する
60+
FHIR リソースのメタ情報を取得するには、以下の GET要求を実行します。
61+
62+
GET http://localhost:32783/fhir/r4/metadata
63+
64+
<img width="881" alt="Screenshot 2020-08-07 at 17 42 04" src="https://user-images.githubusercontent.com/2781759/89657453-c7cdac00-d8d5-11ea-8fed-71fa8447cc45.png">
65+
66+
67+
Postman で以下のGET要求を実行するとリソース ID=1 の患者リソースを取得できます。
68+
69+
http://localhost:32783/fhir/r4/Patient/1
70+
71+
<img width="884" alt="Screenshot 2020-08-07 at 17 42 26" src="https://user-images.githubusercontent.com/2781759/89657252-71606d80-d8d5-11ea-957f-041dbceffdc8.png">
72+
73+
74+
75+
## 簡単な フロントエンドアプリから FHIR API の呼び出しをテストする方法
76+
77+
Patient と Observation の FHIR リソースを検索し、結果を参照する非常に基本的なフロントエンドアプリは、以下 URL で参照できます。
78+
79+
http://localhost:32783/csp/user/fhirUI/FHIRAppDemo.html
80+
81+
VSCode ObjectScript メニューからも開くことができます:
82+
<img width="616" alt="Screenshot 2020-08-07 at 17 34 49" src="https://user-images.githubusercontent.com/2781759/89657546-ea5fc500-d8d5-11ea-97ed-6fbbf84da655.png">
83+
84+
ページを開くと、貧血の症状を持つ女性患者の検索結果を参照できます。
85+
また、特定の患者IDを指定すると、ヘモグロビン値のグラフを参照できます。
86+
87+
<img width="484" alt="Screenshot 2020-08-06 at 18 51 22" src="https://user-images.githubusercontent.com/2781759/89657718-2b57d980-d8d6-11ea-800f-d09dfb48f8bc.png">
88+
89+
90+
## 参考情報
91+
[InterSystems IRIS FHIR Documentation](https://docs.intersystems.com/irisforhealth20203/csp/docbook/Doc.View.cls?KEY=HXFHIR)
92+
93+
[FHIR API](http://hl7.org/fhir/resourcelist.html)
94+
95+
[Developer Community FHIR section(US版)](https://community.intersystems.com/tags/fhir)
96+
97+
[Developer Community FHIR section(日本版)](https://jp.community.intersystems.com/tags/fhir)
98+
99+
100+
## コーディングの開始方法(ObjectScript)
101+
このGitリポジトリは、ObjectScript のプラグイン使用して VSCode でコーディングする準備が整っています。
102+
[VSCode](https://code.visualstudio.com/), [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) [ObjectScript](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript) プラグインインストールします。あとは、VSCoed でリポジトリのフォルダを開くだけです。
103+
104+
/src/cls/PackageSample/ObjectScript.cls を開き何か変更を加えてみてください。Ctrl+Sで保存すると実行中の IRIS docker コンテナでコンパイルされます。
105+
106+
![docker_compose](https://user-images.githubusercontent.com/2781759/76656929-0f2e5700-6547-11ea-9cc9-486a5641c51d.gif)
107+
108+
PackageSample フォルダはサンプルです。ObjectScript 練習用として、編集、削除などお好みで行ってください。
109+
もし、新規でクラスを作成する場合は /src 以下にパッケージ名のフォルダを作成し、その下にクラス名のファイル(例:Classname.cls)を配置してください。
110+
例) /src/Package/Classname.cls
111+
112+
ご参考:[Read more about folder setup for InterSystems ObjectScript](https://community.intersystems.com/post/simplified-objectscript-source-folder-structure-package-manager)
113+
114+
115+
## リポジトリの中身について
116+
117+
### Dockerfile
118+
119+
IRIS を起動し、開発テンプレートに必要なファイルのコピー([/src](https://github.com/intersystems-community/iris-fhir-server-template/tree/master/src)[/fhirdata](https://github.com/intersystems-community/iris-fhir-server-template/tree/master/fhirdata)[/fhirUI](https://github.com/intersystems-community/iris-fhir-server-template/tree/master/fhirUI)[/iris.script](https://github.com/intersystems-community/iris-fhir-server-template/tree/master/iris.script) )と iris.script の実行を行います。
120+
121+
関連する docker-compose.yml を使用して、ポート番号やホストフォルダをマップする場所などの追加パラメータを簡単に設定します。
122+
123+
124+
125+
### .vscode/settings.json
126+
127+
[VSCode ObjectScript プラグイン](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript)を使って VSCode ですぐにコーディングできるようにするための設定ファイルです。
128+
129+
### .vscode/launch.json
130+
VSCode ObjectScript でデバッグしたい場合の設定ファイルです。
131+
132+
133+
## トラブルシューティング
134+
135+
### ERROR #5001: Error -28 Creating Directory /usr/irissys/mgr/FHIRSERVER/
136+
このエラーが出る場合、docker の空き容量を使い果たしてしまった可能性があります。以下のコマンドを利用して未使用のイメージ、キャッシュ、コンテナを削除することができます。
137+
(-f オプションを指定しない場合、確認用のプロンプトが出力されます)
138+
139+
```
140+
$ docker system prune -f
141+
```
142+
143+
上記コマンド実行後、キャッシュを使用しないイメージの再構築を行います。
144+
145+
```
146+
$ docker-compose build --no-cache
147+
```
148+
149+
上記コマンド実行後、コンテナを開始します。
150+
151+
```
152+
$ docker-compose up -d
153+
```
154+
155+
この他のヒントについては、[dev.md](/dev.md) をご参照ください。
156+

0 commit comments

Comments
 (0)