退院登録

メニュー

更新履歴

2018-01-23 (Ver5.0.0以降のみ)「リクエスト一覧」に項目を追加。
(Ver5.0.0以降のみ)「レスポンス一覧(退院登録)」に項目を追加。

2017-03-14 「エラーメッセージ一覧」を追加。

概要

POSTメソッドにより入院患者の退院登録を行います。

日レセ Ver.4.7.0[第46回パッチ適用] 以降

リクエストおよびレスポンスデータはxml2形式となります。

テスト方法

  1. 参考提供されている sample_hsptinfmod_v2_taiin.rb 内の変数HOST等を接続環境に合わせます。
  2. sample_hsptinfmod_v2_taiin.rb 内の患者番号等を指定します。
  3. ruby sample_hsptinfmod_v2_taiin.rb により接続。

リクエスト(POSTリクエスト)サンプル

POST : /orca31/hsptinfmodv2

Request_Number:
02: 退院登録
07: 退院取消

Content-Type: application/xml

application/xml の場合の文字コードは UTF-8 とします。

<data>
<private_objects type="record">
<Patient_ID type="string">12</Patient_ID>
<Request_Number type="string">02</Request_Number>
<Admission_Date type="string">2014-06-03</Admission_Date>
<Discharge_Date type="string">2014-06-04</Discharge_Date>
<Discharge_Reason type="string">01</Discharge_Reason>
</private_objects>
</data>

処理概要

退院登録リクエストにより入院患者の退院処理を行います。

リクエスト一覧

番号 項目名 内容 備考
1 Save_Request リクエスト保持区分
 0:残さない
 1:残す
1 未設定時初期値[0]を設定
(日レセにリクエストの情報を保持するか否かを指定)
2 Request_Number リクエスト番号
 02:退院登録
 07:退院取消
02 必須
3 Force_Update 強制更新
 False:歴月が2ヶ月を超える退院請求をエラーとする。
 True:歴月が2ヶ月を超える退院請求をエラーとしない。
False 未設定時初期値[False]を設定
※1

Ver5.0.0以降のみ追加
(2018-01-23)
4 Patient_ID 患者番号 12 必須(退院登録、退院取消)
5 Admission_Date 入院日 2014-06-03 必須(退院登録、退院取消)
6 Discharge_Date 退院日 2014-06-04 必須(退院登録)
7 Discharge_Reason 退院事由 01 システム管理[5013 退院事由情報]に登録のある退院事由コードを設定

※1:強制更新に"True"を設定し、入院日、又は前回定期請求から歴月で2ヶ月を超える場合、退院請求では退院日の属する月の前月の1日からの退院請求を作成します。このため、必ずそれ以前の請求を定期請求の個別処理で行ってください。
  (例)1月10日入院し、3月10日に退院した場合(強制更新="True"、定期請求未実施)
     → 退院請求期間:2月1日~3月10日
       1月中の請求は定期請求の個別処理を実行して行う。

レスポンス一覧(退院登録)

番号 項目名 内容 備考
1 Information_Date 実施日 2014-06-04
2 Information_Time 実施時間 11:04:57
3 Api_Results 結果情報
(繰り返し 10)
3-1 Api_Result 結果コード(ゼロ以外エラー) 0000
3-2 Api_Result_Message エラーメッセージ 処理終了
4 Request_Number リクエスト番号
4-1 Label 内容の名称を返却 リクエスト番号
4-2 Data リクエスト番号を返却 02
4-3 Name リクエスト番号の名称を返却 退院登録
5 Start_Date 請求開始日
(入院日または前回定期請求の翌日)
2014-06-03
6 End_Date 請求終了日
(リクエストの退院日)
2014-06-04
7 Unbilled_Period_Start_Date 未請求期間開始日 強制更新による定期請求未実施期間開始日

Ver5.0.0以降のみ追加
(2018-01-23)
8 Unbilled_Period_End_Date 未請求期間終了日 強制更新による定期請求未実施期間終了日

