Versions Compared

Key

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

Table of Contents
minLevel1
maxLevel3

Required parameters are marked with "*"

...

Purpose*

This WS is designed to change status of contract request to PENDING_NHS_SIGN by legal entity side. After the contract was approved by NHS side (status=APPROVED) MSP employee can change status of contract request and approve it from his side.

...

Request to process the request using a token in the headers

Headers*

Наприклад:

  • Content-Type:application/json

  • Authorization:Bearer c2778f3064753ea70de870a53795f5c9

...

  • Check user scopes in order to perform this action (scope = 'contract_requests:approve')

    • Return 403 in case invalid scope(s) "Your scope does not allow to access this resource. Missing allowances: contract_requests:approve"

Validate data

  1. Validate contract request id.

    1. Check contract_requests.id = $.id

      1. in case error return 404 ("Contract request with id=$id doesn't exist")

  2. Validate contract_request.status=APPROVED

    • in case error return 409 - "Incorrect status of contract request to modify it"

  3. Validate contractor_legal_entity_id

    1. Legal_entities.id = $.contractor_legal_entity_id and Legal_entities.status='ACTIVE' and  legal_entities.nhs_verified = true

      1. in case error return 422 ("Legal entity in contract request should be active")

  4. Validate contractor_owner_id

    1. Employee is_active=true and status='APPROVED' and employees.legal_entity_id=contractor_legal_entity_id

      1. in case error return 422, $contractor_owner_id (Contractor owner must be active within current legal entity in contract request)

  5. Validate contractor_divisions

    1. Check divisions belongs to legal_entity and divisions.status='active'

      1. in case of error return 422  error view $divisions ('Division must be active and within current legal_entity')

  6. For capitation only: Validate contractor_employee_divisions

    1. Employees from employee_divisions has employee_type='DOCTOR', status='APPROVED'

      1. in case of error return 422  error view $employee ('Employee must be an active DOCTOR')

    2. Check contractor_employee_divisions.division_id is present in contractor_divisions.id

      1. in case of error return 422 error $divisions ('The division is not belong to contractor_divisions')

  7. Validate start_date

    1. start_date > now()

      1. in case error return 422 $start_date ("Contract request start date should be in future")

  8. For reimbursement only: Validate medical_program_id is ACTIVE

Processing*

Save response data to DB

...