Versions Compared

Key

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

Table of Contents
Purpose

...

Input parameters (filters)

  • name
  • start_at
  • route
  • container_dosage info
  • package_qty
  • package_min_qty
  • code_ATX
  • manufacturer_name_country info
  • certificate
  • expired_certificate_date
  • ingridients info
    • innm_id
    • dosage info
    • is_active_substance

Authorize

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

...

  1. Check exist Innm by $.ingridients[].innm_id.

    1. if invalid - return 422 error (message: "Innm in ingridients not found!")

...

  1. Check exist any Denum unit from Dosage ($.ingridients[].dosage.denumerator_unit) with Denum unit Container dosage ($.container_dosage.denumerator_unit).

    1. if invalid - return 422 error (message: "Denum unit from Dosage ingridients must be is equal Denum unit from Container dosage medication!")

Create new Medication

  1. Create new record in medications  Medications 
  2. Fill data 
Destination
Source
id
name$.name
is_active TRUE
start_at $.start_at
route $.route
container_dosage $.container_dosage
package_qty$.package_qty
package_min_qty$.package_min_qty
code_ATX $.code_ATX
manufacturer_name_country$.manufacturer_name_country
certificate $.certificate
expired_certificate_date $.expired_certificate_date
inserted_at:timestamp
inserted_byuser_id
updated_at:timestamp
updated_byuser_id

...


  1. Save temp variable from medication.id
  2. Create new records in

...

  1. Ingridients (array)

name.name$.container_dosage
Destination
Source
id
medication_id medication.id
innm_id $.ingridients[].innm_id
is_activeTRUE
start_at $.start_at
route $.route
container_dosage _substance $.ingridients[].is_active_substance
dosage $.ingridients[].dosage
inserted_at:timestamp
inserted_byuser_id
updated_at:timestamp
updated_byuser_id