Table of Contents |
---|
...
- DLS.service_license register is managed by NHS: inserting new data previous shouldn't be cleared
- 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 perform online replicatiaon of service_license table from DLS to PRM database.
- PRM.licensed_healthcare_services table isn't clears and serves as history.
...
Field name | Type | M/O | Description |
---|---|---|---|
id | uuid | M | Unique identifier of the table entry. Sets automatically |
healthcare_service_id | uuid | M | Identifier of the healthcare service in eHealth. Corresponds to prm.healthcare_services.id (see table specs) |
license_status | varchar(50) | M | 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 | timestamp | M | Date of data insert. Sets automatically |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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; |
Processor
Once a day app selects records for the previous day. Each entry in PRM.service_license should be processed with next logic:
- 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, except end_date.
- if found - update PRM.licensed_healthcare_service.status. If it has INACTIVE value - also set PRM.licensed_healthcare_service.end_date and PRM.licensed_healthcare_service.is_active = False.
Influence
TBD