drop schema if exists poc;
|
create schema poc;
|
use poc;
|
|
drop table if exists holiday_config;
|
create table holiday_config(
|
region_id varchar(32) NOT NULL,
|
metric_name varchar(64) NOT NULL,
|
holiday_type varchar(32) NOT NULL
|
)ENGINE=innodb DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
drop table if exists surgery_holiday;
|
create table surgery_holiday(
|
region_id varchar(32) NOT NULL,
|
holiday_date date NOT NULL,
|
holiday_type varchar(32) NOT NULL
|
)ENGINE=innodb DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
drop table if exists location_master;
|
create table location_master(
|
region_id varchar(32) NOT NULL,
|
location_id varchar(32) NOT NULL
|
)ENGINE=innodb DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
drop table if exists room_master;
|
create table room_master(
|
room_id varchar(32) NOT NULL,
|
location_id varchar(32) NOT NULL
|
)ENGINE=innodb DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
drop table if exists orcase_essentials;
|
CREATE TABLE orcase_essentials (
|
surgery_date date NOT NULL,
|
location varchar(32) DEFAULT NULL,
|
room_id varchar(32) DEFAULT NULL
|
) ENGINE=innodb DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
drop table if exists orcase_essentials_cs;
|
CREATE TABLE orcase_essentials_cs (
|
surgery_date date NOT NULL,
|
location varchar(32) DEFAULT NULL,
|
room_id varchar(32) DEFAULT NULL
|
) ENGINE=columnstore DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
truncate table holiday_config;
|
truncate table surgery_holiday;
|
truncate table location_master;
|
truncate table room_master;
|
truncate table orcase_essentials;
|
truncate table orcase_essentials_cs;
|
|
INSERT INTO holiday_config (region_id,metric_name,holiday_type) VALUES
|
('R1','ADD_ON_CASE_RATIO','REGULAR')
|
,('R1','BLOCK_UTILIZATION','COVID')
|
,('R1','BLOCK_UTILIZATION','REGULAR')
|
,('R1','FIRST_CASE_DELAY_MINUTES','REGULAR')
|
,('R1','FIRST_CASE_ON_TIME_PERCENT','REGULAR')
|
,('R1','ROOM_UTILIZATION','COVID')
|
,('R1','ROOM_UTILIZATION','REGULAR')
|
,('R1','STAFFED_ROOM_UTILIZATION','COVID')
|
,('R1','STAFFED_ROOM_UTILIZATION','REGULAR')
|
,('R1','TURNOVER_MINUTES','REGULAR')
|
;
|
|
INSERT INTO location_master (region_id,location_id) VALUES
|
('R1','Location_X')
|
;
|
|
INSERT INTO room_master (room_id,location_id) VALUES
|
('room_1','Location_X')
|
;
|
|
|
INSERT INTO surgery_holiday (region_id,holiday_date,holiday_type) VALUES
|
('R1','2020-05-07','COVID')
|
;
|
|
INSERT INTO orcase_essentials (surgery_date,location,room_id) VALUES
|
('2020-05-07','Location_X','room_1')
|
,('2020-05-07','Location_X','room_1')
|
,('2020-05-07','Location_X','room_1')
|
;
|
|
INSERT INTO orcase_essentials_cs (surgery_date,location,room_id) VALUES
|
('2020-05-07','Location_X','room_1')
|
,('2020-05-07','Location_X','room_1')
|
,('2020-05-07','Location_X','room_1')
|
;
|