Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Purpose

This WS is designed to update contract by NHS by creating new contract request. Contract request is created with contract number, and parent contract is added to request. NHS Admin can change only fields that are on nhs side. 

...

    1. Verify the validity of access token
      1. in case of error return 401 ('Access denied')
    2. Check user scope contract_request:create in order to perform this action
      1. in case of error generate 401 response ('Invalid scopes')

Verify role

Extract from token:

...

Decode content that is encrypted in an electronic digital signature.
Use Digital signature WS. Method checks digital signature and returns result.

Validate EDRPOU

  1. Check that EDRPOU in Certificate details exists and not empty
    1. in case of error return 422 error ('Invalid EDRPOU in DS')
  2. Check that EDRPOU in Certificate details is equal to EDPOU in legal entity
    1. Get client_id from token.
    2. Find prm.legal_entities id by client_id
    3. Compare EDRPOU in Certificate with legal_entities.edrpou
    4. In case validation fails - generate 422 error
  3. Check that SURNAME in Certificate details is equal to LAST_NAME in Party
    1. Get user_id → user_parties.party_id → parties.last_name and compare to surname from DS
      1. Convert prm.parties.LAST_NAME and Certificate details.SURNAME to uppercase
      2. Compare prm.parties.LAST_NAME and Certificate details.SURNAME as Cyrillic letters
      3. In case validation fails - generate 422 error

...

contract requestold contractedited fields by nhsother
contractor_legal_entity_idcontractor_legal_entity_id

contractor_owner_idcontractor_owner_id

contractor_basecontractor_base

contractor_payment_detailscontractor_payment_details

contractor_rmsp_amountcontractor_rmsp_amount

start_datestart_date

end_dateend_date

nhs_legal_entity_id

token.client_id
nhs_signer_id
nhs_signer_id
nhs_signer_base
nhs_signer_base
contractor_signed

false
issue_city
issue_city
status

APPROVED
status_reason

null
nhs_contract_price
nhs_contract_price
nhs_payment_method
nhs_payment_method
contract_numbercontract_number

id_formid_form

contractor_divisions

SELECT id 
from contract_divisions
where contract_id=parent_contract_id;
misc
misc
assignee_id
assignee_id
typetype

medical_program_idmedical_program_id

...

  1. Get url for contract request upload.


    Parameter
    Source
    action'GET'
    bucket'CONTRACT_REQUEST'
    resource_id: CONTRACT_REQUEST_ID
    resource_name: CONTRACT_REQUEST_APPROVED
    timestamp:TIMESTAMP


  2. Upload signed contract request to media storage

...


field
value
example
event_typeContractRequestCreateEvent
entity_type{$.contract.type}ContractRequestCapitationContractRequest/ReimbursementContractRequest
entity_id$.id
properties.contract.old_value$.parent_id
event_time$.update_at
changed_by$.user_id
inserted_atnow()
updated_atnow()