ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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 fields that are on nhs side. 

Specification

GraphQL

Authorize

    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:

  1. Validate client_id (is_blocked=false)
    1. in case of error return 403 Error ('Client is blocked')
  2. Check legal_entity is active
    • in case error return 403 - ('Client is not active')
  3. Check legal_entity.type = 'NHS'
    1. in case error return 403 forbidden

Validate

  1. contract request number structure XXXX-1234-5678-C , where:
    1. XXXX - series: numbers + only some letters (A, E, H, K, M, P, T, X)
    2. 1234-5678 - randomly generated numbers and letters A, E, H, K, M, P, T, X. 
  2. contract_number is in request
    1. in case error return 409, "Contract number should be in payload"
  3. check there is a contract with such contract_number 
    1. in case of error return 422 error ('Contract with such contract number does not exist')
  4. contrat status = VARIFIED
    1. in case of error return 409 error ('Can not update terminated contract')
  5. Contract.is_suspended = false
    1. in case error 409, "suspended contract should be updated by contractor_owner"
  6. Check only next fields are different from contract
    1. nhs_signer_id
    2. nhs_signer_base
    3. nhs_contract_price (for capitation contracts only)
    4. nhs_payment_method
    5. issue_city
    6. Miscellaneous
      1. in case error return 422, "Not allowed to change field $.field"

Search pending contract requests

1. Find there is no contract request 

  • for same contractor_legal_entity_id
  • within same period [start_date, end_date]
  • status in ('NEW', 'IN_PROCESS','APPROVED', 'NHS_SIGNED', 'PENGIND_NHS_SIGN')
  • id_form
  • medical_program_id (for reimbursement contracts)

In case there is such contract request change its' status to 'TERMINATE'

Save contract request

  1. status=APPROVED
  2. parent_contract_id=contract_id
  3. nhs_signed_date=null
  4. update fields from request, other fields should be taken from contract.


  • No labels