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

[AUTO] Terminate Medical program provision_EN

Purpose

Medical program provision should have actual state depending on events invoked in the system. All event types that has influence on medical program provision are listed in PROVISION_DEACTIVATE_REASON dictionary.

Events

When triggered

Logic

When triggered

Logic

Legal entity status changed to CLOSED

For related divisions deactivate linked active medical program provision entities:

  • set is_active = false

  • set deactivate_reason = AUTO_LEGAL_ENTITY_DEACTIVATION (according to PROVISION_DEACTIVATE_REASON dictionary)

  • set updated_at, updated by

Division status changed to INACTIVE 

Deactivate related active medical program provision entities:

  • set is_active = false

  • set deactivate_reason = AUTO_DIVISION_DEACTIVATION 

  • set updated_at, updated by

Medical program deactivated (is_active=false)

Deactivate all related active medical program provision entities:

  • set is_active = false

  • set deactivate_reason = AUTO_MEDICAL_PROGRAM_DEACTIVATION 

  • set updated_at, updated by

REIMBURSEMENT contract status changed to TERMINATED

  1. If contract update operation (Sign Contract Request by MSP api with contract_number):

    • define medical programs that are not present in the new contract.

    • deactivate all active medical program provision for defined programs within contract number and current legal entity: 

      • set is_active = false

      • set deactivate_reason = AUTO_CONTRACT_TERMINATION

      • set updated_at, updated by
        Note: Status of medical program provision entities for the programs remained in the new contract should not be changed.

  2. If contract terminate operation (Sign Contract Request by MSP api w/o contract_number, Deactivate legal entity api, Contract expiration job, Terminate contract graphQl api).

    • deactivate all active medical program provision for defined contract number and current legal entity:

      • set is_active = false

      • set deactivate_reason = AUTO_CONTRACT_TERMINATION 

      • set updated_at, updated by

Division becomes not verified in DLS (dls_verified=false)

  1. If DISPENSE_DIVISION_DLS_VERIFY chart parameter is on:

    • deactivate related to the division all active medical program provision entities:

      • set is_active = false

      • set deactivate_reason = AUTO_DIVISION_DLS_NOT_VERIFIED 

      • set updated_at, updated by 

  2. If DISPENSE_DIVISION_DLS_VERIFY is off, then skip this event

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