ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Service logic

  1. Update Medication request in OPS DB:

    1. set is_blocked = true

    2. set block_reason_system = $.block_reason_system

    3. set block_reason_code = $.block_reason_code

    4. set block_reason = $.block_reason

    5. set updated_by = user_id

    6. set updated_at = now()

    7. set block_legal_entity_id = legal entity id out of token

  2. Send SMS for person

    1. If Medication request has program with medical program setting request_notification_disabled = true, then don't send SMS.

      Else:

      1. If authorize_with inform_with exists in medication request and is not empty, check:

        1. Authentication method exists in person_authentication_methods table in MPI DB (with is_active=true), is active (ended_at > now() or null)

        2. Get value of THIRD_PERSON_CONFIDANT_PERSON_RELATIONSHIP_CHECK config parameter, if it is set to true - for authentication method with type = THIRD_PERSON check that person from value is an approved confidant for a person from medication request – exists active and approved confidant person relationship between person from request and confidant_person_id from authentication method value (using following logic: /wiki/spaces/CSI/pages/17667883028 with person_id = person from request and confidant_person_id = value from auth method) - expected :ok, :approved response)

          1. in case any validation failed - do not send SMS to person

          2. else - get authentication_method from authorize_with inform_with

      2. If authorize_with inform_with does not exist in medication request or is empty - get authentication_method of person from MPI

      3. If authentication_method == OTP, then send SMS to a person from Medication request:

        1. Generate SMS text

          1. get template from block_template_sms parameter

          2. enrich template with data from Medication request

        2. Send SMS to a person

  3. Add new record in Event manager:

  • No labels