Versions Compared

Key

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

Table of Contents

...

  • name
  • form
  • ingredients (array)
    • id
    • dosage info
    • is_active_substanceaprimary

Authorize

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

...

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

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

...

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

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

...

  1. Check uniqueness of $.ingredients[].id.

    1. if invalid - return 422 error (message: "Ingredients can't be duplicated")

Create new

...

Medication

  1. Create new record in Brand  Medications
  2. Fill data 

Destination

Source

id
name$.name
typeINNM Dosage
is_primaryTRUE
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