指定された日付の受付一覧返却
メニュー
- 更新履歴
- 概要
- テスト方法
- リクエスト(POSTリクエスト)サンプル
- レスポンスサンプル
- リクエスト一覧
- レスポンス一覧
- Rubyによるリクエストサンプルソース
- C#によるリクエストサンプルソース
- エラーメッセージ一覧
更新履歴
2023-02-27 「リクエスト一覧」に項目(Sel_Offset)を追加。
2021-01-27 「レスポンス一覧」に項目を追加。
2019-06-25 「リクエスト一覧」「レスポンス一覧」に項目を追加
2018-11-27 「レスポンス一覧」に項目を追加
2017-04-26 「レスポンス一覧」に項目を追加
2016-10-20 「レスポンスサンプル」に項目を追加
「レスポンス一覧」に項目を追加
2014-06-02 「エラーメッセージ一覧」を追加
2013-08-27 「レスポンス一覧」に項目(Acceptance_Id)を追加
概要
POSTメソッドによる受付一覧取得を行います。
リクエストおよびレスポンスデータはxml2形式になります。
テスト方法
- 参考提供されている sample_acceptlst_v2.rb 内の変数HOST等を接続環境に合わせます。
- sample_acceptlst_v2.rb 内の受付日等を接続先の日レセの環境に合わせます。
- ruby sample_acceptlst_v2.rb により接続。
リクエスト(POSTリクエスト)サンプル
POST : /api01rv2/acceptlstv2?class=01
class = 01 は受付中(会計待ち対象)
class = 02 は会計済(会計済み対象)
class = 03 は全受付対象
Content-Type: application/xml
application/xml の場合の文字コードは UTF-8 とします。
<data>
<acceptlstreq type="record">
<Acceptance_Date type="string">2012-12-05</Acceptance_Date>
<Department_Code type="string">01</Department_Code>
<Physician_Code type="string">10001</Physician_Code>
<Medical_Information type="string"></Medical_Information>
<Display_Order_Sort type="string">True</Display_Order_Sort>
</acceptlstreq>
</data>
処理概要
受付一覧リクエストにより指定日の受付一覧の情報を返却します。
処理詳細
- 受付日妥当性チェック
- 診療科コードの存在チェック(※)
- ドクターコードの存在チェック(※)
- 診療内容区分の存在チェック(※)
(※2,3,4の条件については、設定されていれば対象のもののみ返却します)
レスポンスサンプル
<xmlio2>
<acceptlstres type="record">
<Information_Date type="string">2011-03-13</Information_Date>
<Information_Time type="string">10:50:00</Information_Time>
<Api_Result type="string">00</Api_Result>
<Api_Result_Message type="string">処理終了</Api_Result_Message>
<Reskey type="string">Patient Info</Reskey>
<Acceptance_Date type="string">2011-03-15</Acceptance_Date>
<Acceptlst_Information type="array">
<Acceptlst_Information_child type="record">
<Acceptance_Time type="string">15:30:00</Acceptance_Time>
<Acceptance_Id type="string">00001</Acceptance_Id>
<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>
<Medical_Information type="string">01</Medical_Information>
<Claim_Infometion type="string">0</Claim_Infometion>
<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>
<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">01</HealthInsuredPerson_Symbol>
<HealthInsuredPerson_Number type="string">1234567</HealthInsuredPerson_Number>
<HealthInsuredPerson_Assistance type="string">3</HealthInsuredPerson_Assistance>
<RelationToInsuredPerson type="string">1</RelationToInsuredPerson>
<HealthInsuredPerson_WholeName type="string">日医 太郎</HealthInsuredPerson_WholeName>
<Certificate_StartDate type="string">2010-05-01</Certificate_StartDate>
<Certificate_ExpiredDate type="string">9999-12-31</Certificate_ExpiredDate>
<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">1234566</PublicInsuredPerson_Number>
<Rate_Admission type="string">0.05</Rate_Admission>
<Money_Admission type="string"> 0</Money_Admission>
<Rate_Outpatient type="string">0.05</Rate_Outpatient>
<Money_Outpatient type="string"> 0</Money_Outpatient>
<Certificate_IssuedDate type="string">2010-05-01</Certificate_IssuedDate>
<Certificate_ExpiredDate type="string">9999-12-31</Certificate_ExpiredDate>
</PublicInsurance_Information_child>
</PublicInsurance_Information>
</HealthInsurance_Information>
<Patient_Memo_Information type="record">
<Patient_Memo_Department_00 type="string">3</Patient_Memo_Department_00>
<Patient_Memo_Department type="string">2</Patient_Memo_Department>
</Patient_Memo_Information>
<Display_Order type="record">
<Display_Order_Number type="string">9999</Display_Order_Number>
</Display_Order>
</Acceptlst_Information_child>
</Acceptlst_Information>
</acceptlstres>
</xmlio2>
リクエスト一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Acceptance_Date | 受付日 | 2010-12-20 | |
2 | Department_Code | 診療科コード ※1 (01:内科) | 01 | ※2 |
3 | Physician_Code | ドクターコード | 10001 | ※2 |
4 | Medical_Information | 診療内容区分 ※3 (01:診察1、 02:薬のみ、 03:注射のみ、 04:検査のみ、 05:リハビリテーション、 06:健康診断、 07:予防注射、 99:該当なし) | 01 | ※2 |
5 | Display_Order_Sort | 受付画面順指示 | True | ※4 追加 (2019-06-25) |
6 | Sel_Offset | 開始位置 | 1500 | ※5 WebORCAのみ 追加 (2023-02-27) |
※1:システム管理マスタの診療科目情報の診療科コードを参照して下さい。
※2:設定があれば一致する受付を対象とし、未設定であれば全てを対象とします。
※3:システム管理マスタの診療内容情報の診療内容コードを参照して下さい。
※4:class=01 の時のみ有効、この値をTrue とした場合、受付画面(受付一覧)にて並びを変更した場合に、その並びで情報を返却します。
※5:class=03 の時のみ有効。
レスポンス一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Information_Date | 実施日 | 2011-03-13 | |
2 | Information_Time | 実施時間 | 10:50:00 | |
3 | Api_Result | 結果コード(ゼロ以外エラー) | 00 | |
4 | Api_Result_Message | エラーメッセージ | 処理終了 | |
5 | Reskey | Patient Info | ||
6 | Acceptance_Date | 受付日 | 2011-03-15 | |
7 | Acceptlst_Information | 受付一覧情報 (繰り返し 1000) ※WebORCAは1500 | ||
7-1 | Acceptance_Time | 受付時間 | 15:30:00 | |
7-2 | Acceptance_Id | 受付ID | 00001 | |
7-3 | Department_Code | 診療科コード ※4 (01:内科) | 01 | |
7-4 | Department_WholeName | 診療科名称 | 内科 | |
7-5 | Physician_Code | ドクターコード | 10001 | |
7-6 | Physician_WholeName | ドクター名 | 日本 一 | |
7-7 | Medical_Information | 診療内容区分 ※5 (01:診察1、 02:薬のみ、 03:注射のみ、 04:検査のみ、 05:リハビリテーション、 06:健康診断、 07:予防注射、 99:該当なし) | 01 | |
7-8 | Claim_Infometion | claim情報 | 0 | |
7-9 | Account_Time | 会計時間 ※6 | 15:50:00 |
|
7-10 | Appointment_Time | 予約時間 | 11:00:00 | 追加 (2017-04-26) |
7-11 | Appointment_Id | 予約ID | 02 | 追加 (2017-04-26) |
7-12 | Patient_Information | 患者基本情報 | ||
7-12-1 | Patient_ID | 患者番号 | 00012 | |
7-12-2 | WholeName | 患者氏名 | 日医 太郎 | |
7-12-3 | WholeName_inKana | 患者カナ氏名 | ニチイ タロウ | |
7-12-4 | BirthDate | 生年月日 | 1975-01-01 | |
7-12-5 | Sex | 性別 (1:男性、2:女性) | 1 | |
7-13 | HealthInsurance_Information | 保険組合せ情報 | ||
7-13-1 | Insurance_Combination_Number | 保険組合せ番号 | 0001 | 追加 (2016-10-20) |
7-13-2 | Insurance_Nondisplay | 保険組合せ非表示区分 (O:外来非表示、I:入院非表示、N:非表示無し) | O | 追加 (2017-04-26) |
7-13-3 | InsuranceProvider_Class | 保険の種類 | 060 | |
7-13-4 | InsuranceProvider_Number | 保険者番号 | 138057 | |
7-13-5 | InsuranceProvider_WholeName | 保険の制度名称 | 国保 | |
7-13-6 | HealthInsuredPerson_Symbol | 記号 | 01 | |
7-13-7 | HealthInsuredPerson_Number | 番号 | 1234567 | |
7-13-8 | HealthInsuredPerson_Branch_Number | 枝番 | 00 | 追加 (2021-01-27) |
7-13-9 | HealthInsuredPerson_Continuation | 継続区分 (1:継続療養、 2:任意継続) | ||
7-13-10 | HealthInsuredPerson_Assistance | 補助区分 (詳細については、「日医標準レセプトソフトデータベーステーブル定義書」を参照して下さい。) | 3 | |
7-13-11 | RelationToInsuredPerson | 本人家族区分 (1:本人、 2:家族) | 1 | |
7-13-12 | HealthInsuredPerson_WholeName | 被保険者名 | 日医 太郎 | |
7-13-13 | Certificate_StartDate | 適用開始日 | 2010-05-01 | |
7-13-14 | Certificate_ExpiredDate | 適用終了日 | 9999-12-31 | |
7-13-15 | PublicInsurance_Information | 公費情報(繰り返し 4) | ||
7-13-15-1 | PublicInsurance_Class | 公費の種類 | 010 | |
7-13-15-2 | PublicInsurance_Name | 公費の制度名称 | 感37の2 | |
7-13-15-3 | PublicInsurer_Number | 負担者番号 | 10131142 | |
7-13-15-4 | PublicInsuredPerson_Number | 受給者番号 | 1234566 | |
7-13-15-5 | Rate_Admission | 入院ー負担率(割) | 0.05 | |
7-13-15-6 | Money_Admission | 入院ー固定額 | 0 | |
7-13-15-7 | Rate_Outpatient | 外来ー負担率(割) | 0.05 | |
7-13-15-8 | Money_Outpatient | 外来ー固定額 | 0 | |
7-13-15-9 | Certificate_IssuedDate | 適用開始日 | 2010-05-01 | |
7-13-15-10 | Certificate_ExpiredDate | 適用終了日 | 9999-12-31 | |
7-14 | Patient_Memo_Information | メモ登録情報 | 追加 (2018-11-27) | |
7-14-1 | Patient_Memo_Department_00 | メモ登録区分(診療科=00) (1:メモ1のみの登録、 2:メモ2のみの登録、 3:メモ1,メモ2の登録) | 追加 (2018-11-27) | |
7-14-2 | Patient_Memo_Department | メモ登録区分 (1:メモ1のみの登録、 2:メモ2のみの登録、 3:メモ1,メモ2の登録) | 追加 (2018-11-27) | |
7-15 | Display_Order | 並び順情報 | 追加 (2019-06-25) | |
7-15-1 | Display_Order_Number | 画面上の並び順の値 | ※7、※8 追加 (2019-06-25) | |
7-15-2 | Display_Order_Mark | 並びを変更した場合は、「True」を設定 | ※7、※8 追加 (2019-06-25) |
※4:システム管理マスタの診療科目情報の診療科コードを参照して下さい。
※5:システム管理マスタの診療内容情報の診療内容コードを参照して下さい。
※6:class = 02:会計済(会計済み対象)、class = 03:全受付対象を指定時に返却
※7:当日、並びをまったく変更していない場合、各受付一覧情報にDisplay_Order_Numberは9999を返却し、Display_Order_Markは値なしのため返却しません。
※8:Display_Order_Mark=Trueとなるのは画面で並び順を変えた患者のみであり、例えば3番目の患者を1番目に移動した場合、その患者のみがDisplay_Order_Mark=True となり、以下を返却します。
<Display_Order type="record">
<Display_Order_Number type="string">1</Display_Order_Number>
<Display_Order_Mark type="string">True</Display_Order_Mark>
</Display_Order>
並びを変更していない患者は、Display_Order_Number のみ返却します。上の例の時、2番目の患者は以下を返却します。
<Display_Order type="record">
<Display_Order_Number type="string">2</Display_Order_Number>
</Display_Order>
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/acceptlstv2?class=01")
# class :01 受付中(会計待ち対象)
# class :02 会計済(会計済み対象)
# class :03 全受付対象
#
#
BODY = <<EOF
<data>
<acceptlstreq type="record">
<Acceptance_Date type="string">2012-12-05</Acceptance_Date>
<Department_Code type="string">01</Department_Code>
<Physician_Code type="string">10001</Physician_Code>
<Medical_Information type="string"></Medical_Information>
</acceptlstreq>
</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 }
C#によるリクエストサンプルソース
Windowsでの実行環境
- Microsoft Visual Studio 2008以降
- .NET Framework 2.0 SDK(C#コンパイラを含む.NET Frameworkの開発ツール)
(Microsoft Visual Studioに含まれています)
Ubuntuでの実行環境
- MonoDevelop 2.2(1.0でも実行可能)
- mono-gmcs(C#コンパイラ)
(MonoDevelopと一緒にインストールされます)
using System; using System.IO; using System.Net; using System.Text; namespace Acceptlst { class AcceptlstMain { public static void Main(string[] args) { string HOST = "localhost"; string PORT = "8000"; string USER = "ormaster"; string PASSWD = "ormaster"; string CONTENT_TYPE = "application/xml"; string URL = "http://" + HOST + ":" + PORT + "/api01rv2/acceptlstv2?class=01";
/* class = 01 は受付中(会計待ち対象) class = 02 は会計済(会計済み対象) class = 03 は全受付対象 1.受付日 Acceptance_Date (IMPLIED) 2.診療科コード Department_Code (IMPLIED) 3.ドクターコード Physician_Code (IMPLIED) 4.診療内容区分 Medical_Information (IMPLIED) REQUIRED : 必須 IMPLIED : 任意 */ DateTime dtime = DateTime.Now; string BODY = @"
<data>
<acceptlstreq type=""record"">
<Acceptance_Date type=""string"">" + dtime.ToString("yyyy-MM-dd") + @"</Acceptance_Date>
<Department_Code type=""string"">01</Department_Code>
<Physician_Code type=""string"">10001</Physician_Code>
<Medical_Information type=""string""></Medical_Information>
</acceptlstreq>
</data> ";
byte[] record_in_byte = Encoding.UTF8.GetBytes(BODY); HttpWebRequest req = (HttpWebRequest) HttpWebRequest.Create(URL); //req.ProtocolVersion = HttpVersion.Version11; req.Method = "POST"; req.ContentType = CONTENT_TYPE; req.ContentLength = record_in_byte.Length; req.Credentials = new NetworkCredential(USER, PASSWD); Console.WriteLine(BODY); HttpWebResponse res = null; try { Stream reqstream = req.GetRequestStream(); reqstream.Write(record_in_byte, 0, record_in_byte.Length); reqstream.Close(); res = (HttpWebResponse) req.GetResponse(); Console.WriteLine(res.ResponseUri); Console.WriteLine(res.StatusDescription); } catch (WebException exc) { if (exc.Status == WebExceptionStatus.ProtocolError) { HttpWebResponse err = (HttpWebResponse) exc.Response; int errcode = (int) err.StatusCode; Console.WriteLine(err.ResponseUri); Console.WriteLine("{0}:{1}", errcode, err.StatusDescription); err.Close(); } else { Console.WriteLine(exc.Message); } } if (res != null) { Stream str = res.GetResponseStream(); StreamReader strread = new StreamReader(str); string FOO = strread.ReadToEnd(); string FILE_NAME = "foo.xml"; File.WriteAllText(FILE_NAME, FOO); strread.Close(); str.Close(); res.Close(); } } } }
エラーメッセージ一覧
エラーコード | エラーメッセージ |
---|---|
11 | 受付日が暦日ではありません |
12 | 診療科が存在しません |
13 | ドクターが存在しません |
14 | 診療内容情報がありません |
20 | 受付対象件数が500件以上あります |
21 | 対象の受付はありませんでした |
89 | 職員情報が取得できません |
医療機関情報が取得できません | |
システム日付が取得できません | |
患者番号構成情報が取得できません | |
グループ医療機関が不整合です。処理を終了して下さい | |
システム項目が設定できません | |
90 | 他端末使用中 |
91 | 処理区分未設定 |
97 | 送信内容に誤りがあります |
98 | 送信内容の読込ができませんでした |
99 | ユーザID未登録 |