Ver5.0.0以降のみ追加
(2018-01-23)
9 Patient_Information 患者情報
9-1 Patient_ID 患者番号 00012
9-2 WholeName 漢字氏名 日医 太郎
9-3 WholeName_inKana カナ氏名 ニチイ タロウ
9-4 BirthDate 生年月日 1975-01-01
9-5 Sex 性別(1:男性、2:女性) 1
10 History_Number 履歴番号 001
11 Admission_Date 入院日 2014-06-03
12 Acsimulate_Information 請求情報
(繰り返し 13)
(診療年月順)
12-1 Information_Class 請求情報種別
12-1-1 Label 内容の名称を返却 請求情報種別
12-1-2 Data 請求情報種別コードを返却 0
12-1-3 Name 請求情報種別の名称を返却
 (Data:Name、
  0:明細、
  1:月毎合計、
  2:総合計 )
明細
12-2 Perform_Month 診療年月
(総合計は表示なし)
2014-06
12-3 Invoice_Number 伝票番号
(月合計、総合計は表示なし)
0000002
12-4 Department_Code 診療科コード
(月合計、総合計は表示なし)
01
12-5 Department_Name 診療科名称
(月合計、総合計は表示なし)
内科
12-6 HealthInsurance_Information 保険組合せ情報
(月合計、総合計は表示なし)
12-6-1 Insurance_Combination_Number 保険組合せ番号 0001
12-6-2 InsuranceProvider_Class 保険の種類 060
12-6-3 InsuranceProvider_Number 保険者番号 138057
12-6-4 InsuranceProvider_WholeName 保険の制度名称 国保
12-6-5 HealthInsuredPerson_Symbol 記号 123
12-6-6 HealthInsuredPerson_Number 番号 456
12-6-7 PublicInsurance_Information 公費情報(繰り返し 4)
12-6-7-1 PublicInsurance_Class 公費の種類 019
12-6-7-2 PublicInsurance_Name 公費の制度名称 原爆一般
12-6-7-3 PublicInsurer_Number 負担者番号 19113760
12-6-7-4 PublicInsuredPerson_Number 受給者番号 1234567
12-7 Cd_Information 負担額情報
12-7-1 Ac_Money 請求金額 7800
12-7-2 Ai_Money 保険適用金額
 負担金額(円)の保険分
5800
12-7-3 Oe_Money 負担金額(円)の保険分
 負担金額(円)の自費分 + その他自費のその他の合計
2000
12-7-4 Om_Smoney 老人一部負担金
(ゼロは非表示)
12-7-5 Pi_Smoney 公費一部負担金
(ゼロは非表示)
12-7-6 Ml_Smoney 食事・生活療養負担金 0
12-7-7 Lsi_Total_Money 労災合計金額
 労災自賠責保険適用分(円)の集計値
  (初診 + 再診 + 指導 + その他)
(ゼロは非表示)
12-7-8 Dis_Money 減免金額
(ゼロは非表示)
12-8 Ac_Point_Information 請求点数
12-8-1 Ac_Ttl_Point 合計点数 1932
12-8-2 Ac_Point_Detail 点数詳細
(繰り返し 16)
12-8-2-1 AC_Point_Name 名称 初・再診料 ※1
12-8-2-2 AC_Point 点数 0
12-9 Ml_Cost 食事・生活療養費 0

※:療養担当手当(16)は、点数ゼロは編集しません。
   初診・再診料~入院料は、点数ゼロを編集します。

レスポンスサンプル

