Versions Compared

Key

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

Table of Contents

Status

Page Properties


Specification

Status
colourGreen
titledone

Apiary
Status
colourGreen
titledone
JSON Schema request

Status
colourGrey
titleabsent

JSON Schema response
Status
colourRed
titlespecs


Purpose

This WS  is design to update flags "is_active" for Medical Program.

...

Specification

Deactivate Medical program

...

WS logic

  • id

Authorize

  1. Verify the validity of access token
    1. In case error - generate 401 response
  2. Check user scope (scope = 'medical_programsprogram:writedeactivate') in order to perform this action
    1. In case error - generate 401 403 response

Validate FKs

Purpose validation: Check on active program medication. Only medical program without active program medication can be deactivated. In case on existing active program medication linked with medical program error must be shown.

  1. Check exist `program_medication` by $.medical_program_id=$.id & `is_active`= false 
    1. if invalid - return 409 error (message: "This program has active participants. Only medical programs without participants can be deactivated.")

Validate PK Program Medications

...

    1. if invalid  - return 409 error (message: "Medical program is not active and can't be deactivated")

Deactivate Program Medications

Update medical program record by $.id  set values:


Destination

Source

is_active

FALSE

updated_at:timestamp
updated_byuser_id


Prepare & return response data structure

...