Table of Contents |
---|
Status
...
Page Properties | |||||||
---|---|---|---|---|---|---|---|
|
...
|
...
|
...
|
...
|
...
|
Purpose
This WS is designed to create new medication (post).
...
- name
- type
- manufacturer (object)
- code_atc
- form
- container info
- package_qty
- package_min_qty
- certificate
- expired_certificate_at
- ingredients (array)
- id
- dosage info
- is_active_substance
Authorize
- Verify the validity of access token
- Check user scope (scope = 'medication:write') in order to perform this action
- In case error - generate 401 response
...
For $.type = INNM - Check exist `Substance` by $.ingredients[].id.
if invalid - return 422 error (message: "Substance in ingredients is not found!")
For $.type = MEDICATION - Check exist `Medications` by $.ingredients[].id.
if invalid - return 422 error (message: "INNM in ingredients is not found!")
...
For $.type = MEDICATION - Check exist any ($.ingredients[].dosage.denumerator_unit != $.container.numerator_unit).
if invalid - return 422 error (message: "Denumerator unit from Dosage ingredients must be equal Numerator unit from Container medication!")
...
- if result NOT 0 - return 409 eror (message: "Only a multiplicity package quantity for the minimum package quantity medication!")
Create new Medication
- Create new record in Medications
- Fill data
Destination | Source |
---|---|
id | |
name | $.name |
is_active | TRUE |
form | $.form |
ingredients | $.ingredients |
container | $.container |
package_qty | $.package_qty |
package_min_qty | $.package_min_qty |
code_atc | $.code_atc |
manufacturer | $.manufacturer |
certificate | $.certificate |
expired_certificate_at | $.expired_certificate_at |
inserted_at | :timestamp |
inserted_by | user_id |
updated_at | :timestamp |
updated_by | user_id |
Prepare & return response data structure
...