<xmlio2>
<private_objects type="record">
<Information_Date type="string">2014-06-04</Information_Date>
<Information_Time type="string">11:04:57</Information_Time>
<Api_Results type="array">
<Api_Results_child type="record">
<Api_Result type="string">0000</Api_Result>
<Api_Result_Message type="string">処理終了</Api_Result_Message>
</Api_Results_child>
</Api_Results>
<Request_Number type="record">
<Label type="string">リクエスト番号</Label>
<Data type="string">02</Data>
<Name type="string">退院登録</Name>
</Request_Number>
<Start_Date type="string">2014-06-03</Start_Date>
<End_Date type="string">2014-06-04</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>
<History_Number type="string">001</History_Number>
<Admission_Date type="string">2014-06-03</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">2014-06</Perform_Month>
<Invoice_Number type="string">0000002</Invoice_Number>
<Department_Code type="string">01</Department_Code>
<Department_Name type="string">内科</Department_Name>
<HealthInsurance_Information type="record">
<Insurance_Combination_Number type="string">0001</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>
</HealthInsurance_Information>
<Cd_Information type="record">
<Ac_Money type="string"> 7800</Ac_Money>
<Ai_Money type="string"> 5800</Ai_Money>
<Oe_Money type="string"> 2000</Oe_Money>
<Ml_Smoney type="string"> 0</Ml_Smoney>
</Cd_Information>
<Ac_Point_Information type="record">
<Ac_Ttl_Point type="string"> 1932</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"> 1932</AC_Point>
</Ac_Point_Detail_child>
</Ac_Point_Detail>
</Ac_Point_Information>
<Ml_Cost type="string"> 0</Ml_Cost>
</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">2014-06</Perform_Month>
<Cd_Information type="record">
<Ac_Money type="string"> 7800</Ac_Money>
<Ai_Money type="string"> 5800</Ai_Money>
<Oe_Money type="string"> 2000</Oe_Money>
<Ml_Smoney type="string"> 0</Ml_Smoney>
</Cd_Information>
<Ac_Point_Information type="record">
<Ac_Ttl_Point type="string"> 1932</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"> 1932</AC_Point>
</Ac_Point_Detail_child>
</Ac_Point_Detail>
</Ac_Point_Information>
<Ml_Cost type="string"> 0</Ml_Cost>
</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"> 7800</Ac_Money>
<Ai_Money type="string"> 5800</Ai_Money>
<Oe_Money type="string"> 2000</Oe_Money>
<Ml_Smoney type="string"> 0</Ml_Smoney>
</Cd_Information>
<Ac_Point_Information type="record">
<Ac_Ttl_Point type="string"> 1932</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"> 1932</AC_Point>
</Ac_Point_Detail_child>
</Ac_Point_Detail>
</Ac_Point_Information>
<Ml_Cost type="string"> 0</Ml_Cost>
</Acsimulate_Information_child>
</Acsimulate_Information>
</private_objects>
</xmlio2>

レスポンス一覧(退院取消)

番号 項目名 内容 備考
1 Information_Date 実施日 2014-06-06
2 Information_Time 実施時間 11:21:55
3 Api_Results 結果情報
(繰り返し 10)
3-1 Api_Result 結果コード(ゼロ以外エラー) 0000
3-2 Api_Result_Message エラーメッセージ 処理終了
4 Request_Number リクエスト番号
4-1 Label 内容の名称を返却 リクエスト番号
4-2 Data リクエスト番号を返却 07
4-3 Name リクエスト番号の名称を返却 退院取消
5 Patient_Information 患者情報
5-1 Patient_ID 患者番号 00012
5-2 WholeName 漢字氏名 日医 太郎
5-3 WholeName_inKana カナ氏名 ニチイ タロウ
5-4 BirthDate 生年月日 1975-01-01
5-5 Sex 性別(1:男性、2:女性) 1
6 History_Number 履歴番号 001
7 Admission_Date 入院日 2014-06-03

レスポンスサンプル

<xmlio2>
<private_objects type="record">
<Information_Date type="string">2014-06-06</Information_Date>
<Information_Time type="string">11:21:55</Information_Time>
<Api_Results type="array">
<Api_Results_child type="record">
<Api_Result type="string">0000</Api_Result>
<Api_Result_Message type="string">処理終了</Api_Result_Message>
</Api_Results_child>
</Api_Results>
<Request_Number type="record">
<Label type="string">リクエスト番号</Label>
<Data type="string">07</Data>
<Name type="string">退院取消</Name>
</Request_Number>
<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>
<Hospital_Stay_Infomation type="record">
<History_Number type="string">001</History_Number>
<Admission_Date type="string">2014-06-03</Admission_Date>
</Hospital_Stay_Infomation>
</private_objects>
</xmlio2>

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_hsptinfmod_v2_taiin.rb

#!/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("/orca31/hsptinfmodv2")
BODY = <<EOF
<data>
<private_objects type="record">
<Patient_ID type="string">1</Patient_ID>
<Request_Number type="string">02</Request_Number>
<Admission_Date type="string">2014-05-01</Admission_Date>
<Discharge_Date type="string">2014-05-22</Discharge_Date>
<Discharge_Reason type="string">01</Discharge_Reason>
</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
}

エラーメッセージ一覧

入院登録(https://www.orca.med.or.jp/receipt/users/tec/api/hospentry.html#errmsg)を参照。