Class: OrcaApi::MedicalPracticeService
- Defined in:
 - lib/orca_api/medical_practice_service.rb
 
Overview
診療行為を扱うサービスを表現したクラス 診療行為の登録の流れを以下に示す。
- (1) 患者の保険情報と診察料のデフォルト値の返却: get_default
- 取得したデフォルト値を元に、次のメソッドの引数を組み立てる。
 - 詳しくは 
example/medical_practice_service/get_default.rbを参照。 
 - (2) 診察料情報の取得: get_examination_fee
- 取得した診察料情報を元に、次のメソッドの引数を組み立てる。
 - 詳しくは 
example/medical_practice_service/get_examination_fee.rbを参照。 
 - (3) 診療情報及び請求情報の取得: calc_medical_practice_fee
- 取得した診療情報及び請求情報を元に、次のメソッドの引数を組み立てる。
 - 詳しくは 
example/medical_practice_service/calc_medical_practice_fee.rbを参照。 
 - (4) 診療行為の登録: create
- 詳しくは 
example/medical_practice_service/crud.rbを参照。 
 - 詳しくは 
 
Defined Under Namespace
Classes: EmptyDeleteNumberInfoError, Response1Result, Response2Result, Response3Result, ResponseResult, UnselectedError
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
- 
  
    
      #calc_medical_practice_fee(params)  ⇒ OrcaApi::MedicalPracticeService::Response3Result, ... 
    
    
  
  
  
  
  
  
  
  
  
    
診療情報及び請求情報の取得.
 - 
  
    
      #check_contraindication(params)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
薬剤併用禁忌チェック.
 - 
  
    
      #create(params)  ⇒ Response3Result 
    
    
      (also: #update)
    
  
  
  
  
  
  
  
  
  
    
診療行為の登録.
 - 
  
    
      #destroy(params)  ⇒ OrcaApi::Result 
    
    
  
  
  
  
  
  
  
  
  
    
診療行為の削除.
 - 
  
    
      #get(params)  ⇒ OrcaApi::Result 
    
    
  
  
  
  
  
  
  
  
  
    
診療行為の取得.
 - 
  
    
      #get_default(params)  ⇒ Response1Result 
    
    
  
  
  
  
  
  
  
  
  
    
デフォルト値の返却.
 - 
  
    
      #get_examination_fee(params)  ⇒ Response1Result 
    
    
  
  
  
  
  
  
  
  
  
    
診察料情報の取得.
 
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
#calc_medical_practice_fee(params) ⇒ OrcaApi::MedicalPracticeService::Response3Result, ...
診療情報及び請求情報の取得
      478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494  | 
    
      # File 'lib/orca_api/medical_practice_service.rb', line 478 def calc_medical_practice_fee(params) res = if params["Invoice_Number"] call_01_for_update(params, "Modify") else call_01_for_create(params) end if !res.locked? locked_result = res end if !res.ok? return res end calc_medical_practice_fee_without_unlock(params, res) ensure unlock_for_create(locked_result) end  | 
  
#check_contraindication(params) ⇒ Object
薬剤併用禁忌チェック
      703 704 705 706 707 708 709 710 711  | 
    
      # File 'lib/orca_api/medical_practice_service.rb', line 703 def check_contraindication(params) body = { "contraindication_checkreq" => { "Request_Number" => "01", "Karte_Uid" => orca_api.karte_uid, }.merge(params), } Result.new(orca_api.call("/api01rv2/contraindicationcheckv2", body: body)) end  | 
  
#create(params) ⇒ Response3Result Also known as: update
診療行為の登録
      564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589  | 
    
      # File 'lib/orca_api/medical_practice_service.rb', line 564 def create(params) res = if params["Invoice_Number"] call_01_for_update(params, "Modify") else call_01_for_create(params) end if !res.locked? locked_result = res end if !res.ok? return res end res = calc_medical_practice_fee_without_unlock(params, res) if !res.ok? return res end res = call_05(params, res) if res.ok? locked_result = nil end res ensure unlock_for_create(locked_result) end  | 
  
#destroy(params) ⇒ OrcaApi::Result
診療行為の削除
      641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657  | 
    
      # File 'lib/orca_api/medical_practice_service.rb', line 641 def destroy(params) res = call_01_for_update(params, "Delete") if !res.locked? locked_result = res end if res.api_result != "S30" return res end res = call_02_for_delete(res) if res.ok? locked_result = nil end res ensure unlock_for_update(locked_result) end  | 
  
#get(params) ⇒ OrcaApi::Result
診療行為の取得
      624 625 626 627 628 629 630 631 632  | 
    
      # File 'lib/orca_api/medical_practice_service.rb', line 624 def get(params) res = call_01_for_update(params, "Modify") if !res.locked? locked_result = res end res ensure unlock_for_update(locked_result) end  | 
  
#get_default(params) ⇒ Response1Result
デフォルト値の返却
      217 218 219 220 221 222 223 224 225 226 227  | 
    
      # File 'lib/orca_api/medical_practice_service.rb', line 217 def get_default(params) body = { "medicalv3req1" => params.merge( "Request_Number" => "00", "Karte_Uid" => orca_api.karte_uid ) } Response1Result.new( orca_api.call("/api21/medicalmodv31", body: body), ignore_medical_warnings(params) ) end  | 
  
#get_examination_fee(params) ⇒ Response1Result
診察料情報の取得
      339 340 341 342 343 344 345  | 
    
      # File 'lib/orca_api/medical_practice_service.rb', line 339 def get_examination_fee(params) res = call_01_for_create(params) if !res.locked? unlock_for_create(res) end res end  |