Class: OrcaApi::PatientService
- Inherits:
-
Service
- Object
- Service
- OrcaApi::PatientService
show all
- Defined in:
- lib/orca_api/patient_service.rb,
lib/orca_api/patient_service/income.rb,
lib/orca_api/patient_service/maiden.rb,
lib/orca_api/patient_service/pension.rb,
lib/orca_api/patient_service/pi_money.rb,
lib/orca_api/patient_service/personally.rb,
lib/orca_api/patient_service/care_common.rb,
lib/orca_api/patient_service/pi_etc_money.rb,
lib/orca_api/patient_service/income_common.rb,
lib/orca_api/patient_service/special_notes.rb,
lib/orca_api/patient_service/care_insurance.rb,
lib/orca_api/patient_service/pi_money_common.rb,
lib/orca_api/patient_service/contraindication.rb,
lib/orca_api/patient_service/health_insurance.rb,
lib/orca_api/patient_service/public_insurance.rb,
lib/orca_api/patient_service/accident_insurance.rb,
lib/orca_api/patient_service/care_certification.rb,
lib/orca_api/patient_service/health_public_insurance.rb,
lib/orca_api/patient_service/health_public_insurance_common.rb
Overview
Defined Under Namespace
Classes: AccidentInsurance, CareCertification, CareCommon, CareInsurance, Contraindication, CreateResult, HealthInsurance, HealthPublicInsurance, HealthPublicInsuranceCommon, Income, IncomeCommon, Maiden, Pension, Personally, PiEtcMoney, PiMoney, PiMoneyCommon, PublicInsurance, SpecialNotes
Instance Attribute Summary
Attributes inherited from Service
#orca_api
Instance Method Summary
collapse
Methods inherited from Service
#initialize, reuse_session
Instance Method Details
135
136
137
138
139
140
141
|
# File 'lib/orca_api/patient_service.rb', line 135
def create(patient_information, allow_duplication: false, patient_id: "*")
res = CreateResult.new(call_01(patient_id, patient_information, "New"))
if !res.ok? && !res.duplicated_patient_candidates.empty? && allow_duplication
res = CreateResult.new(call_02(patient_information, "New", res))
end
res
end
|
#destroy(id, force: false) ⇒ Object
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
# File 'lib/orca_api/patient_service.rb', line 191
def destroy(id, force: false)
res = Result.new(call_01(id, nil, "Delete"))
if !res.locked?
locked_result = res
end
if !res.ok?
return res
end
res = Result.new(call_02(res.patient_information, "Delete", res))
if res.api_result != "S20"
return res
end
res = Result.new(call_02(res.patient_information, "Delete", res))
if res.ok?
locked_result = nil
return res
end
if res.api_result != "S20" || !force
return res
end
res = Result.new(call_02(res.patient_information, "Delete", res))
if res.ok?
locked_result = nil
end
res
ensure
unlock(locked_result)
end
|
#fetch_accident_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 251
|
#fetch_health_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 236
|
#fetch_pi_money ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 305
|
150
151
152
153
154
155
156
157
158
159
160
|
# File 'lib/orca_api/patient_service.rb', line 150
def get(id)
Result.new(
orca_api.call(
"/api01rv2/patientgetv2",
http_method: :get,
params: {
id: id
}
)
)
end
|
#get_accident_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 248
|
#get_care_certification ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 296
|
#get_care_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 290
|
#get_contraindication ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 284
|
#get_health_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 233
|
#get_health_public_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 227
|
#get_income ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 257
|
#get_maiden ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 268
|
#get_pension ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 263
|
#get_personally ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 279
|
#get_pi_etc_money ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 311
|
#get_pi_money ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 302
|
#get_public_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 242
|
#get_special_notes ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 273
|
#update(id, patient_information) ⇒ Object
患者情報の更新
patient_informationは PatientService#create と同じ形式
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
# File 'lib/orca_api/patient_service.rb', line 168
def update(id, patient_information)
res = Result.new(call_01(id, nil, "Modify"))
if !res.locked?
locked_result = res
end
if !res.ok?
return res
end
patient_information = deep_merge_for_request_body(res.patient_information, patient_information)
res = Result.new(call_02(patient_information, "Modify", res))
if res.ok?
locked_result = nil
end
res
ensure
unlock(locked_result)
end
|
#update_accident_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 254
|
#update_care_certification ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 299
|
#update_care_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 293
|
#update_contraindication ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 287
|
#update_health_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 239
|
#update_health_public_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 230
|
#update_income ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 260
|
#update_maiden ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 268
|
#update_pension ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 263
|
#update_personally ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 279
|
#update_pi_etc_money ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 314
|
#update_pi_money ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 308
|
#update_public_insurance ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 245
|
#update_special_notes ⇒ Object
|
# File 'lib/orca_api/patient_service.rb', line 276
|