--CDA_DGN_NEWBORN_AKENEO
CREATE TABLE AKUZ.T_CDA_DGN_NEWBORN_AKENEO
(
    "cdadgnnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_DGN_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_DGN_NEWBORN_AKENEO
PRIMARY KEY (CdaDgnNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_DGN_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_DGN_NEWBORN_AKENEO_CdaNe_96D0E2D4
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
--CDA_SUM_NEWBORN_AKENEO
CREATE TABLE AKUZ.T_CDA_SUM_NEWBORN_AKENEO
(
    "cdasumnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_SUM_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_SUM_NEWBORN_AKENEO
PRIMARY KEY (CdaSumNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_SUM_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_SUM_NEWBORN_AKENEO_CdaNe_EDC6C1FE
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
--CDA_RESLAB_NEWBORN_AKENEO
CREATE TABLE AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO
(
    "cdareslabnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_RESLAB_NEWBORN_AKENEO
PRIMARY KEY (CdaReslabNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_RESLAB_NEWBORN_AKENEO_Cd_5FE60A12
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
/***** Object:  Table AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO *****/
CREATE TABLE AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO
(
    "cdascoreslabodelinewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL,
    "pointscount" integer NULL,
    "measuringscaletime" timestamp NULL
);
ALTER TABLE AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_SCORES_LABODELI_NEWBORN_AKENEO
PRIMARY KEY (CdaScoresLabodeliNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_SCORES_LABODELI_NEWBORN__20FC144C
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
/***** Object:  Table AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO *****/
CREATE TABLE AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO
(
    "cdaservicesnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_SERVICES_NEWBORN_AKENEO
PRIMARY KEY (CdaServicesNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_SERVICES_NEWBORN_AKENEO__9170F04F
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
CREATE TABLE AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS
(
    "cdaepicrisisnewborndepartmentsid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS ADD CONSTRAINT PK_T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS
PRIMARY KEY (CdaEpicrisisNewbornDepartmentsID);
ALTER TABLE AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_EPICRISIS_NEWBORN_DEPART_00A14505
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
/***** Object:  Table AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO *****/
CREATE TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO
(
    "cdapathologicalreactionsnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO
PRIMARY KEY (CdaPathologicalReactionsNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_PATHOLOGICAL_REACTIONS_N_F91B063B
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
/***** Object:  Table AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO *****/
CREATE TABLE AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO
(
    "cdaprocedurenewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_PROCEDURE_NEWBORN_AKENEO
PRIMARY KEY (CdaProcedureNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_PROCEDURE_NEWBORN_AKENEO_1131C375
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
--CDA_RESCONS_NEWBORN_AKENEO
CREATE TABLE AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO
(
    "cdaresconsnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_RESCONS_NEWBORN_AKENEO
PRIMARY KEY (CdaResconsNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_RESCONS_NEWBORN_AKENEO_C_A2BC398D
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
--CDA_RESINSTR_NEWBORN_AKENEO
CREATE TABLE AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO
(
    "cdaresinstrnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_RESINSTR_NEWBORN_AKENEO
PRIMARY KEY (CdaResinstrNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_RESINSTR_NEWBORN_AKENEO__1D98B8B2
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
--CDA_SUR_NEWBORN_AKENEO
CREATE TABLE AKUZ.T_CDA_SUR_NEWBORN_AKENEO
(
    "cdasurnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_SUR_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_SUR_NEWBORN_AKENEO
PRIMARY KEY (CdaSurNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_SUR_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_SUR_NEWBORN_AKENEO_CdaNe_D835B14C
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
--CDA_VITALPARAM_NEWBORN_AKENEO
CREATE TABLE AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO
(
    "cdavitalparamnewbornakeneoid" uuid NOT NULL,
    "cdanewbornakeneo" uuid NULL
);
ALTER TABLE AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO ADD CONSTRAINT PK_T_CDA_VITALPARAM_NEWBORN_AKENEO
PRIMARY KEY (CdaVitalparamNewbornAkeneoID);
ALTER TABLE AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_NEWBORN_AKENEO_T_CDA_VITALPARAM_NEWBORN_AKENE_95DE2B08
FOREIGN KEY("cdanewbornakeneo") REFERENCES AKUZ.T_CDA_NEWBORN_AKENEO (CdaNewbornAkeneoID);
-------------------------------------------------------------------------------------
--VIMIS_PATIENT_STAYING_HOSPITALISATION
--убирается обязательность парента, чтобы не было проблем с секциями
ALTER TABLE AKUZ.T_VIMIS_PATIENT_STAYING_HOSPITALISATION ALTER COLUMN "vimissectionepicrisisdepartments" uuid set NULL;
-------------------------------------------------------------------------------------
--CDA_MEDICAMENT
--убирается обязательность парента, чтобы не было проблем с секциями
ALTER TABLE AKUZ.T_CDA_MEDICAMENT ALTER COLUMN "cdasectionsum" uuid set NULL;
-------------------------------------------------------------------------------------
--CDA_NON_MEDICAMENT
--убирается обязательность парента, чтобы не было проблем с секциями
ALTER TABLE AKUZ.T_CDA_NON_MEDICAMENT ALTER COLUMN "cdasectionsum" uuid set NULL;
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_MEDICAMENT ADD "cdasumnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_MEDICAMENT ADD CONSTRAINT FK_T_CDA_SUM_NEWBORN_AKENEO_T_CDA_MEDICAMENT_CdaSumNew_93B301A7
FOREIGN KEY("cdasumnewbornakeneo") REFERENCES AKUZ.T_CDA_SUM_NEWBORN_AKENEO (CdaSumNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NON_MEDICAMENT ADD "cdasumnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_NON_MEDICAMENT ADD CONSTRAINT FK_T_CDA_SUM_NEWBORN_AKENEO_T_CDA_NON_MEDICAMENT_CdaSu_6283595A
FOREIGN KEY("cdasumnewbornakeneo") REFERENCES AKUZ.T_CDA_SUM_NEWBORN_AKENEO (CdaSumNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_VIMIS_PATIENT_STAYING_HOSPITALISATION ADD "cdaepicrisisnewborndepartments" uuid NULL;
ALTER TABLE AKUZ.T_VIMIS_PATIENT_STAYING_HOSPITALISATION ADD CONSTRAINT FK_T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS_T_VIMIS_PATIENT_6F1019A0
FOREIGN KEY("cdaepicrisisnewborndepartments") REFERENCES AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS (CdaEpicrisisNewbornDepartmentsID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_APGAR_SCALE_NEWBORN_AKENEO ADD "cdascoreslabodelinewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_APGAR_SCALE_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_SCORES_LABODELI_NEWBORN_AKENEO_T_CDA_APGAR_SC_8099DF9B
FOREIGN KEY("cdascoreslabodelinewbornakeneo") REFERENCES AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO (CdaScoresLabodeliNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ADD "cdaresconsnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ADD CONSTRAINT FK_T_CDA_RESCONS_NEWBORN_AKENEO_T_CDA_CONS_RESULT_AKEN_D5B27014
FOREIGN KEY("cdaresconsnewbornakeneo") REFERENCES AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO (CdaResconsNewbornAkeneoID);
---------------------------------------------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_DGN_AKENEO ADD "cdadgnnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_DGN_AKENEO ADD CONSTRAINT FK_T_CDA_DGN_NEWBORN_AKENEO_T_CDA_DGN_AKENEO_CdaDgnNew_9787F72D
FOREIGN KEY("cdadgnnewbornakeneo") REFERENCES AKUZ.T_CDA_DGN_NEWBORN_AKENEO (CdaDgnNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO ADD "cdaresinstrnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO ADD CONSTRAINT FK_T_CDA_RESINSTR_NEWBORN_AKENEO_T_CDA_INSTRUMENTAL_RE_5DCC5F80
FOREIGN KEY("cdaresinstrnewbornakeneo") REFERENCES AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO (CdaResinstrNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_LAB_RESEARCH_MATHERINITY_AKENEO ADD "cdareslabnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_LAB_RESEARCH_MATHERINITY_AKENEO ADD CONSTRAINT FK_T_CDA_RESLAB_NEWBORN_AKENEO_T_CDA_LAB_RESEARCH_MATH_B00E5A1E
FOREIGN KEY("cdareslabnewbornakeneo") REFERENCES AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO (CdaReslabNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_OPERATION_AKENEO ADD "cdasurnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_OPERATION_AKENEO ADD CONSTRAINT FK_T_CDA_SUR_NEWBORN_AKENEO_T_CDA_OPERATION_AKENEO_Cda_D6918074
FOREIGN KEY("cdasurnewbornakeneo") REFERENCES AKUZ.T_CDA_SUR_NEWBORN_AKENEO (CdaSurNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTION_AKENEO ADD "cdapathologicalreactionsnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTION_AKENEO ADD CONSTRAINT FK_T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO_T_CDA_P_FCEAE374
FOREIGN KEY("cdapathologicalreactionsnewbornakeneo") REFERENCES AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO (CdaPathologicalReactionsNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_PROCEDURE_AKENEO ADD "cdaprocedurenewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_PROCEDURE_AKENEO ADD CONSTRAINT FK_T_CDA_PROCEDURE_NEWBORN_AKENEO_T_CDA_PROCEDURE_AKEN_7CB32D57
FOREIGN KEY("cdaprocedurenewbornakeneo") REFERENCES AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO (CdaProcedureNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_SERVICE_AKENEO ADD "cdaservicesnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_SERVICE_AKENEO ADD CONSTRAINT FK_T_CDA_SERVICES_NEWBORN_AKENEO_T_CDA_SERVICE_AKENEO__867C86BC
FOREIGN KEY("cdaservicesnewbornakeneo") REFERENCES AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO (CdaServicesNewbornAkeneoID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_VACCINATION_STATUS ADD "cdaimmnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_VACCINATION_STATUS ADD CONSTRAINT FK_T_CDA_SECTION_IMM_T_CDA_VACCINATION_STATUS_CdaImmNe_AA94EB1E
FOREIGN KEY("cdaimmnewbornakeneo") REFERENCES AKUZ.T_CDA_SECTION_IMM (CdaSectionID);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_VP_IN_SECTION_AKENEO ADD "cdavitalparamnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_VP_IN_SECTION_AKENEO ADD CONSTRAINT FK_T_CDA_VITALPARAM_NEWBORN_AKENEO_T_CDA_VP_IN_SECTION_5782605C
FOREIGN KEY("cdavitalparamnewbornakeneo") REFERENCES AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO (CdaVitalparamNewbornAkeneoID);
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
--добавление в cda_newborn_akeneo
-- Tables

-- Alters

do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_DGN_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_DGN_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_DGN_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_DGN_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_DGN_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_DGN_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_DGN_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_DGN_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS' and indexname ilike 'UQ_T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS DROP CONSTRAINT if exists UQ_T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS_CdaNewbornAkeneo ON AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_PROCEDURE_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_PROCEDURE_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_PROCEDURE_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_PROCEDURE_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_PROCEDURE_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_RESCONS_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_RESCONS_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_RESCONS_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_RESCONS_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_RESCONS_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_RESINSTR_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_RESINSTR_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_RESINSTR_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_RESINSTR_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_RESINSTR_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_RESLAB_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_RESLAB_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_RESLAB_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_RESLAB_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_RESLAB_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SCORES_LABODELI_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_SCORES_LABODELI_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_SCORES_LABODELI_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_SCORES_LABODELI_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_SCORES_LABODELI_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SERVICES_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_SERVICES_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_SERVICES_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_SERVICES_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_SERVICES_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SUM_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_SUM_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_SUM_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SUM_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_SUM_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_SUM_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_SUM_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_SUM_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_SUR_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_SUR_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_SUR_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_SUR_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_SUR_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_SUR_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_SUR_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_SUR_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
do $$ begin
IF EXISTS(select * from pg_indexes where schemaname ilike 'AKUZ' and tablename ilike 'T_CDA_VITALPARAM_NEWBORN_AKENEO' and indexname ilike 'UQ_T_CDA_VITALPARAM_NEWBORN_AKENEO_CdaNewbornAkeneo')
THEN
drop index AKUZ.UQ_T_CDA_VITALPARAM_NEWBORN_AKENEO_CdaNewbornAkeneo;
END IF;
end; $$;
ALTER TABLE AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO DROP CONSTRAINT if exists UQ_T_CDA_VITALPARAM_NEWBORN_AKENEO_CdaNewbornAkeneo;
ALTER TABLE AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO DROP COLUMN if exists CdaNewbornAkeneo_UQ;

CREATE UNIQUE INDEX UQ_T_CDA_VITALPARAM_NEWBORN_AKENEO_CdaNewbornAkeneo ON AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO(CdaNewbornAkeneo);
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO ADD "cdaimmnewbornakeneo" uuid NULL;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO ADD CONSTRAINT FK_T_CDA_SECTION_IMM_T_CDA_NEWBORN_AKENEO_CdaImmNewbornAkeneo
FOREIGN KEY("cdaimmnewbornakeneo") REFERENCES AKUZ.T_CDA_SECTION_IMM (CdaSectionID);
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_DGN_NEWBORN_AKENEO(CdaDgnNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionDgnAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionDgnAkeneo is not null;
update cda
set cda.CdaDgnNewbornAkeneo = cda.CdaSectionDgn, cda.CdaSectionDgn = null
from akuz.T_CDA_DGN_AKENEO cda
	join akuz.T_CDA_DGN_NEWBORN_AKENEO aa on aa.CdaDgnNewbornAkeneoID = cda.CdaSectionDgn;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS(CdaEpicrisisNewbornDepartmentsID, CdaNewbornAkeneo) 
select cdasec.VimisSectionEpicrisisDepartments, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec	 
	 where cdasec.VimisSectionEpicrisisDepartments is not null;
update cda
set cda.CdaEpicrisisNewbornDepartments = cda.VimisSectionEpicrisisDepartments, cda.VimisSectionEpicrisisDepartments = null
from akuz.T_VIMIS_PATIENT_STAYING_HOSPITALISATION cda 
join akuz.T_CDA_EPICRISIS_NEWBORN_DEPARTMENTS aa on aa.CdaEpicrisisNewbornDepartmentsID = cda.VimisSectionEpicrisisDepartments;
-------------------------------------------------------------------------------------
update cda
set cda.CdaImmNewbornAkeneo = cda.CdaSectionImmAkeneo, CdaSectionImmAkeneo = null
from akuz.T_CDA_VACCINATION_STATUS cda;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO(CdaPathologicalReactionsNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionAllAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionAllAkeneo is not null;
update cda
set cda.CdaPathologicalReactionsNewbornAkeneo = cda.CdaSectionAllAkeneo, cda.CdaSectionAllAkeneo = null
from akuz.T_CDA_PATHOLOGICAL_REACTION_AKENEO cda
join akuz.T_CDA_PATHOLOGICAL_REACTIONS_NEWBORN_AKENEO aa on aa.CdaPathologicalReactionsNewbornAkeneoID = cda.CdaSectionAllAkeneo;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_PROCEDURE_NEWBORN_AKENEO (CdaProcedureNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionProcedureAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec	 
	 where cdasec.CdaSectionProcedureAkeneo is not null;
update cda
set cda.CdaProcedureNewbornAkeneo = cda.CdaSectionProcedureAkeneo, cda.CdaSectionProcedureAkeneo = null
from akuz.T_CDA_PROCEDURE_AKENEO cda
join akuz.T_CDA_PROCEDURE_NEWBORN_AKENEO aa on aa.CdaProcedureNewbornAkeneoID = cda.CdaSectionProcedureAkeneo;
-------------------------------------------------------------------------------------	 	 
INSERT INTO AKUZ.T_CDA_RESCONS_NEWBORN_AKENEO (CdaResconsNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionResconsAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionResconsAkeneo is not null;
update cda
set cda.CdaResconsNewbornAkeneo = cda.CdaSectionResconsAkeneo, cda.CdaSectionResconsAkeneo = null
from akuz.T_CDA_CONS_RESULT_AKENEO cda
join akuz.T_CDA_RESCONS_NEWBORN_AKENEO aa on aa.CdaResconsNewbornAkeneoID = cda.CdaSectionResconsAkeneo;
-------------------------------------------------------------------------------------	 
INSERT INTO AKUZ.T_CDA_RESINSTR_NEWBORN_AKENEO (CdaResinstrNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionResinstrAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionResinstrAkeneo is not null;
update cda
set cda.CdaResinstrNewbornAkeneo = cda.CdaSectionResinstrAkeneo, cda.CdaSectionResinstrAkeneo = null
from akuz.T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO cda
join akuz.T_CDA_RESINSTR_NEWBORN_AKENEO aa on aa.CdaResinstrNewbornAkeneoID = cda.CdaSectionResinstrAkeneo;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_RESLAB_NEWBORN_AKENEO(CdaReslabNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionReslabMatherinityAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionReslabMatherinityAkeneo is not null;
update cda
set cda.CdaReslabNewbornAkeneo = cda.CdaSectionReslabMatherinityAkeneo, cda.CdaSectionReslabMatherinityAkeneo = null
from akuz.T_CDA_LAB_RESEARCH_MATHERINITY_AKENEO cda
join akuz.T_CDA_RESLAB_NEWBORN_AKENEO aa on aa.CdaReslabNewbornAkeneoID = cda.CdaSectionReslabMatherinityAkeneo;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO (CdaScoresLabodeliNewbornAkeneoID, CdaNewbornAkeneo, PointsCount, MeasuringScaleTime) 
select cdasec.CdaSectionScoresLabodeliAkeneo, cdasec.CdaNewbornAkeneoID, labodeli.PointsCount, labodeli.MeasuringScaleTime
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 join AKUZ.T_CDA_SECTION_SCORES_LABODELI_AKENEO labodeli on cdasec.CdaSectionLabodeliAkeneo = labodeli.CdaSectionID
	 where cdasec.CdaSectionScoresLabodeliAkeneo is not null;
update cda
set cda.CdaScoresLabodeliNewbornAkeneo = cda.CdaSectionScoresLabodeliAkeneo, cda.CdaSectionScoresLabodeliAkeneo = null
from akuz.T_CDA_APGAR_SCALE_NEWBORN_AKENEO cda
join akuz.T_CDA_SCORES_LABODELI_NEWBORN_AKENEO aa on aa.CdaScoresLabodeliNewbornAkeneoID = cda.CdaSectionScoresLabodeliAkeneo;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_SERVICES_NEWBORN_AKENEO (CdaServicesNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionServicesAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionServicesAkeneo is not null;
update cda
set cda.CdaServicesNewbornAkeneo = cda.CdaSectionServicesAkeneo, cda.CdaSectionServicesAkeneo = null
from akuz.T_CDA_SERVICE_AKENEO cda
join akuz.T_CDA_SERVICES_NEWBORN_AKENEO aa on aa.CdaServicesNewbornAkeneoID = cda.CdaSectionServicesAkeneo;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_SUM_NEWBORN_AKENEO (CdaSumNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionSum, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionSum is not null;
update cda
set cda.CdaSumNewbornAkeneo = cda.CdaSectionSum, cda.CdaSectionSum = null
from akuz.T_CDA_MEDICAMENT cda
join akuz.T_CDA_SUM_NEWBORN_AKENEO aa on aa.CdaSumNewbornAkeneoID = cda.CdaSectionSum;
update cda
set cda.CdaSumNewbornAkeneo = cda.CdaSectionSum, CdaSectionSum = null
from akuz.T_CDA_NON_MEDICAMENT cda
join akuz.T_CDA_SUM_NEWBORN_AKENEO aa on aa.CdaSumNewbornAkeneoID = cda.CdaSectionSum;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_SUR_NEWBORN_AKENEO (CdaSurNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionSurAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionSurAkeneo is not null;
update cda
set cda.CdaSurNewbornAkeneo = cda.CdaSectionSurAkeneo, cda.CdaSectionSurAkeneo = null
from akuz.T_CDA_OPERATION_AKENEO cda
join akuz.T_CDA_SUR_NEWBORN_AKENEO aa on aa.CdaSurNewbornAkeneoID = cda.CdaSectionSurAkeneo;
-------------------------------------------------------------------------------------
INSERT INTO AKUZ.T_CDA_VITALPARAM_NEWBORN_AKENEO (CdaVitalparamNewbornAkeneoID, CdaNewbornAkeneo) 
select cdasec.CdaSectionVitalparamEpicrisisAkeneo, cdasec.CdaNewbornAkeneoID
     from AKUZ.T_CDA_NEWBORN_AKENEO cdasec
	 where cdasec.CdaSectionVitalparamEpicrisisAkeneo is not null;
update cda
set cda.CdaVitalparamNewbornAkeneo = cda.CdaSectionVitalparamEpicrisisAkeneo, cda.CdaSectionVitalparamEpicrisisAkeneo = null
from akuz.T_CDA_VP_IN_SECTION_AKENEO cda
join akuz.T_CDA_VITALPARAM_NEWBORN_AKENEO aa on aa.CdaVitalparamNewbornAkeneoID = cda.CdaSectionVitalparamEpicrisisAkeneo;
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionDgnAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectiondgnakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_VimisSectionEpic_2BC3F13A;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "vimissectionepicrisisdepartments";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_IMM_T_CDA_NEWBORN_AKENEO_CdaSectionImmAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionimmakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionAllAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionallakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionProcedureAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionprocedureakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionResconsAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionresconsakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionResinstrAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionresinstrakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionReslab_815F44F3;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionreslabmatherinityakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_SCORES_LABODELI_AKENEO_T_CDA_NEWBORN__4A7F95A3;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionscoreslabodeliakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionServicesAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionservicesakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionSum;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionsum";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionSurAkeneo;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionsurakeneo";
-------------------------------------------------------------------------------------
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP CONSTRAINT FK_T_CDA_SECTION_T_CDA_NEWBORN_AKENEO_CdaSectionVitalp_01BCCBA5;
ALTER TABLE AKUZ.T_CDA_NEWBORN_AKENEO DROP COLUMN "cdasectionvitalparamepicrisisakeneo";
-------------------------------------------------------------------------------------

