入院会計未作成チェック
メニュー
更新履歴
概要
POSTメソッドにより入院患者毎の入院会計診療年月の最大値の返却を行います。
日レセ Ver.5.0.0[第16回パッチ適用] 以降
日レセ Ver.4.8.0[第75回パッチ適用] 以降
リクエストおよびレスポンスデータはxml2形式になります。
リクエストの患者番号、診療年月の設定有無により、以下のようにレスポンスの返却を行います。
- 患者番号設定なし、診療年月の設定なし
入院中の患者について、入院会計の診療年月の最大値を一覧で返却します。 - 患者番号設定あり、診療年月の設定なし
該当患者の入院会計の診療年月の最大値を返却します。 - 患者番号設定なし、診療年月の設定あり
該当診療年月の入院会計が作成されていない入院中の患者の一覧を返却します。 - 患者番号設定あり、診療年月の設定あり
該当患者の入院会計の該当診療年月の作成有無をチェックします。
テスト方法
- 参考提供されている sample_hspmmv2.rb 内の変数HOST等を接続環境に合わせます。
- sample_hspmmv2.rb 内の患者番号等を接続先の日レセの環境に合わせます。
- ruby sample_hspmmv2.rb により接続します。
リクエスト(POSTリクエスト)サンプル
POST : /orca31/hspmmv2
Content-Type: application/xml
application/xml の場合の文字コードは UTF-8 とします。
<data>
<hspmmv2req type ="record">
<Perform_Month type ="string">2017-11</Perform_Month>
</hspmmv2req>
</data>
処理概要
入院患者毎の入院会計診療年月の最大値の返却を行います。
レスポンスサンプル
<?xml version="1.0" encoding="UTF-8"?>
<xmlio2>
<hspmmv2res type="record">
<Information_Date type="string">2017-11-09</Information_Date>
<Information_Time type="string">15:55:19</Information_Time>
<Api_Result type="string">0000</Api_Result>
<Api_Result_Message type="string">正常終了</Api_Result_Message>
<Perform_Month_Max_Information type="array">
<Perform_Month_Max_Information_child type="record">
<Patient_ID type="string">00001</Patient_ID>
<Perform_Month type="string">2017-10</Perform_Month>
</Perform_Month_Max_Information_child>
<Perform_Month_Max_Information_child type="record">
<Patient_ID type="string">00002</Patient_ID>
<Perform_Month type="string">2017-10</Perform_Month>
</Perform_Month_Max_Information_child>
<Perform_Month_Max_Information_child type="record">
<Patient_ID type="string">00003</Patient_ID>
<Perform_Month type="string">2017-10</Perform_Month>
</Perform_Month_Max_Information_child>
<Perform_Month_Max_Information_child type="record">
<Patient_ID type="string">00004</Patient_ID>
<Perform_Month type="string">2017-10</Perform_Month>
</Perform_Month_Max_Information_child>
<Perform_Month_Max_Information_child type="record">
<Patient_ID type="string">00005</Patient_ID>
<Perform_Month type="string">2017-10</Perform_Month>
</Perform_Month_Max_Information_child>
</Perform_Month_Max_Information>
</hspmmv2res>
</xmlio2>
リクエスト一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Patient_ID | 患者番号 | 00001 | |
2 | Perform_Month | 診療年月 | 2017-11 |
レスポンス一覧
番号 | 項目名 | 内容 | 例 | 備考 |
---|---|---|---|---|
1 | Information_Date | 実施日 | 2017-11-10 | |
2 | Information_Time | 実施時間 | 09:00:00 | |
3 | Api_Result | 結果コード | 0000 | |
4 | Api_Result_Message | エラーメッセージ | 処理終了 | |
5 | Perform_Month_Max_Information | 最大診療年月情報 (繰り返し 最大1000) | ||
5-1 | Patient_ID | 患者番号 | 00001 | |
5-2 | Perform_Month | 診療年月 | 2017-01 | 作成済み入院会計の診療年月の最大値を返却します。 但し、リクエストに患者番号と診療年月の両方が設定された場合はリクエストに設定された診療年月を返却します。 |
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("/orca31/hspmmv2")
#
#
BODY = <<EOF
<data>
<hspmmv2req type ="record">
<Perform_Month type ="string">2017-11</Perform_Month>
</hspmmv2req>
</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
}
エラーメッセージ一覧
エラーコード | エラーメッセージ |
---|---|
0000 | 正常終了 |
0001 | 患者番号の入力に誤りがあります。 |
0002 | 診療年月の入力に誤りがあります。 |
0101 | 入院中の患者情報が存在しません。 |
0102 | 入院会計が存在しません。 |
0103 | 未作成の入院会計は存在しませんでした。 |
0104 | 入院会計が存在しません。 |
0089 | 職員情報が取得できません。 |
医療機関情報が取得できません。 | |
システム日付が取得できません。 | |
患者番号構成情報が取得できません。 | |
グループ医療機関が不整合です。処理を終了して下さい。 | |
システム項目が設定できません。 | |
0097 | 送信内容に誤りがあります。 |
0098 | 送信内容の読込ができませんでした。 |
0099 | ユーザIDが未登録です。 |