API 患者予約情報
メニュー
更新履歴
2017-11-27 「レスポンス一覧」に項目を追加。
2014-06-02 「エラーメッセージ一覧」を追加。
概要
POSTメソッドによる指定患者の基準日以降の予約情報の返却を行います。
リクエストおよびレスポンスデータはxml2形式になります。
テスト方法
- 参考提供されている sample_appointlst2_v2.rb 内の変数HOST等を接続環境に合わせます。
- sample_appointlst2_v2.rb 内の患者番号等を接続先の日レセの環境に合わせます。
- ruby sample_appointlst2_v2.rb により接続。
リクエスト(POSTリクエスト)サンプル
POST : /api01rv2/appointlst2v2?class=01
class = 01 患者予約情報取得
Content-Type : application/xml
application/xml の場合の文字コードは UTF-8 とします。
<data>
<appointlst2req type="record">
<Patient_ID type="string">1</Patient_ID>
<Base_Date type="string">2012-12-18</Base_Date>
</appointlst2req>
</data>
処理概要
患者予約情報リクエストにより、指定した患者の基準日以降の予約情報の返却を行います。
処理詳細
- 送信された患者番号による患者の存在チェック
- 基準日の妥当性チェック(未設定の場合は、システム日付を設定)
- 返却情報は最大50件まで(返却情報の表示順は、予約画面の予約日検索と同じで予約日の降順となります)
レスポンスサンプル
<xmlio2>
<appointlst2res type="record">
<Information_Date type="string">2012-12-17</Information_Date>
<Information_Time type="string">14:09:44</Information_Time>
<Api_Result type="string">00</Api_Result>
<Api_Result_Message type="string">処理終了</Api_Result_Message>
<Reskey type="string">Patient Info</Reskey>
<Base_Date type="string">2012-12-18</Base_Date>
<Patient_Information type="record">
<Patient_ID type="string">00001</Patient_ID>
<WholeName type="string">テスト 患者</WholeName>
<WholeName_inKana type="string">テスト カンジャ</WholeName_inKana>
<BirthDate type="string">1970-01-01</BirthDate>
<Sex type="string">1</Sex>
</Patient_Information>
<Appointlst_Information type="array">
<Appointlst_Information_child type="record">
<Appointment_Date type="string">2012-12-22</Appointment_Date>
<Appointment_Time type="string">11:00:00</Appointment_Time>
<Medical_Information type="string">01</Medical_Information>
<Medical_Information_WholeName type="string">診察1</Medical_Information_WholeName>
<Department_Code type="string">01</Department_Code>
<Department_WholeName type="string">内科</Department_WholeName>
<Physician_Code type="string">10001</Physician_Code>
<Physician_WholeName type="string">おるか</Physician_WholeName>
</Appointlst_Information_child>
<Appointlst_Information_child type="record">
<Appointment_Date type="string">2012-12-19</Appointment_Date>
<Appointment_Time type="string">15:30:00</Appointment_Time>
<Medical_Information type="string">01</Medical_Information>
<Medical_Information_WholeName type="string">診察1</Medical_Information_WholeName>
<Department_Code type="string">01</Department_Code>
<Department_WholeName type="string">内科</Department_WholeName>
<Physician_Code type="string">10001</Physician_Code>
<Physician_WholeName type="string">おるか</Physician_WholeName>
</Appointlst_Information_child>
</Appointlst_Information>
</appointlst2res>
</xmlio2>
リクエスト一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Patient_ID | 患者番号 | 1 | 必須 |
2 | Base_Date | 基準日 | 2012-12-18 | (未設定の場合はシステム日付を設定) |
レスポンス一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Information_Date | 実施日 | 2012-12-17 | |
2 | Information_Time | 実施時間 | 14:09:44 | |
3 | Api_Result | 結果コード(ゼロ以外エラー) | 00 | |
4 | Api_Result_Message | エラーメッセージ | 処理終了 | |
5 | Reskey | レスポンスキー情報 | Patient Info | |
6 | Base_Date | 基準日 | 2012-12-18 | |
7 | Patient_Information | 患者基本情報 | ||
7-1 | Patient_ID | 患者番号 | 00001 | |
7-2 | WholeName | 患者氏名 | テスト 患者 | |
7-3 | WholeName_inKana | 患者カナ氏名 | テスト カンジャ | |
7-4 | BirthDate | 生年月日 | 1970-01-01 | |
7-5 | Sex | 性別 (1:男性、2:女性) | 1 | |
8 | Appointlst_Information | 予約情報(繰り返し 50) | ||
8-1 | Appointment_Date | 予約日 | 2012-12-22 | |
8-2 | Appointment_Time | 予約時間 | 11:00:00 | |
8-3 | Medical_Information | 診療内容区分 ※1 (01:診察1、02:薬のみ、03:注射のみ、04:検査のみ、05:リハビリテーション、06:健康診断、07:予防注射、99:該当なし) | 01 | |
8-4 | Medical_Information_WholeName | 診療内容名称 | 診察1 | |
8-5 | Department_Code | 予約診療科コード ※2 (01:内科) | 01 | |
8-6 | Department_WholeName | 予約診療科名称 | 内科 | |
8-7 | Physician_Code | 予約ドクターコード | 10001 | |
8-8 | Physician_WholeName | 予約ドクター名 | おるか | |
8-9 | Visit_Information | 来院情報 (1:来院済) | 1 | |
8-10 | Appointment_Id | 予約ID | 01 | 追加 (2017-11-27) |
8-11 | Appointment_Note | 予約メモ内容 | 予約メモテスト |
※1:システム管理マスタの診療内容情報の診療内容コードを参照して下さい。
※2:システム管理マスタの診療科目情報の診療科コードを参照して下さい。
Rubyによるリクエストサンプルソース
Rubyのバージョンが1.9.2以前の環境の場合、HTTPのバージョン指定を1.1に変更する必要があります。
Rubyのバージョンを確認後、以下のように該当箇所を変更して下さい。
- Ruby1.9.2以降の場合
Net::HTTP.version_1_2
- Ruby1.9.2以前の場合
Net::HTTP.version_1_1
Rubyのバージョンが1.9.1以降の環境(日レセ4.8以降の環境)ではソースファイル内の文字コードの指定が必要になります。
サンプルソース内に以下の一行が記述されていることを確認して下さい。
# -*- coding: utf-8 -*-
sample_appointlst2_v2.rb (xml2)
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
#------ 予約一覧取得
require 'uri'
require 'net/http'
Net::HTTP.version_1_2
HOST = "localhost"
PORT = "8000"
USER = "ormaster"
PASSWD = "ormaster"
CONTENT_TYPE = "application/xml"
req = Net::HTTP::Post.new("/api01rv2/appointlst2v2?class=01")
# class :01 患者予約情報取得
#
#
BODY = <<EOF
<data>
<appointlst2req type="record">
<Patient_ID type="string">1</Patient_ID>
<Base_Date type="string">2012-12-20</Base_Date>
</appointlst2req>
</data>
EOF
req.content_length = BODY.size
req.content_type = CONTENT_TYPE
req.body = BODY
req.basic_auth(USER, PASSWD)
puts req.body
Net::HTTP.start(HOST, PORT) {|http|
res = http.request(req)
puts res.body
}
エラーメッセージ一覧
エラーコード | エラーメッセージ |
---|---|
01 | 患者番号の設定がありません |
10 | 患者番号に該当する患者が存在しません |
11 | 予約日が暦日ではありません |
20 | 予約対象件数が50件以上あります |
21 | 対象の予約はありませんでした |
89 | 職員情報が取得できません |
医療機関情報が取得できません | |
システム日付が取得できません | |
患者番号構成情報が取得できません | |
グループ医療機関が不整合です 処理を終了して下さい | |
システム項目が設定できません | |
90 | 他端末使用中 |
91 | 処理区分未設定 |
97 | 送信内容に誤りがあります |
98 | 送信内容の読込ができませんでした |
99 | ユーザID未登録 |