Table of Contents | ||||
---|---|---|---|---|
|
...
Request to process the request using a token in the headers
Headers*
Наприклад:
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
...
Validate contract request id.
Check contract_requests.id = $.id
in case error return 404 ("Contract request with id=$id doesn't exist")
Validate contract_request.status=APPROVED
in case error return 409 - "Incorrect status of contract request to modify it"
Validate contractor_legal_entity_id
Legal_entities.id = $.contractor_legal_entity_id and Legal_entities.status='ACTIVE' and legal_entities.nhs_verified = true
in case error return 422 ("Legal entity in contract request should be active")
Validate contractor_owner_id
Employee is_active=true and status='APPROVED' and employees.legal_entity_id=contractor_legal_entity_id
in case error return 422, $contractor_owner_id (Contractor owner must be active within current legal entity in contract request)
Validate contractor_divisions
Check divisions belongs to legal_entity and divisions.status='active'
in case of error return 422 error view $divisions ('Division must be active and within current legal_entity')
For capitation only: Validate contractor_employee_divisions
Employees from employee_divisions has employee_type='DOCTOR', status='APPROVED'
in case of error return 422 error view $employee ('Employee must be an active DOCTOR')
Check contractor_employee_divisions.division_id is present in contractor_divisions.id
in case of error return 422 error $divisions ('The division is not belong to contractor_divisions')
Validate start_date
start_date > now()
in case error return 422 $start_date ("Contract request start date should be in future")
For reimbursement only: Validate medical_program_id is ACTIVE
...