Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Конвертував сторінку до нового редактора Confluence та оновив згідно PSYHO-162.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Table of Contents

Specification

TERMINATE contract

...

This WS allows to terminate contract either by NHS or Legal Entity Side (if scope was allowed).

Request

  • status_reason

Authorize

  1. Verify the validity of access token

    1. in case of error return 401 ('Access denied')

  2. Check user scope contract:terminate in order to perform this action

    1. in case of error generate 401 response ('Invalid scopes')

Validate User

  1. Extract Extract legal_entity_id (client_id) from  from token.

    1. Check client_id=contractor_legal_entity_

      id 

      id  or client_id=nhs_legal_entity_id

      1. in case of error return 403 "User is not allowed to perform this action"

Validate contract request status

  • Check contract_request.status='VERIFIED'

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

Response

mapping


field

value

status

TERMINATED

status_reason

$.status_reason

updated_at

now()

updated_by

$.user_id


Auto termination

Fetch all contract with end_date<now(). Set status and status reason for such contract as below:

field

value

status

TERMINATED

status_reason

$.auto_expired

updated_at

now()

updated_by

$.user_id


Add status to event manager

After status was changed (status = TERMINATED) - add new status to event_manager


field

value

event_type

StatusChangeEvent

entity_type

Contract

entity_id

$.id

properties.status.new_value

$.status

event_time

$.update_at

changed_by

$.changed_by


Deactivate Medical Program Provision

Deactivate all active medical program provision for defined contract number and current legal entity (according to link):

  • set is_active = false

  • set deactivate_reason = AUTO_CONTRACT_TERMINATION 

  • set updated_at, updated by