Class: OrcaApi::PrintService
- Defined in:
- lib/orca_api/print_service.rb
Overview
帳票印刷を扱うサービスを表現したクラス
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
Methods inherited from Service
Constructor Details
This class inherits a constructor from OrcaApi::Service
Constructor Details
This class inherits a constructor from OrcaApi::Service
Instance Method Details
#create(type, patient_id, invoice_number, outside_class, push_notification = false) ⇒ OrcaApi::Result
帳票印刷リクエスト
処方箋
お薬手帳
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/orca_api/print_service.rb', line 34 def create(type, patient_id, invoice_number, outside_class, push_notification = false) case type.to_s when "shohosen" path = "/api01rv2/prescriptionv2" request_name = "prescriptionv2req" when "okusuri_techo" path = "/api01rv2/medicinenotebookv2" request_name = "medicine_notebookv2req" else raise ArgumentError, "対応していない帳票種別です: #{type}" end req = { "Request_Number" => push_notification ? "01" : "02", "Patient_ID" => patient_id.to_s, "Invoice_Number" => invoice_number.to_s, "Outside_Class" => outside_class ? "True" : "False", } FormResult.new(orca_api.call(path, body: { request_name => req })) end |