中途終了患者情報一覧
メニュー
更新履歴
2021-01-27 「レスポンス一覧」に項目を追加。
2017-12-20 「レスポンス一覧」に項目を追加。
2014-07-03 「エラーメッセージ一覧」を追加。
「警告メッセージ一覧」を追加。
概要
POSTメソッドによる中途終了状態の患者情報取得を行います。
日レセ Ver.4.7.0[第19回パッチ適用]以降
リクエストおよびレスポンスデータはxml2形式になります。
テスト方法
- 参考提供されている sample_tmedical_v2.rb 内の変数HOST等を接続環境に合わせます。
- sample_tmedical_v2.rb 内の診療日等の一覧取得に必要な情報を設定します。
- ruby sample_tmedical_v2.rb により接続します。
リクエスト(POSTリクエスト)サンプル
POST : /api01rv2/tmedicalgetv2
Content-Type: application/xml
application/xml の場合の文字コードは UTF-8 とします。
<data>
<tmedicalgetreq type="record">
<Perform_Date type="string">2013-10-02</Perform_Date>
<InOut type="string">2</InOut>
<Department_Code type="string"></Department_Code>
<Patient_ID type="string"></Patient_ID>
</tmedicalgetreq>
</data>
処理概要
診療年月日等を指定することにより中途終了状態の患者情報の取得を行います。
処理詳細
- 基準日の妥当性チェック(未設定の場合は、システム日付を設定)
- 診療科の妥当性チェック
- 患者番号の存在チェック
- 返却情報は最大500件
レスポンスサンプル
<xmlio2>
<tmedicalgetres type="record">
<Information_Date type="string">2013-10-02</Information_Date>
<Information_Time type="string">17:33:58</Information_Time>
<Api_Result type="string">00</Api_Result>
<Api_Result_Message type="string">処理終了</Api_Result_Message>
<Reskey type="string">Medical Info</Reskey>
<Perform_Date type="string">2013-10-02</Perform_Date>
<InOut type="string">2</InOut>
<Tmedical_List_Information type="array">
<Tmedical_List_Information_child type="record">
<Patient_Information type="record">
<Patient_ID type="string">00012</Patient_ID>
<WholeName type="string">日医 太郎</WholeName>
<WholeName_inKana type="string">ニチイ タロウ</WholeName_inKana>
<BirthDate type="string">1975-01-01</BirthDate>
<Sex type="string">1</Sex>
</Patient_Information>
<Department_Code type="string">01</Department_Code>
<Department_Name type="string">内科</Department_Name>
<Physician_Code type="string">10001</Physician_Code>
<Physician_WholeName type="string">日本 一</Physician_WholeName>
<Insurance_Combination_Number type="string">0002</Insurance_Combination_Number>
<HealthInsurance_Information type="record">
<InsuranceProvider_Class type="string">060</InsuranceProvider_Class>
<InsuranceProvider_WholeName type="string">国保</InsuranceProvider_WholeName>
<InsuranceProvider_Number type="string">138057</InsuranceProvider_Number>
<HealthInsuredPerson_Symbol type="string">01</HealthInsuredPerson_Symbol>
<HealthInsuredPerson_Number type="string">123456</HealthInsuredPerson_Number>
<PublicInsurance_Information type="array">
<PublicInsurance_Information_child type="record">
<PublicInsurance_Class type="string">019</PublicInsurance_Class>
<PublicInsurance_Name type="string">原爆一般</PublicInsurance_Name>
<PublicInsurer_Number type="string">19113760</PublicInsurer_Number>
<PublicInsuredPerson_Number type="string">1234566</PublicInsuredPerson_Number>
</PublicInsurance_Information_child>
</PublicInsurance_Information>
</HealthInsurance_Information>
<Medical_Uid type="string">52e4f8aa-2b3d-11e3-83c8-8c736e794c62</Medical_Uid>
<Medical_Time type="string">17:33:33</Medical_Time>
<Medical_Mode type="string">0</Medical_Mode>
<Medical_Mode2 type="string">0</Medical_Mode2>
</Tmedical_List_Information_child>
</Tmedical_List_Information>
</tmedicalgetres>
</xmlio2>
リクエスト一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Perform_Date | 診療日 | 2013-10-02 | 未設定はシステム日付 |
2 | InOut | 入院外来区分 (1:入院中、2:入院外) | 2 | ※1 |
3 | Department_Code | 診療科コード (01:内科) | 01 | ※2 |
4 | Patient_ID | 患者番号 | 12 | ※2 |
※1:「1:入院中」以外は、入院外とします。
※2:診療科コード・患者番号は指定があれば対象とします。
レスポンス一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Information_Date | 実施日 | 2013-10-02 | |
2 | Information_Time | 実施時間 | 17:33:58 | |
3 | Api_Result | 結果コード | 00 | |
4 | Api_Result_Message | 結果メッセージ | 処理終了 | |
5 | Reskey | レスポンスキー情報 | Medical Info | |
6 | Perform_Date | 診療日 | 2013-10-02 | |
7 | InOut | 入院外来区分 | 2 | |
8 | Tmedical_List_Information | 中途データ一覧情報(繰り返し500) | ||
8-1 | Patient_Information | 患者情報 | ||
8-1-1 | Patient_ID | 患者番号 | 00012 | |
8-1-2 | WholeName | 漢字氏名 | 日医 太郎 | |
8-1-3 | WholeName_inKana | カナ氏名 | ニチイ タロウ | |
8-1-4 | BirthDate | 生年月日 | 1975-01-01 | |
8-1-5 | Sex | 性別 (1:男、2:女) | 1 | |
8-2 | Department_Code | 診療科コード (01:内科) | 01 | |
8-3 | Department_Name | 診療科名称 | 内科 | |
8-4 | Physician_Code | ドクターコード | 10001 | |
8-5 | Physician_WholeName | ドクター名 | 日本 一 | |
8-6 | Insurance_Combination_Number | 保険組合せ番号 | 0002 | |
8-7 | HealthInsurance_Information | 保険組合せ情報 | ||
8-7-1 | InsuranceProvider_Class | 保険の種類 | 060 | |
8-7-2 | InsuranceProvider_WholeName | 保険の制度名称 | 国保 | |
8-7-3 | InsuranceProvider_Number | 保険者番号 | 138057 | |
8-7-4 | HealthInsuredPerson_Symbol | 記号 | 01 | |
8-7-5 | HealthInsuredPerson_Number | 番号 | 123456 | |
8-7-6 | HealthInsuredPerson_Branch_Number | 枝番 | 00 | 追加 (2021-01-27) |
8-7-7 | PublicInsurance_Information | 公費情報(繰り返し4) | ||
8-7-7-1 | PublicInsurance_Class | 公費の種類 | 019 | |
8-7-7-2 | PublicInsurance_Name | 公費の制度名称 | 原爆一般 | |
8-7-7-3 | PublicInsurer_Number | 負担者番号 | 19113760 | |
8-7-7-4 | PublicInsuredPerson_Number | 受給者番号 | 1234566 | |
8-8 | Readmission_Day_In | 同日再入院区分 (1:同日再入院分) | 追加 (2017-12-20) | |
8-9 | Medical_Uid | API登録のUID | 52e4f8aa-2b3d-11e3-83c8-8c736e794c62 | |
8-10 | Medical_Time | 登録時間 | 17:33:33 | |
8-11 | Medical_Mode | 展開区分 (1:展開中、0:以外、5:HAORI) | 0 | 値追加 (2017-12-20) |
8-12 | Medical_Mode2 | 登録区分 (1:中途終了登録分、0:以外) | 0 | ※1 |
※1:日レセAPIで登録された場合でも、一旦日レセ画面に展開し、再度中途終了した場合(Medical_Mode2 = 1 の状態)は、Medical_Uidの値は消されます。
※中途終了データを登録時間順に編集します。
※500件以上存在した時はメッセージを返却します。
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 -*-
#!/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/tmedicalgetv2")
#
# 1.診療日 Perform_Date (IMPLIED)
# 2.入院外来区分 InOut (IMPLIED)
# 3.診療科コード Department_Code (IMPLIED)
# 4.患者番号 Patient_ID (IMPLIED)
#
# REQUIRED : 必須 IMPLIED : 任意
#
BODY = <<EOF
<data>
<tmedicalgetreq type="record">
<Perform_Date type="string">2013-10-02</Perform_Date>
<InOut type="string">2</InOut>
<Department_Code type="string"></Department_Code>
<Patient_ID type="string"></Patient_ID>
</tmedicalgetreq>
</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 }
エラーメッセージ一覧
エラーコード | エラーメッセージ |
---|---|
10 | 患者番号に該当する患者が存在しません |
11 | 診療日が暦日ではありません |
13 | 診療科が存在しません |
14 | 対象が500件以上存在します |
15 | 対象がありません |
89 | 職員情報が取得できません |
医療機関情報が取得できません | |
システム日付が取得できません | |
患者番号構成情報が取得できません | |
グループ医療機関が不整合です。処理を終了して下さい | |
システム項目が設定できません | |
90 | 他端末使用中 |
91 | 処理区分未設定 |
97 | 送信内容に誤りがあります |
98 | 送信内容の読込ができませんでした |
99 | ユーザID未登録 |
警告メッセージ一覧
エラーコード | 警告メッセージ |
---|---|
K1 | 診療日を設定しました |