Closed wdcn closed 5 years ago
agreed type input "TH" (2 letter string)
done, run below script before run the app, better sharescreen with me before you run the script
ALTER table cancer_type add cancer_type_short_name VARCHAR(20) NOT NULL; ALTER table cancer_type add status tp_status default 'active'; ALTER table machine_type add status tp_status default 'active';
then run data.sql from github
DROP TYPE IF EXISTS tp_pathology_status cascade; CREATE TYPE tp_pathology_status AS ENUM ('malignant','benign');
ALTER TYPE tp_pathology_status ADD VALUE 'Malignant'; ALTER TYPE tp_pathology_status ADD VALUE 'Benign';
UPDATE roi_image SET pathology = 'Malignant' WHERE pathology = 'malignant'; UPDATE roi_image SET pathology = 'Benign' WHERE pathology = 'benign';
ALTER TYPE tp_pathology_status RENAME TO tp_pathology_status_old; CREATE TYPE tp_pathology_status AS ENUM('Malignant', 'Benign'); DROP VIEW IF EXISTS public.v_roi_image cascade;
ALTER TABLE roi_image ALTER COLUMN pathology TYPE tp_pathology_status USING pathology::text::tp_pathology_status; DROP TYPE tp_pathology_status_old;
then run view.sql from github
update scripts
TRUNCATE public.cancer_type, public.machine_type RESTART IDENTITY; ALTER table cancer_type add cancer_type_short_name VARCHAR(20) NOT NULL; ALTER table cancer_type add status tp_status default 'active'; ALTER table machine_type add status tp_status default 'active';
then run data.sql from github
//manualy add enum types (Malignant and Benign) on tp_pathology_status 👍 //ALTER TYPE tp_pathology_status ADD VALUE 'Malignant' AFTER 'malignant'; //ALTER TYPE tp_pathology_status ADD VALUE 'Benign' AFTER 'benign';
UPDATE roi_image SET pathology = 'Malignant' WHERE pathology = 'malignant'; UPDATE roi_image SET pathology = 'Benign' WHERE pathology = 'benign';
ALTER TYPE tp_pathology_status RENAME TO tp_pathology_status_old; CREATE TYPE tp_pathology_status AS ENUM('Malignant', 'Benign');
DROP VIEW IF EXISTS public.v_roi_image cascade;
ALTER TABLE roi_image ALTER COLUMN pathology TYPE tp_pathology_status USING pathology::text::tp_pathology_status; DROP TYPE tp_pathology_status_old;
then run view.sql from github
现在的程序不包括癌症type,需要根据癌症来增加一个对应的参数
Lung 就去掉了