API 仮計算情報返却
メニュー
更新履歴
2022-08-29 「室料差額(Ml_Room_Charge)」「室料差額消費税−再掲(Ml_Tax_In_Room_Charge)」を追加。
2014-08-01 「エラーメッセージ一覧」を追加。
概要
POSTメソッドによる仮計算情報の返却を行います。
日レセ Ver4.7.0[第21回パッチ適用]以降
リクエストおよびレスポンスデータはxml2形式になります。
テスト方法
- 参考提供されている sample_hsacsimulate_v2.rb 内の変数HOST等を接続環境に合わせます。
- sample_hsacsimulate_v2.rb 内の患者番号等を接続先の日レセの環境に合わせます。
- ruby sample_hsacsimulate_v2.rb により接続。
リクエスト(POSTリクエスト)サンプル
POST : /api01rv2/hsacsimulatev2
Content-Type: application/xml
application/xml の場合の文字コードは UTF-8 とします。
<data>
<private_objects type="record">
<Patient_ID type="string">12</Patient_ID>
<Discharge_Date type="string">2013-11-20</Discharge_Date>
</private_objects>
</data>
処理概要
リクエストにより入院中患者の退院時の請求額等の仮計算情報の返却を行います。
処理詳細
- 仮退院年月日の妥当性チェック
- 患者番号の存在チェック
- 請求期間(入院日または前回請求期間後から退院日まで)の点数、患者負担額、食事療養費、自費金額を返却します。
また、請求期間に複数の保険組合せの入力がある場合、保険組合せ毎の計算結果及び合計の返却を行います。 - 患者負担額の計算については、患者情報に登録されている保険、公費(全国公費、地方公費)、高額療養費、低所得等の設定を元に計算を行います。また、計算結果に端数が生じる場合、システム管理「1001 医療機関情報ー基本」の設定に応じて端数調整を行います。
- 請求期間は最大2ヶ月指定可能で、指定した仮退院日での請求情報を返却します。
レスポンスサンプル
<xmlio2>
<private_objects type="record">
<Information_Date type="string">2013-11-20</Information_Date>
<Information_Time type="string">15:25:12</Information_Time>
<Api_Result type="string">00</Api_Result>
<Api_Result_Message type="string">処理終了</Api_Result_Message>
<Start_Date type="string">20131120</Start_Date>
<End_Date type="string">20131120</End_Date>
<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>
<Admission_Date type="string">2013-11-20</Admission_Date>
<Acsimulate_Information type="array">
<Acsimulate_Information_child type="record">
<Information_Class type="record">
<Label type="string">請求情報種別</Label>
<Data type="string">0</Data>
<Name type="string">明細</Name>
</Information_Class>
<Perform_Month type="string">2013-11</Perform_Month>
<Department_Code type="string">01</Department_Code>
<Department_Name type="string">内科</Department_Name>
<HealthInsurance_Information type="record">
<Insurance_Combination_Number type="string">0003</Insurance_Combination_Number>
<InsuranceProvider_Class type="string">060</InsuranceProvider_Class>
<InsuranceProvider_Number type="string">138057</InsuranceProvider_Number>
<InsuranceProvider_WholeName type="string">国保</InsuranceProvider_WholeName>
<HealthInsuredPerson_Symbol type="string">123</HealthInsuredPerson_Symbol>
<HealthInsuredPerson_Number type="string">456</HealthInsuredPerson_Number>
<PublicInsurance_Information type="array">
<PublicInsurance_Information_child type="record">
<PublicInsurance_Class type="string">010</PublicInsurance_Class>
<PublicInsurance_Name type="string">感37の2</PublicInsurance_Name>
<PublicInsurer_Number type="string">10131142</PublicInsurer_Number>
<PublicInsuredPerson_Number type="string">1234567</PublicInsuredPerson_Number>
</PublicInsurance_Information_child>
</PublicInsurance_Information>
</HealthInsurance_Information>
<Cd_Information type="record">
<Ac_Money type="string"> 3410</Ac_Money>
<Ai_Money type="string"> 0</Ai_Money>
<Oe_Money type="string"> 1000</Oe_Money>
<Pi_Smoney type="string"> 2410</Pi_Smoney>
<Ml_Smoney type="string"> 0</Ml_Smoney>
</Cd_Information>
<Ac_Point_Information type="record">
<Ac_Ttl_Point type="string"> 4822</Ac_Ttl_Point>
<Ac_Point_Detail type="array">
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">初・再診料</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">医学管理等</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">在宅療養</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">投薬</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">注射</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">処置</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">手術</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">麻酔</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">検査</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">画像診断</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">リハビリ</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">精神科専門</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">放射線治療</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">病理診断</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">入院料</AC_Point_Name>
<AC_Point type="string"> 4822</AC_Point>
</Ac_Point_Detail_child>
</Ac_Point_Detail>
</Ac_Point_Information>
<Ml_Cost type="string"> 0</Ml_Cost>
<Ml_Room_Charge type="string"> 21000</Ml_Room_Charge>
<Ml_Tax_In_Room_Charge type="string"> 0</Ml_Tax_In_Room_Charge>
</Acsimulate_Information_child>
<Acsimulate_Information_child type="record">
<Information_Class type="record">
<Label type="string">請求情報種別</Label>
<Data type="string">1</Data>
<Name type="string">月合計</Name>
</Information_Class>
<Perform_Month type="string">2013-11</Perform_Month>
<Cd_Information type="record">
<Ac_Money type="string"> 3410</Ac_Money>
<Ai_Money type="string"> 0</Ai_Money>
<Oe_Money type="string"> 1000</Oe_Money>
<Pi_Smoney type="string"> 2410</Pi_Smoney>
<Ml_Smoney type="string"> 0</Ml_Smoney>
</Cd_Information>
<Ac_Point_Information type="record">
<Ac_Ttl_Point type="string"> 4822</Ac_Ttl_Point>
<Ac_Point_Detail type="array">
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">初・再診料</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">医学管理等</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">在宅療養</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">投薬</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">注射</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">処置</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">手術</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">麻酔</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">検査</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">画像診断</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">リハビリ</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">精神科専門</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">放射線治療</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">病理診断</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">入院料</AC_Point_Name>
<AC_Point type="string"> 4822</AC_Point>
</Ac_Point_Detail_child>
</Ac_Point_Detail>
</Ac_Point_Information>
<Ml_Cost type="string"> 0</Ml_Cost>
<Ml_Room_Charge type="string"> 21000</Ml_Room_Charge>
<Ml_Tax_In_Room_Charge type="string"> 0</Ml_Tax_In_Room_Charge>
</Acsimulate_Information_child>
<Acsimulate_Information_child type="record">
<Information_Class type="record">
<Label type="string">請求情報種別</Label>
<Data type="string">2</Data>
<Name type="string">総合計</Name>
</Information_Class>
<Cd_Information type="record">
<Ac_Money type="string"> 3410</Ac_Money>
<Ai_Money type="string"> 0</Ai_Money>
<Oe_Money type="string"> 1000</Oe_Money>
<Pi_Smoney type="string"> 2410</Pi_Smoney>
<Ml_Smoney type="string"> 0</Ml_Smoney>
</Cd_Information>
<Ac_Point_Information type="record">
<Ac_Ttl_Point type="string"> 4822</Ac_Ttl_Point>
<Ac_Point_Detail type="array">
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">初・再診料</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">医学管理等</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">在宅療養</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">投薬</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">注射</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">処置</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">手術</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">麻酔</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">検査</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">画像診断</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">リハビリ</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">精神科専門</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">放射線治療</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">病理診断</AC_Point_Name>
<AC_Point type="string"> 0</AC_Point>
</Ac_Point_Detail_child>
<Ac_Point_Detail_child type="record">
<AC_Point_Name type="string">入院料</AC_Point_Name>
<AC_Point type="string"> 4822</AC_Point>
</Ac_Point_Detail_child>
</Ac_Point_Detail>
</Ac_Point_Information>
<Ml_Cost type="string"> 0</Ml_Cost>
<Ml_Room_Charge type="string"> 21000</Ml_Room_Charge>
<Ml_Tax_In_Room_Charge type="string"> 0</Ml_Tax_In_Room_Charge>
</Acsimulate_Information_child>
</Acsimulate_Information>
</private_objects>
</xmlio2>
リクエスト一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Patient_ID | 患者番号 | 12 | 必須 |
2 | Discharge_Date | 退院日 | 2013-11-20 | 省略時はシステム日付 |
レスポンス一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Information_Date | 実施日 | 2013-11-20 | |
2 | Information_Time | 実施時間 | 15:25:12 | |
3 | Api_Result | 結果コード | 00 | |
4 | Api_Result_Message | 結果メッセージ | 処理終了 | |
5 | Start_Date | 請求開始日 | 20131120 | |
6 | End_Date | 請求終了日 | 20131120 | |
7 | Patient_Information | 患者情報 | ||
7-1 | Patient_ID | 患者番号 | 00012 | |
7-2 | WholeName | 患者氏名 | 日医 太郎 | |
7-3 | WholeName_inKana | 患者カナ氏名 | ニチイ タロウ | |
7-4 | BirthDate | 生年月日 | 1970-01-01 | |
7-5 | Sex | 性別 (1:男性、2:女性) | 1 | |
8 | Admission_Date | 入院日 | 2013-11-20 | |
9 | Acsimulate_Information | 請求情報(繰り返し 13) | ||
9-1 | Information_Class | 請求情報種別 | ||
9-1-1 | Label | 内容の名称 | 請求情報種別 | |
9-1-2 | Data | コード | 0 | |
9-1-3 | Name | 内容 (Data:name、 0:明細、 1:月合計、 2:総合計) | 明細 | |
9-2 | Perform_Month | 診療年月 (総合計は表示なし) | 2013-11 | |
9-3 | Department_Code | 診療科コード (月合計、総合計は表示なし) | 01 | |
9-4 | Department_Name | 診療科名称 (月合計、総合計は表示なし) | 内科 | |
9-5 | HealthInsurance_Information | 保険組合せ情報 (月合計、総合計は表示なし) | | |
9-5-1 | Insurance_Combination_Number | 保険組合せ番号 | 0003 | |
9-5-2 | InsuranceProvider_Class | 保険の種類 | 060 | |
9-5-3 | InsuranceProvider_Number | 保険者番号 | 138057 | |
9-5-4 | InsuranceProvider_WholeName | 保険の制度名称 | 国保 | |
9-5-5 | HealthInsuredPerson_Symbol | 記号 | 123 | |
9-5-6 | HealthInsuredPerson_Number | 番号 | 456 | |
9-5-7 | PublicInsurance_Information | 公費情報(繰り返し 4) | ||
9-5-7-1 | PublicInsurance_Class | 公費の種類 | 010 | |
9-5-7-2 | PublicInsurance_Name | 公費の制度名称 | 感37の2 | |
9-5-7-3 | PublicInsurer_Number | 負担者番号 | 10131142 | |
9-5-7-4 | PublicInsuredPerson_Number | 受給者番号 | 1234567 | |
9-6 | Cd_Information | 負担額情報 | ||
9-6-1 | Ac_Money | 請求金額 | 3410 | |
9-6-2 | Ai_Money | 保険適用金額 負担金額(円)の保険分 | 0 | |
9-6-3 | Oe_Money | 自費金額 負担金額(円)の自費分 + その他自費のその他計の合計 | 1000 | |
9-6-4 | Om_Smoney | 老人一部負担金 (ゼロは非表示) | ||
9-6-5 | Pi_Smoney | 公費一部負担金 (ゼロは非表示) | 2410 | |
9-6-6 | Ml_Smoney | 食事・生活療養負担金 | 0 | |
9-6-7 | Lsi_Total_Money | 労災合計金額 労災自賠責保険適用分(円)の集計値 (初診 + 再診 + 指導 + その他) (ゼロは非表示) | ||
9-6-8 | Dis_Money | 減免金額(ゼロは非表示) | ||
9-7 | Ac_Point_Information | 請求点数 | ||
9-7-1 | Ac_Ttl_Point | 合計点数 保険分の合計点数 | 4822 | |
9-7-2 | Ac_Point_Detail | 点数詳細 (繰り返し 16) | ||
9-7-2-1 | AC_Point_Name | 名称 | 初・再診料 | ※1 |
9-7-2-2 | AC_Point | 点数 | 0 | |
9-8 | Ml_Cost | 食事・生活療養費 | 0 | |
9-9 | Ml_Room_Charge | 室料差額 | 追加 (2022-08-29) | |
9-10 | Ml_Tax_In_Room_Charge | 室料差額消費税−再掲 | 追加 (2022-08-29) |
※1:療養担当手当(16)は、点数ゼロは編集なし。
初診・再診料〜入院料は、点数ゼロを編集。
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/hsacsimulatev2")
#
# 1.患者番号 Patient_ID (REQUIRED)
# 2.退院日 Discharge_Date (IMPLIED)
#
# REQUIRED : 必須 IMPLIED : 任意
#
BODY = <<EOF
<data>
<private_objects type="record">
<Patient_ID type="string">12</Patient_ID>
<Discharge_Date type="string">2013-11-20</Discharge_Date>
</private_objects>
</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
}
エラーメッセージ一覧
エラーコード | エラーメッセージ | 備考 |
---|---|---|
00 | 処理終了 | |
01 | 退院日の設定に誤りがあります | |
02 | 患者番号の設定に誤りがあります | |
03 | 入院情報が取得できません | |
04 | 退院登録済みの患者です | |
05 | 請求開始日>退院日です | |
06 | 請求期間の月数が2か月を超えています | |
07 | 負担金計算に失敗しました。保険組合せの有効期間が切れています | 左のエラーメッセージは一例になります。 このエラーに該当した場合に返却されるエラーメッセージは「負担金計算に失敗しました。 + 詳細なエラー内容」になります。 詳細なエラー内容が無い場合は「負担金計算に失敗しました」のエラーメッセージを返却します。 |
89 | 職員情報が取得できません | |
医療機関情報が取得できません | ||
システム日付が取得できません | ||
患者番号構成情報が取得できません | ||
グループ医療機関が不整合です。処理を終了して下さい | ||
システム項目が設定できません | ||
92 | 診療年月は平成20年(2008年)4月以降を指定してください | |
97 | 送信内容に誤りがあります | |
98 | 送信内容の読込ができませんでした | |
99 | ユーザIDが未登録です | |
それ以外 | 返却情報の編集でエラーが発生しました |