Versions Compared

Key

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

Table of Contents

...

  • name
  • form
  • ingredients (array)

Authorize

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

...

  1. Invoke GetSubstanceByID($.ingredients[].id). Check exist any substance.is_active=FALSE.

    1. if exists - return 422 error (message: "Substance in ingredients must be active!")

...

  1. Calc count() where is_active_substance=TRUE in ingredients. Check count()=1.

    1. if invalid - return 422 error (message: "One of ingredients must be is active substance!")

...

  1. Create new record in Medications 
  2. Fill data 

Destination

Source

id
name$.name
typeINNM
is_active TRUE
form$.form
ingredients$.ingredients
containerNULL
package_qtyNULL
package_min_qtyNULL
code_atcNULL
manufacturerNULL
certificate NULL
expired_certificate_atNULL
inserted_at:timestamp
inserted_byuser_id
updated_at:timestamp
updated_byuser_id