Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Table of Contents

General

License verification used for healthcare services linked with divisions that relates to legal entities with MSP or PHARMACY license type. The special register is used as source for the license verification - healthcare_service_licenselicenses table in DLS (DataLicenseStorage) database. Each insert/update event triggers replication app which replicates this data to eHealth PRM database. After that Processor app starts and perform actions in eHealth described below.

Key points:

  • DLS.healthcare_service_

...

  • licenses register is managed by NHS:

...

  •  when new data inserts - previous should be cleared. Register must contain only actual license statuses for healthcare services.

  • NHS sets license statuses for healthcare services selected from healthcare_services table (see table specs)

  • Data in register should be updated at least once in twenty-four hours

  • eHealth

...

  • performs replication of healthcare_service_

...

  • licenses table from DLS to PRM database, saving statuses in PRM.licensed_healthcare_services table, log history on PRM.

  • PRM.licensed_healthcare_services table isn't clears. The new records are inserts, existing - updates. 

Image Removed

PRM Replica structure

Replicted data stores in prm.service_license table:

...

healthcare_service_id

...

Identifier of the healthcare service in eHealth. Corresponds to prm.healthcare_services.id (see table specs)

...

license_status

...

Status of the license for  healthcare service in the division of the legal entity with MSP or PHARMACY license type. Allowed values: ACTIVE, INACTIVE

...

inserted_at

...

Code Block
languagesql
titleScript example
collapsetrue
create table service_license
(
    id uuid not null
        constraint service_license_pkey
            primary key,
    healthcare_service_id uuid,
    license_status varchar(50),
    inserted_at timestamp not null
);
comment on table service_license is ’Stores license statuses for healthcare services of divisions in legal entities with MSP or PHARMACY licenses. Manages by NHS’;
comment on column service_license.id is ‘Unique entry identifier (uuid)’;
comment on column service_license.healthcare_service_id is ‘Id of the healthcare service of the division in eHealth’;
comment on column service_license.license_status is ‘Status of the license for healthcare_service_id of division in legal entity with MSP or PHARMACY license’;

alter table service_license
    owner to db;

View file
nameUntitled Diagram.drawio

...

Processor

Once in N interval (where N - cron value of DLS_HEALTHCARE_SERVICE_LICENSES_SCHEDULE parameter), Processor app selects all records from PRM.healthcare_service_licenselicenses table (table specs). Each entry should be processed with next logic:

  1. Search healthcare service in PRM.licensed_healthcare_services table by healthcare_service_id:

    • If not found - insert new record. Set all fields in PRM.licensed_healthcare_services.

    • if found - update PRM.licensed_healthcare_service.status.

...

  1. Log status history to PRM.licensed_healthcare_services_status_

...

  1. history table.

Deactivate Medical Program Provision

In case healthcare service with category = ‘PHARMACY’ becomes not verified in DLS (licensed_healthcare_service.status=inactive)

  1. If DISPENSE_DIVISION_HEALTHCARE_SERVICE_DLS_VERIFY chart parameter is on:

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

      • set is_active =

...

Influence

...

      • false

      • set deactivate_reason = AUTO_DIVISION_DLS_NOT_VERIFIED 

      • set updated_at, updated by 

  1. If DISPENSE_DIVISION_HEALTHCARE_SERVICE_DLS_VERIFY is off, then skip this event