Table of Contents | ||
---|---|---|
|
...
Validate composition_type is
COMPOSITION_TYPES
dictionaryin case of error - return 422 ('value is not allowed in enum')
Check that сomposition_type is NOT from COMPOSITION_TYPE_BLACK_LIST
Return 422 ("Using {{сomposition_type}} is not allowed by configuration") in case of error
...
Generate requisition number using Human readable requisition number algorithm based on patient_id
Use prefix from configuration instead of first 4 symbols: {{composition_type}}
_TITLE_PREFIX
(ex.ADOPTION_TITLE_PREFIX
) If prefix can't be get from chart-parameters Return 500 errorCheck that there is no Composition in ME.Compositions collection with such title
if it already exists generate new requisition as it is described in https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/583402257/Human+readable+requisition+number#Solution section
Check that there is no record in ME.requisition_number with such requisition
if it already exists generate new requisition as it is described in https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/583402257/Human+readable+requisition+number#Solution section
Save generated title in ME.requisition_number
requisition_number = generated requisition
patient_id = patient id from the request
expiration_date = current datetime + COMPOSITION_TITLE_EXPIRATION_PERIOD (config parameter in ehealth.charts)
composition_type = composition_type from query parameters