Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

...

  1. Validate composition_type is COMPOSITION_TYPES dictionary

    1. in case of error - return 422 ('value is not allowed in enum')

  2. Check that сomposition_type is NOT from COMPOSITION_TYPE_BLACK_LIST

    1. Return 422 ("Using {{сomposition_type}} is not allowed by configuration") in case of error

...

  1. Generate requisition number using Human readable requisition number algorithm based on patient_id

  2. 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 error

  3. Check that there is no Composition in ME.Compositions collection with such title

    1. 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

  4. Check that there is no record in ME.requisition_number with such requisition

    1. 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

  5. Save generated title in ME.requisition_number

    1. requisition_number = generated requisition

    2. patient_id = patient id from the request

    3. expiration_date = current datetime + COMPOSITION_TITLE_EXPIRATION_PERIOD (config parameter in ehealth.charts)

    4. composition_type = composition_type from query parameters

Requisition number expiration

  1. Deactivation job