食事登録
メニュー
更新履歴
2018-05-28 「概要」に「入院会計自動作成について」、「食事継続指定について」を追加。
(Ver5.0.0以降のみ)「リクエスト一覧」に項目を追加。
2018-03-26 「レスポンス一覧」の項目を修正。
2017-12-20 「レスポンス一覧」を入院患者食事等情報(2017-12-20時点)と同じレイアウトとなるように修正。
2017-11-27 「概要」に入院会計が作成されていない診療日のリクエストが送信された場合の説明を追加。
2017-03-14 「エラーメッセージ一覧」を追加。
2016-04-18 「リクエスト一覧」の項目を修正。
「レスポンス一覧」の項目を修正。
概要
POSTメソッドにより食事登録を行います。
日レセ Ver.4.7.0[第46回パッチ適用] 以降
リクエストおよびレスポンスデータはxml2形式となります。
入院会計自動作成について
入院会計が作成されていない診療日のリクエストが送信された場合、入院会計を作成後登録を行います。
※ リクエストの診療日がシステム日付の属する診療年月からその3ヶ月後の診療年月の間に含まれる場合に限ります。
例) 入院日 :平成29年8月20日
作成済み入院会計 :平成29年8月〜平成29年10月
システム日付 :平成29年11月1日
登録可能期間 平成29年8月20日〜平成30年2月28日
(11月から2月はリクエスト時に診療日の属する診療年月の入院会計を作成)
※ 外泊、食事が未設定の入院会計を作成します。
※ 前月以前の入院会計が未作成の場合、入院会計作成APIより入院会計の作成を行ってください。
※ 入院会計の作成状況は入院会計未作成チェックAPIより確認が可能です。
食事継続指定について
リクエスト項目の食事継続区分(Meal_SameAfter)に"1"が設定されている場合、診療日以降の食事の種類をリクエストの設定で登録を行います。
既に登録済みの翌月以降の食事の種類についてもリクエストの設定で上書きします。新規で会計を作成する場合も設定内容に従います。
例)朝食を5/15日以降を特別食とする場合
<data>
<private_objects type ="record">
<Request_Number type ="string">4</Request_Number>
<Patient_ID type ="string">1</Patient_ID>
<Admission_Date type ="string">2018-05-07</Admission_Date>
<Perform_Date type ="string">2018-05-15</Perform_Date>
<Meal_Information type ="array">
<Meal_Information_child type ="record">
<Meal_Time type ="string">01</Meal_Time>
<Meal_Type type ="string">2</Meal_Type>
<Meal_SameAfter type ="string">1</Meal_SameAfter>
</Meal_Information_child>
</Meal_Information>
</private_objects>
</data>
複数日指定(Meal_Dates)での指定も可能
<data>
<private_objects type ="record">
<Request_Number type ="string">4</Request_Number>
<Patient_ID type ="string">1</Patient_ID>
<Admission_Date type ="string">2018-05-07</Admission_Date>
<Perform_Date type ="string">2018-05-07</Perform_Date>
<Meal_Information type ="array">
<Meal_Information_child type ="record">
<Meal_Time type ="string">01</Meal_Time>
<Meal_Type type ="string">2</Meal_Type>
<Meal_Dates type ="string">*/15</Meal_Dates>
<Meal_SameAfter type ="string">1</Meal_SameAfter>
</Meal_Information_child>
</Meal_Information>
</private_objects>
</data>
※ 食事継続区分に"1"が設定された場合、日レセの入退院登録業務より設定する食事の種類をAPIより"C"(個別指示)として更新します。
個別指示の設定では、食事の種類を食事時間毎に指定可能とし、食事継続区分に"1"の設定があった食事時間はリクエストに設定された食事の種類を登録します。
食事の種類が"C"(個別指示)または、"B"(変更なし)の場合、新規で会計を作成する際に食事の時間毎の設定を参照して食事の設定を行います。
(入退院登録業務より[転科転棟転室]処理を食事の変更を行わない指定で行った場合、"C"(個別指示)が"B"(変更なし)に変更されます。)
※ 入退院登録業務の食事の種類の登録状況はAPI[入院患者基本情報取得]より参照可能です。
※ 食事継続区分の設定は最新の入院情報についてのみ有効とします。
※ 更新対象となる入院会計が12ヶ月を超える場合はエラーを返却します。
テスト方法
- 参考提供されている sample_hsacctmod_v2_shokuji.rb 内の変数HOST等を接続環境に合わせます。
- sample_hsacctmod_v2_shokuji.rb 内の患者番号等を指定します。
- ruby sample_hsacctmod_v2_shokuji.rb により接続。
リクエスト(POSTリクエスト)サンプル
POST : /orca31/hsacctmodv2
Request_Number:
4: 食事登録
Content-Type: application/xml
application/xml の場合の文字コードは UTF-8 とします。
<data>
<private_objects type="record">
<Request_Number type="string">4</Request_Number>
<Patient_ID type="string">12</Patient_ID>
<Admission_Date type="string">2014-06-03</Admission_Date>
<Perform_Date type="string"></Perform_Date>
<Meal_Information type="array">
<Meal_Information_child type="record">
<Meal_Time type="string">01</Meal_Time>
<Meal_Type type="string">0</Meal_Type>
<Meal_Dates type="string">*/3-30</Meal_Dates>
</Meal_Information_child>
<Meal_Information_child type="record">
<Meal_Time type="string">02</Meal_Time>
<Meal_Type type="string">1</Meal_Type>
<Meal_Dates type="string">*/3-30</Meal_Dates>
</Meal_Information_child>
<Meal_Information_child type="record">
<Meal_Time type="string">03</Meal_Time>
<Meal_Type type="string">2</Meal_Type>
<Meal_Dates type="string">*/3-30</Meal_Dates>
</Meal_Information_child>
</Meal_Information>
</private_objects>
</data>
処理概要
食事登録リクエストにより指定患者の食事登録処理を行います。
レスポンスサンプル
<xmlio2>
<private_objects type="record">
<Information_Date type="string">2014-06-11</Information_Date>
<Information_Time type="string">17:27:54</Information_Time>
<Api_Results type="array">
<Api_Results_child type="record">
<Api_Result type="string">00</Api_Result>
</Api_Results_child>
</Api_Results>
<Request_Number type="record">
<Label type="string">リクエスト番号</Label>
<Data type="string">4</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>
<Admission_Discharge_Date type="array">
<Admission_Discharge_Date_child type="record">
<Admission_Date type="string">2014-06-03</Admission_Date>
<Discharge_Date type="string">9999-12-31</Discharge_Date>
</Admission_Discharge_Date_child>
</Admission_Discharge_Date>
<Perform_Month type="string">2014-06</Perform_Month>
<Monthly_Information type="array">
<Monthly_Information_child type="record">
<Perform_Date type="string">2014-06-03</Perform_Date>
<Department_Code type="record">
<Label type="string">診療科</Label>
<Data type="string">10</Data>
<Name type="string">外科</Name>
</Department_Code>
<Ward_Number type="record">
<Label type="string">病棟番号</Label>
<Data type="string">01</Data>
</Ward_Number>
<Ward_Name type="record">
<Label type="string">病棟名</Label>
<Data type="string">北病棟</Data>
</Ward_Name>
<Room_Number type="record">
<Label type="string">病室番号</Label>
<Data type="string">101</Data>
</Room_Number>
<Insurance_Combination_Number type="string">0002</Insurance_Combination_Number>
<Patient_Status type="record">
<Label type="string">外泊・他医療機関受診情報等</Label>
<Data type="string">00</Data>
<Name type="string">入院中</Name>
</Patient_Status>
<Morning_Meal type="record">
<Label type="string">朝食</Label>
<Data type="string">00</Data>
<Name type="string">食事なし</Name>
</Morning_Meal>
<Lunch_Meal type="record">
<Label type="string">昼食</Label>
<Data type="string">01</Data>
<Name type="string">食事あり</Name>
</Lunch_Meal>
<Evening_Meal type="record">
<Label type="string">夕食</Label>
<Data type="string">02</Data>
<Name type="string">食事あり(特別食)</Name>
</Evening_Meal>
<Room_Charge type="record">
<Label type="string">室料差額</Label>
<Data type="string"> 1000</Data>
<Name type="string">円</Name>
</Room_Charge>
</Monthly_Information_child>
<Monthly_Information_child type="record">
<Perform_Date type="string">2014-06-04</Perform_Date>
<Department_Code type="record">
<Label type="string">診療科</Label>
<Data type="string">10</Data>
<Name type="string">外科</Name>
</Department_Code>
<Ward_Number type="record">
<Label type="string">病棟番号</Label>
<Data type="string">01</Data>
</Ward_Number>
<Ward_Name type="record">
<Label type="string">病棟名</Label>
<Data type="string">北病棟</Data>
</Ward_Name>
<Room_Number type="record">
<Label type="string">病室番号</Label>
<Data type="string">101</Data>
</Room_Number>
<Insurance_Combination_Number type="string">0002</Insurance_Combination_Number>
<Patient_Status type="record">
<Label type="string">外泊・他医療機関受診情報等</Label>
<Data type="string">00</Data>
<Name type="string">入院中</Name>
</Patient_Status>
<Morning_Meal type="record">
<Label type="string">朝食</Label>
<Data type="string">00</Data>
<Name type="string">食事なし</Name>
</Morning_Meal>
<Lunch_Meal type="record">
<Label type="string">昼食</Label>
<Data type="string">01</Data>
<Name type="string">食事あり</Name>
</Lunch_Meal>
<Evening_Meal type="record">
<Label type="string">夕食</Label>
<Data type="string">02</Data>
<Name type="string">食事あり(特別食)</Name>
</Evening_Meal>
<Room_Charge type="record">
<Label type="string">室料差額</Label>
<Data type="string"> 1000</Data>
<Name type="string">円</Name>
</Room_Charge>
</Monthly_Information_child>
・
・
・
</Monthly_Information>
<Insurance_Information type="array">
<Insurance_Information_child type="record">
<Insurance_Combination_Number type="string">0002</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">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>
</Insurance_Information_child>
</Insurance_Information>
</private_objects>
</xmlio2>
リクエスト一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Save_Request | リクエスト保持区分 0:残さない 1:残す | 1 | 未設定時初期値[0]を設定 (日レセにリクエストの情報を保持するか否か指定) |
2 | Request_Number | リクエスト番号 4:食事登録 | 4 | 必須 |
3 | Patient_ID | 患者番号 | 12 | 必須(入院登録、入院取消) |
4 | Admission_Date | 入院日 | 2014-06-03 | 必須(入院登録、入院取消) |
5 | Perform_Date | 診療日 | 2014-06-03 | 未設定時はシステム日付の属する年月日を設定 |
6 | Meal_Information | 食事情報 (繰り返し 3) | 1〜3に前詰めで設定 | |
6-1 | Meal_Time | 食事時間 01:朝 02:昼 03:夕 | 01 | 必須 |
6-2 | Meal_Type | 食事の種類 0:食止め 1:一般食 2:特別食 3:流動食 | 1 | 必須 変更(2016-04-18) |
6-3 | Meal_Dates | 複数日指定 (*/の後に日付) | */1-3,5 | 未入力時は診療日の食事のみ更新 |
6-4 | Meal_SameAfter | 食事継続区分 0:継続指定なし 1:継続指定あり | 未設定時初期値[0]を設定 Ver5.0.0以降のみ追加 (2018-05-28) |
レスポンス一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Information_Date | 実施日 | 2014-06-11 | |
2 | Information_Time | 実施時間 | 17:27:54 | |
3 | Api_Results | 結果情報 (繰り返し 10) | ||
3-1 | Api_Result | 結果コード(ゼロ以外エラー) | 00 | |
3-2 | Api_Result_Message | エラーメッセージ | 処理終了 | |
4 | Request_Number | リクエスト番号 | ||
4-1 | Label | 内容の名称を返却 | リクエスト番号 | |
4-2 | Data | リクエスト番号を返却 | 4 | |
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 | Admission_Discharge_Date | 診療年月にかかる入退院日情報 (繰り返し 5) | ||
6-1 | Admission_Date | 入院日 | 2014-06-03 | |
6-2 | Discharge_Date | 退院日 | 9999-12-31 | |
7 | Perform_Month | 診療年月 | 2014-06 | |
8 | Monthly_Information | カレンダー情報 (繰り返し 31) | ||
8-1 | Perform_Date | 診療日 | 2014-06-03 | |
8-2 | Department_Code | 診療科 | ||
8-2-1 | Label | 内容の名称を返却 | 診療科 | |
8-2-2 | Data | 診療科コードを返却 | 10 | |
8-2-3 | Name | 診療科の名称を返却 | 外科 | |
8-3 | Ward_Number | 病棟番号 | ||
8-3-1 | Label | 内容の名称を返却 | 病棟番号 | |
8-3-2 | Data | 病棟番号を返却 | 01 | |
8-4 | Ward_Name | 病棟名 | ||
8-4-1 | Label | 内容の名称を返却 | 病棟名 | |
8-4-2 | Data | 病棟名を返却 | 北病棟 | |
8-5 | Room_Number | 病室番号 | ||
8-5-1 | Label | 内容の名称を返却 | 病室番号 | |
8-5-2 | Data | 病室番号を返却 | 101 | |
8-6 | Insurance_Combination_Number | 保険組合せ番号 | 0002 | |
8-7 | Patient_Status | 外泊・他医療機関受診情報等 | ||
8-7-1 | Label | 内容の名称を返却 | 外泊・他医療機関受診情報等 | |
8-7-2 | Data | コード | 00 | |
8-7-3 | Name | 名称 (コード:名称) (Data:Name) 診療年月が平成30年4月以降の場合 00:入院中 01:外泊 02:治療の為の外泊 03:選定入院中の外泊 04:他医療機関受診40%減算 05:他医療機関受診10%減算 06:他医療機関受診20%減算 08:特定時間退院減算 09:特定曜日入退院減算 13:特定曜日入退院減算+他医療機関受診10%減算 14:他医療機関受診5%減算 15:他医療機関受診35%減算 16:他医療機関受診15%減算 17:特定曜日入退院減算+他医療機関受診5%減算 診療年月が平成30年3月以前の場合 00:入院中 01:外泊 02:治療の為の外泊 03:選定入院中の外泊 04:他医療機関受診40%減算 05:他医療機関受診10%減算 06:他医療機関受診20%減算 08:特定時間退院減算 09:特定曜日入退院減算 13:特定曜日入退院減算+他医療機関受診10%減算 | 入院中 | 変更(2018-03-26) |
8-8 | Morning_Meal | 朝食 | ||
8-8-1 | Label | 内容の名称を返却 | 朝食 | |
8-8-2 | Data | コードを返却 | 00 | |
8-8-3 | Name | 内容を返却 (Data:Name) 00:食事なし 01:食事あり 02:食事あり(特別食) 03:食事あり(流動食) | 食事なし | 変更(2016-04-18) |
8-9 | Lunch_Meal | 昼食 | ||
8-9-1 | Label | 内容の名称を返却 | 昼食 | |
8-9-2 | Data | コードを返却 | 01 | |
8-9-3 | Name | 内容を返却 (Data:Name) 00:食事なし 01:食事あり 02:食事あり(特別食) 03:食事あり(流動食) | 食事あり | 変更(2016-04-18) |
8-10 | Evening_Meal | 夕食 | ||
8-10-1 | Label | 内容の名称を返却 | 夕食 | |
8-10-2 | Data | コードを返却 | 02 | |
8-10-3 | Name | 内容を返却 (Data:Name) 00:食事なし 01:食事あり 02:食事あり(特別食) 03:食事あり(流動食) | 食事あり(特別食) | 変更(2016-04-18) |
8-11 | Room_Charge | 室料差額 | ||
8-11-1 | Label | 内容の名称を返却 | 室料差額 | |
8-11-2 | Data | 室料差額を返却 | 1000 | |
8-11-3 | Name | 単位を返却 (円) | 円 | |
9 | Insurance_Information | 保険組合せ情報 (繰り返し 10) | ||
9-1 | Insurance_Combination_Number | 保険組合せ番号 | 0002 | |
9-2 | InsuranceProvider_Class | 保険の種類 | 060 | |
9-3 | InsuranceProvider_Number | 保険者番号 | 138057 | |
9-4 | InsuranceProvider_WholeName | 保険の制度名称 | 国保 | |
9-5 | HealthInsuredPerson_Symbol | 記号 | 123 | |
9-6 | HealthInsuredPerson_Number | 番号 | 456 | |
9-7 | PublicInsurance_Information | 公費情報(繰り返し 4) | ||
9-7-1 | PublicInsurance_Class | 公費の種類 | 019 | |
9-7-2 | PublicInsurance_Name | 公費の制度名称 | 原爆一般 | |
9-7-3 | PublicInsurer_Number | 負担者番号 | 19113760 | |
9-7-4 | PublicInsuredPerson_Number | 受給者番号 | 1234567 |
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_hsacctmod_v2_shokuji.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/hsacctmodv2")
BODY = <<EOF
<data>
<private_objects type="record">
<Request_Number type="string">4</Request_Number>
<Patient_ID type="string">1</Patient_ID>
<Admission_Date type="string">2014-05-01</Admission_Date>
<Perform_Date type="string">2014-05-01</Perform_Date>
<Meal_Information type="array">
<Meal_Information_child type="record">
<Meal_Time type="string">01</Meal_Time>
<Meal_Type type="string">0</Meal_Type>
</Meal_Information_child>
<Meal_Information_child type="record">
<Meal_Time type="string">02</Meal_Time>
<Meal_Type type="string">1</Meal_Type>
</Meal_Information_child>
<Meal_Information_child type="record">
<Meal_Time type="string">03</Meal_Time>
<Meal_Type type="string">2</Meal_Type>
</Meal_Information_child>
</Meal_Information>
</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/tec/api/hospentry.html#errmsg)を参照。