Class: OrcaApi::SubjectiveService

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

Overview

症状詳記を扱うサービスを表現したクラス

Defined Under Namespace

Modules: HashSlice Classes: Result

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

#create(params) ⇒ Object

症状詳記登録



88
89
90
91
92
93
94
95
96
# File 'lib/orca_api/subjective_service.rb', line 88

def create(params)
  Result.new(
    orca_api.call(
      "/orca25/subjectivesv2",
      params: { "class" => "01" },
      body: { "subjectivesmodreq" => shaper(params, CREATE_PARAMS) }
    )
  )
end

#destroy(params) ⇒ Object

症状詳記削除



99
100
101
102
103
104
105
106
107
# File 'lib/orca_api/subjective_service.rb', line 99

def destroy(params)
  Result.new(
    orca_api.call(
      "/orca25/subjectivesv2",
      params: { "class" => "02" },
      body: { "subjectivesmodreq" => shaper(params, DESTROY_PARAMS) }
    )
  )
end

#list(params) ⇒ Object

症状詳記取得



110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/orca_api/subjective_service.rb', line 110

def list(params)
  result = call_01 params
  return result unless result.ok?

  result.subjectives_information.each do |info|
    sub_result = call_02(result.patient_information["Patient_ID"], result.perform_date, info)
    if sub_result.ok?
      info["Subjectives_Code"] = sub_result.subjectives_code_information["Subjectives_Code"]
    end
  end
  result
end