Class: OrcaApi::MedicalPracticeService::Response1Result

Inherits:
ResponseResult show all
Defined in:
lib/orca_api/medical_practice_service.rb

Overview

診療処理開始または、デフォルト保険組合せ取得のレスポンスを表現したクラス

Constant Summary

Constants inherited from Result

Result::LOCKED_API_RESULT

Instance Attribute Summary

Attributes inherited from Result

#raw

Instance Method Summary collapse

Methods inherited from ResponseResult

#initialize, #ok?

Methods inherited from Result

#[], #body, def_info, #initialize, #locked?, #message, #method_missing, #ok?, parse, #respond_to_missing?, trim_response, #warning?

Constructor Details

This class inherits a constructor from OrcaApi::MedicalPracticeService::ResponseResult

Constructor Details

This class inherits a constructor from OrcaApi::MedicalPracticeService::ResponseResult

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OrcaApi::Result

Instance Method Details

#medical_infoArray<Hash>

Examples:

res = Response1Result.new({
                            "response" => {
                              "Medical_Information" => [
                                { "Medical_Info" => [1] },
                                # :
                                { "Medical_Info" => [2] },
                              ]
                            }
                          }.to_json)
res.medical_info
# => [1, 2]

Returns:

  • (Array<Hash>)


137
138
139
140
141
# File 'lib/orca_api/medical_practice_service.rb', line 137

def medical_info
  medical_information.flat_map do |mi|
    Array(mi["Medical_Info"])
  end
end

#medical_informationArray<Hash>

Examples:

res = Response1Result.new({
                            "response" => {
                              "Medical_Information" => [
                                { "Medical_Info" => [1] },
                                # :
                                { "Medical_Info" => [2] },
                              ]
                            }
                          }.to_json)
res.medical_information
# => [ { "Medical_Info" => [1] }, { "Medical_Info" => [2] } ]

Returns:

  • (Array<Hash>)


119
120
121
# File 'lib/orca_api/medical_practice_service.rb', line 119

def medical_information
  Array(body["Medical_Information"])
end