FHIR.Glasscloud Patient API ご利用ガイド
HAPI FHIR サーバ(日本国内医療機関向け)
1. はじめに
本サービスは、FHIR(Fast Healthcare Interoperability Resources)規格に準拠した医療情報連携APIを提供します。
本APIでは、患者情報(Patientリソース)の取得・登録・更新を行うことができます。
FHIR R4 に準拠し、[HAPI FHIR]
(https://hapifhir.io/?utm_source=chatgpt.com)
を利用して構築されています。
2. 基本情報
| 項目 | 内容 |
|---|---|
| 規格 | FHIR R4 |
| データ形式 | JSON |
| 文字コード | UTF-8 |
| 通信方式 | HTTPS |
| 認証方式 | OAuth2 / Bearer Token |
| ベースURL |
https://example-medical.jp/fhir
|
3. Patient リソース概要
Patient リソースでは、患者の基本情報を管理します。
主な管理項目| 項目 | 説明 |
|---|---|
| 患者ID | システム内患者識別子 |
| 氏名 | 漢字・カナ・ローマ字 |
| 性別 | male / female / other / unknown |
| 生年月日 |
YYYY-MM-DD
|
| 電話番号 | 患者連絡先 |
| 住所 | 郵便番号・住所 |
| 保険者番号 | 必要に応じて管理 |
| 被保険者記号番号 | 必要に応じて管理 |
4. Patient データ取得 API
4-1. 患者単体取得
リクエストhttp
GET /Patient/{id}
実行例
http
GET https://example-medical.jp/fhir/Patient/100001
Authorization: Bearer xxxxxxxx
Accept: application/fhir+json
レスポンス例
json
{
"resourceType": "Patient",
"id": "100001",
"identifier": [
{
"system": "urn:oid:1.2.392.100495.20.3.51",
"value": "0000001234"
}
],
"name": [
{
"use": "official",
"family": "山田",
"given": ["太郎"]
}
],
"gender": "male",
"birthDate": "1980-05-10",
"telecom": [
{
"system": "phone",
"value": "03-1234-5678"
}
],
"address": [
{
"postalCode": "1000001",
"text": "東京都千代田区千代田1-1"
}
]
}
4-2. 患者検索
リクエストhttp
GET /Patient
検索条件例
| パラメータ | 説明 |
|---|---|
identifier
|
患者ID |
family
|
姓 |
given
|
名 |
birthdate
|
生年月日 |
gender
|
性別 |
実行例
http
GET /Patient?family=山田&birthdate=1980-05-10
レスポンス例
json
{
"resourceType": "Bundle",
"type": "searchset",
"total": 1,
"entry": [
{
"resource": {
"resourceType": "Patient",
"id": "100001",
"name": [
{
"family": "山田",
"given": ["太郎"]
}
]
}
}
]
}
5. Patient 登録 API
患者新規登録
リクエストhttp
POST /Patient
Content-Type: application/fhir+json
リクエストBody例
json
{
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:1.2.392.100495.20.3.51",
"value": "0000001234"
}
],
"name": [
{
"use": "official",
"family": "山田",
"given": ["太郎"]
}
],
"gender": "male",
"birthDate": "1980-05-10",
"telecom": [
{
"system": "phone",
"value": "03-1234-5678"
}
],
"address": [
{
"postalCode": "1000001",
"text": "東京都千代田区千代田1-1"
}
]
}
レスポンス例
http
HTTP/1.1 201 Created
Location: /Patient/100001/_history/1
6. Patient 更新 API
患者情報更新
リクエストhttp
PUT /Patient/{id}
Content-Type: application/fhir+json
実行例
http
PUT /Patient/100001
リクエストBody例
json
{
"resourceType": "Patient",
"id": "100001",
"telecom": [
{
"system": "phone",
"value": "03-9999-9999"
}
]
}
レスポンス例
http
HTTP/1.1 200 OK
7. エラー応答
FHIR標準の OperationOutcome を返却します。
エラー例json
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"diagnostics": "birthDate format invalid"
}
]
}
8. 日本国内向け運用上の注意
個人情報保護
本APIは、日本国の個人情報保護法、および医療情報システム安全管理ガイドラインに準拠した運用を前提としています。日本向けFHIR実装考慮
日本国内では以下への対応を推奨します。| 項目 | 内容 |
|---|---|
| JP Core | JP Core Implementation Guide 対応 |
| 漢字氏名 | `name.family`, `name.given` |
| カナ氏名 | extension利用 |
| 医療機関コード | OID管理 |
| 保険情報 | Coverageリソース利用 |
9. HTTPステータス一覧
| ステータス | 説明 |
|---|---|
200
|
正常 |
201
|
作成成功 |
400
|
リクエスト不正 |
401
|
認証エラー |
403
|
権限不足 |
404
|
データ未存在 |
409
|
更新競合 |
500
|
サーバ内部エラー |