Class: OrcaApi::PatientService::Contraindication

Inherits:
Service
  • Object
show all
Defined in:
lib/orca_api/patient_service/contraindication.rb

Overview

患者禁忌薬剤情報を扱うサービス

Instance Attribute Summary

Attributes inherited from Service

#orca_api

Instance Method Summary collapse

Methods inherited from Service

#initialize, reuse_session

Constructor Details

This class inherits a constructor from OrcaApi::Service

Constructor Details

This class inherits a constructor from OrcaApi::Service

Instance Method Details

#get(patient_id) ⇒ Object

患者の禁忌薬剤情報を取得する

Parameters:

  • patient_id (String)

    患者番号



15
16
17
18
19
# File 'lib/orca_api/patient_service/contraindication.rb', line 15

def get(patient_id)
  first_result = call_01 patient_id
ensure
  unlock first_result
end

#update(patient_id, params) ⇒ Object

患者の禁忌薬剤情報を更新、または削除する

Parameters:

  • patient_id (String)

    患者番号

  • params (Hash{String => String, Hash})

    禁忌薬剤情報

Options Hash (params):

  • "Contra_Mode" (String)

    "Modify"か"Delete"を指定する



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/orca_api/patient_service/contraindication.rb', line 28

def update(patient_id, params)
  first_result = call_01 patient_id
  return first_result unless first_result.ok?

  call_02(params, first_result).tap do |result|
    # 処理成功したらロックの解除は不要なため
    first_result = nil if result.ok?
  end
ensure
  unlock first_result
end