-- T_CDA_IDENTIFIED_PATH
ALTER TABLE AKUZ.T_CDA_IDENTIFIED_PATH ALTER COLUMN "pathdescr" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_IDENTIFIED_PATH ALTER COLUMN "pathdescr" DROP NOT NULL;

-- T_CDA_INDICATION_NOSOLOGICAL_UNIT
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clinicaldiagnosisdescription" SET DATA TYPE varchar(2048);
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clinicaldiagnosisdescription" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clarificationnature" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clarificationnature" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clarificationexternalcause" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clarificationexternalcause" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clarificationtypeinjury" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "clarificationtypeinjury" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "informationdiagnosisfirsttime" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "informationdiagnosisfirsttime" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "additionalinformation" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "additionalinformation" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "substantiationdiagnosis" SET DATA TYPE varchar(6000);
UPDATE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT SET "substantiationdiagnosis" = '' WHERE "substantiationdiagnosis" IS NULL;
ALTER TABLE AKUZ.T_CDA_INDICATION_NOSOLOGICAL_UNIT ALTER COLUMN "substantiationdiagnosis" SET NOT NULL;

-- T_CDA_INSTRUCTION_ADD_INFO
ALTER TABLE AKUZ.T_CDA_INSTRUCTION_ADD_INFO ALTER COLUMN "instruction" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_INSTRUCTION_ADD_INFO SET "instruction" = '' WHERE "instruction" IS NULL;
ALTER TABLE AKUZ.T_CDA_INSTRUCTION_ADD_INFO ALTER COLUMN "instruction" SET NOT NULL;

-- T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO
ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO ALTER COLUMN "resultorconclusiontext" SET DATA TYPE varchar(1500);
ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO ALTER COLUMN "resultorconclusiontext" DROP NOT NULL;

-- T_CDA_LAB_GROUP_AKENEO
ALTER TABLE AKUZ.T_CDA_LAB_GROUP_AKENEO ALTER COLUMN "resultnote" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_LAB_GROUP_AKENEO ALTER COLUMN "resultnote" DROP NOT NULL;

-- T_CDA_LAB_RESEARCH_AKENEO
ALTER TABLE AKUZ.T_CDA_LAB_RESEARCH_AKENEO ALTER COLUMN "notetext" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_LAB_RESEARCH_AKENEO ALTER COLUMN "notetext" DROP NOT NULL;

-- T_CDA_LINKDOCS_CIVIL
ALTER TABLE AKUZ.T_CDA_LINKDOCS_CIVIL ALTER COLUMN "documentnote" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_LINKDOCS_CIVIL ALTER COLUMN "documentnote" DROP NOT NULL;

-- T_CDA_MEDICAL_SERVICE_INFO
ALTER TABLE AKUZ.T_CDA_MEDICAL_SERVICE_INFO ALTER COLUMN "comment" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_MEDICAL_SERVICE_INFO ALTER COLUMN "comment" DROP NOT NULL;

--T_CDA_MSE_REFERRAL
ALTER TABLE AKUZ.T_CDA_MSE_REFERRAL ALTER COLUMN "backtalon" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_MSE_REFERRAL ALTER COLUMN "backtalon" DROP NOT NULL;

--T_CDA_LINKED_DOCUMENTS_INFO
ALTER TABLE AKUZ.T_CDA_LINKED_DOCUMENTS_INFO ALTER COLUMN "documentnote" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_LINKED_DOCUMENTS_INFO ALTER COLUMN "documentnote" DROP NOT NULL;

--T_CDA_NOSOLOGICAL_UNIT
ALTER TABLE AKUZ.T_CDA_NOSOLOGICAL_UNIT ALTER COLUMN "clinicdiagn" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_NOSOLOGICAL_UNIT SET "clinicdiagn" = '' WHERE "clinicdiagn" IS NULL;
ALTER TABLE AKUZ.T_CDA_NOSOLOGICAL_UNIT ALTER COLUMN "clinicdiagn" SET NOT NULL;

--T_CDA_ONC_CONS_GISTRESULT_DETAIL
ALTER TABLE AKUZ.T_CDA_ONC_CONS_GISTRESULT_DETAIL ALTER COLUMN "conclusion" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_ONC_CONS_GISTRESULT_DETAIL ALTER COLUMN "conclusion" DROP NOT NULL;

--[T_CDA_ONC_CONS_LINKDOCS_DETAIL]
ALTER TABLE AKUZ.T_CDA_ONC_CONS_LINKDOCS_DETAIL ALTER COLUMN "note" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_ONC_CONS_LINKDOCS_DETAIL ALTER COLUMN "note" DROP NOT NULL;

--T_CDA_ONC_CONS_RESCONS_DETAIL
ALTER TABLE AKUZ.T_CDA_ONC_CONS_RESCONS_DETAIL ALTER COLUMN "conclusion" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_ONC_CONS_RESCONS_DETAIL SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_ONC_CONS_RESCONS_DETAIL ALTER COLUMN "conclusion" SET NOT NULL;

--T_CDA_ONC_CONS_RESINSTR_DETAIL
ALTER TABLE AKUZ.T_CDA_ONC_CONS_RESINSTR_DETAIL ALTER COLUMN "conclusion" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_ONC_CONS_RESINSTR_DETAIL SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_ONC_CONS_RESINSTR_DETAIL ALTER COLUMN "conclusion" SET NOT NULL;

--T_CDA_ONC_CONS_RESLAB_DETAIL
ALTER TABLE AKUZ.T_CDA_ONC_CONS_RESLAB_DETAIL ALTER COLUMN "conclusion" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_ONC_CONS_RESLAB_DETAIL ALTER COLUMN "conclusion" DROP NOT NULL;

--T_CDA_ONC_CONS_SCORES_DETAIL
ALTER TABLE AKUZ.T_CDA_ONC_CONS_SCORES_DETAIL ALTER COLUMN "comment" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_ONC_CONS_SCORES_DETAIL ALTER COLUMN "comment" DROP NOT NULL;

-- T_CDA_ONC_CONS_SERVICES_DETAIL
ALTER TABLE AKUZ.T_CDA_ONC_CONS_SERVICES_DETAIL ALTER COLUMN "comment" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_ONC_CONS_SERVICES_DETAIL ALTER COLUMN "comment" DROP NOT NULL;

--T_CDA_ONC_CONS_SUM_DETAIL_COMPL
ALTER TABLE AKUZ.T_CDA_ONC_CONS_SUM_DETAIL_COMPL ALTER COLUMN "complicationdescription" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_ONC_CONS_SUM_DETAIL_COMPL ALTER COLUMN "complicationdescription" DROP NOT NULL;

--T_CDA_PROCEDURE_AKENEO
ALTER TABLE AKUZ.T_CDA_PROCEDURE_AKENEO ALTER COLUMN "proceduredescription" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_PROCEDURE_AKENEO SET "proceduredescription" = '' WHERE "proceduredescription" IS NULL;
ALTER TABLE AKUZ.T_CDA_PROCEDURE_AKENEO ALTER COLUMN "proceduredescription" SET NOT NULL;

--T_CDA_OPERATION_AKENEO
ALTER TABLE AKUZ.T_CDA_OPERATION_AKENEO ALTER COLUMN "operationdescription" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_OPERATION_AKENEO SET "operationdescription" = '' WHERE "operationdescription" IS NULL;
ALTER TABLE AKUZ.T_CDA_OPERATION_AKENEO ALTER COLUMN "operationdescription" SET NOT NULL;

--T_CDA_PATHOLOGICAL_REACTION_AKENEO
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTION_AKENEO ALTER COLUMN "comment" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_PATHOLOGICAL_REACTION_AKENEO ALTER COLUMN "comment" DROP NOT NULL;


-- T_CDA_RELATED_DOCUMENT_DETAILS
ALTER TABLE AKUZ.T_CDA_RELATED_DOCUMENT_DETAILS ALTER COLUMN "documentdetails" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_RELATED_DOCUMENT_DETAILS ALTER COLUMN "documentdetails" DROP NOT NULL;

--T_CDA_RESLAB_GROUP_ELEMENT_V4
ALTER TABLE AKUZ.T_CDA_RESLAB_GROUP_ELEMENT_V4 ALTER COLUMN "researchcomment" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_RESLAB_GROUP_ELEMENT_V4 ALTER COLUMN "researchcomment" DROP NOT NULL;

-- T_CDA_RESLAB_REPORT_FOR_ELMK
ALTER TABLE AKUZ.T_CDA_RESLAB_REPORT_FOR_ELMK ALTER COLUMN "note" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_RESLAB_REPORT_FOR_ELMK ALTER COLUMN "note" DROP NOT NULL;

--T_CDA_RESULTS_RESEARCH
ALTER TABLE AKUZ.T_CDA_RESULTS_RESEARCH ALTER COLUMN "conclusion" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_RESULTS_RESEARCH SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_RESULTS_RESEARCH ALTER COLUMN "conclusion" SET NOT NULL;

--T_CDA_SECTION_BLOOD_DONATION_LINKDOCS_DETAIL
ALTER TABLE AKUZ.T_CDA_SECTION_BLOOD_DONATION_LINKDOCS_DETAIL ALTER COLUMN "note" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_BLOOD_DONATION_LINKDOCS_DETAIL ALTER COLUMN "note" DROP NOT NULL;

--T_CDA_SECTION_BLOOD_SYSTEM
ALTER TABLE AKUZ.T_CDA_SECTION_BLOOD_SYSTEM ALTER COLUMN "bloodsystem" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_BLOOD_SYSTEM SET "bloodsystem" = '' WHERE "bloodsystem" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_BLOOD_SYSTEM ALTER COLUMN "bloodsystem" SET NOT NULL;


-- T_CDA_SECTION_DIGESTIVE_SYSTEM
ALTER TABLE AKUZ.T_CDA_SECTION_DIGESTIVE_SYSTEM ALTER COLUMN "digestivesystem" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_DIGESTIVE_SYSTEM SET "digestivesystem" = '' WHERE "digestivesystem" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_DIGESTIVE_SYSTEM ALTER COLUMN "digestivesystem" SET NOT NULL;


-- T_CDA_SECTION_DOCINFO_PROTOCOLV2
ALTER TABLE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 ALTER COLUMN "informdecision" SET DATA TYPE varchar(1024);
UPDATE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 SET "informdecision" = '' WHERE "informdecision" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 ALTER COLUMN "informdecision" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 ALTER COLUMN "decisiontext" SET DATA TYPE varchar(1024);
UPDATE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 SET "decisiontext" = '' WHERE "decisiontext" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_DOCINFO_PROTOCOLV2 ALTER COLUMN "decisiontext" SET NOT NULL;

-- T_CDA_SECTION_DRIVER_RESEARCH_RESLAB_DETAIL
ALTER TABLE AKUZ.T_CDA_SECTION_DRIVER_RESEARCH_RESLAB_DETAIL ALTER COLUMN "labresearch" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_DRIVER_RESEARCH_RESLAB_DETAIL ALTER COLUMN "labresearch" DROP NOT NULL;


-- T_CDA_SECTION_ELDERLY_DOCINFO
ALTER TABLE AKUZ.T_CDA_SECTION_ELDERLY_DOCINFO ALTER COLUMN "medicalcontraindications" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_ELDERLY_DOCINFO ALTER COLUMN "medicalcontraindications" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_ELDERLY_DOCINFO ALTER COLUMN "comment" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_ELDERLY_DOCINFO ALTER COLUMN "comment" DROP NOT NULL;

-- T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT
ALTER TABLE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT ALTER COLUMN "recommendation" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT SET "recommendation" = '' WHERE "recommendation" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT ALTER COLUMN "recommendation" SET NOT NULL;

--T_CDA_SECTION_KID_SANATORY_CARD_SUM
ALTER TABLE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_SUM ALTER COLUMN "performedtreatment" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_SUM SET "performedtreatment" = '' WHERE "performedtreatment" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_SUM ALTER COLUMN "performedtreatment" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_SUM ALTER COLUMN "epicrisis" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_SUM SET "epicrisis" = '' WHERE "epicrisis" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_KID_SANATORY_CARD_SUM ALTER COLUMN "epicrisis" SET NOT NULL;

-- T_CDA_SECTION_LABORATORY_RESULT
ALTER TABLE AKUZ.T_CDA_SECTION_LABORATORY_RESULT ALTER COLUMN "summary" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_LABORATORY_RESULT ALTER COLUMN "summary" DROP NOT NULL;

-- T_CDA_SECTION_LABORATORY_RESULTS
ALTER TABLE AKUZ.T_CDA_SECTION_LABORATORY_RESULTS ALTER COLUMN "result" SET DATA TYPE varchar(4000);
ALTER TABLE AKUZ.T_CDA_SECTION_LABORATORY_RESULTS ALTER COLUMN "result" DROP NOT NULL;


-- T_CDA_SECTION_LINKDOCS_CHILD
ALTER TABLE AKUZ.T_CDA_SECTION_LINKDOCS_CHILD ALTER COLUMN "documenttext" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_LINKDOCS_CHILD ALTER COLUMN "documenttext" DROP NOT NULL;

-- T_CDA_SECTION_LINKDOCS_ELDERLY
ALTER TABLE AKUZ.T_CDA_SECTION_LINKDOCS_ELDERLY ALTER COLUMN "documenttext" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_LINKDOCS_ELDERLY ALTER COLUMN "documenttext" DROP NOT NULL;

-- T_CDA_SECTION_LOCAL_STATUS
ALTER TABLE AKUZ.T_CDA_SECTION_LOCAL_STATUS ALTER COLUMN "localstatus" SET DATA TYPE varchar(6000);
UPDATE AKUZ.T_CDA_SECTION_LOCAL_STATUS SET "localstatus" = '' WHERE "localstatus" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_LOCAL_STATUS ALTER COLUMN "localstatus" SET NOT NULL;

-- T_CDA_SECTION_MEDICAL_INTERVENTIONS
ALTER TABLE AKUZ.T_CDA_SECTION_MEDICAL_INTERVENTIONS ALTER COLUMN "medicalinterventions" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_SECTION_MEDICAL_INTERVENTIONS SET "medicalinterventions" = '' WHERE "medicalinterventions" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_MEDICAL_INTERVENTIONS ALTER COLUMN "medicalinterventions" SET NOT NULL;

-- T_CDA_SECTION_GENITOURINARY_SYSTEM
ALTER TABLE AKUZ.T_CDA_SECTION_GENITOURINARY_SYSTEM ALTER COLUMN "genitourinarysystem" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_SECTION_GENITOURINARY_SYSTEM SET "genitourinarysystem" = '' WHERE "genitourinarysystem" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_GENITOURINARY_SYSTEM ALTER COLUMN "genitourinarysystem" SET NOT NULL;

-- T_CDA_SECTION_NONDRUG_TREATMENT
ALTER TABLE AKUZ.T_CDA_SECTION_NONDRUG_TREATMENT ALTER COLUMN "nondrugtreatment" SET DATA TYPE varchar(2500);
UPDATE AKUZ.T_CDA_SECTION_NONDRUG_TREATMENT SET "nondrugtreatment" = '' WHERE "nondrugtreatment" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_NONDRUG_TREATMENT ALTER COLUMN "nondrugtreatment" SET NOT NULL;

-- T_CDA_SECTION_ONC_CONS_ANAM
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_ANAM ALTER COLUMN "courseofdisease" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_ONC_CONS_ANAM SET "courseofdisease" = '' WHERE "courseofdisease" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_ANAM ALTER COLUMN "courseofdisease" SET NOT NULL;

-- T_CDA_SECTION_ONC_CONS_CONSILIUM
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_CONSILIUM ALTER COLUMN "decision" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_ONC_CONS_CONSILIUM SET "decision" = '' WHERE "decision" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_CONSILIUM ALTER COLUMN "decision" SET NOT NULL;


-- T_CDA_SECTION_ONC_CONS_PATOBJ
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_PATOBJ ALTER COLUMN "patientcondition" SET DATA TYPE varchar(1024);
UPDATE AKUZ.T_CDA_SECTION_ONC_CONS_PATOBJ SET "patientcondition" = '' WHERE "patientcondition" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_PATOBJ ALTER COLUMN "patientcondition" SET NOT NULL;

-- T_CDA_SECTION_ONC_CONS_RECEXAM
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_RECEXAM ALTER COLUMN "recommendation" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_SECTION_ONC_CONS_RECEXAM SET "recommendation" = '' WHERE "recommendation" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_RECEXAM ALTER COLUMN "recommendation" SET NOT NULL;

-- T_CDA_SECTION_ONC_CONS_RECOTHER
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_RECOTHER ALTER COLUMN "otherrecommendations" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_ONC_CONS_RECOTHER SET "otherrecommendations" = '' WHERE "otherrecommendations" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_ONC_CONS_RECOTHER ALTER COLUMN "otherrecommendations" SET NOT NULL;

-- T_CDA_SECTION_PLANSUR
ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "preoperativeepicrisis" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "preoperativeepicrisis" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "operationjustification" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "operationjustification" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "operationplan" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "operationplan" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "premedication" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_PLANSUR ALTER COLUMN "premedication" DROP NOT NULL;


-- T_CDA_SECTION_MENTAL_STATUS
ALTER TABLE AKUZ.T_CDA_SECTION_MENTAL_STATUS ALTER COLUMN "mentalstatus" SET DATA TYPE varchar(3000);
UPDATE AKUZ.T_CDA_SECTION_MENTAL_STATUS SET "mentalstatus" = '' WHERE "mentalstatus" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_MENTAL_STATUS ALTER COLUMN "mentalstatus" SET NOT NULL;


-- T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM
ALTER TABLE AKUZ.T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM ALTER COLUMN "musculoskeletalsystem" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM SET "musculoskeletalsystem" = '' WHERE "musculoskeletalsystem" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM ALTER COLUMN "musculoskeletalsystem" SET NOT NULL;

-- T_CDA_SECTION_NERVOUS_SYSTEM
ALTER TABLE AKUZ.T_CDA_SECTION_NERVOUS_SYSTEM ALTER COLUMN "nervoussystem" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_NERVOUS_SYSTEM SET "nervoussystem" = '' WHERE "nervoussystem" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_NERVOUS_SYSTEM ALTER COLUMN "nervoussystem" SET NOT NULL;

-- T_CDA_SECTION_NONDRUG
ALTER TABLE AKUZ.T_CDA_SECTION_NONDRUG ALTER COLUMN "medicalproceduredescription" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_SECTION_NONDRUG SET "medicalproceduredescription" = '' WHERE "medicalproceduredescription" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_NONDRUG ALTER COLUMN "medicalproceduredescription" SET NOT NULL;

-- T_CDA_SECTION_REGIME_DSIPANDPMO
ALTER TABLE AKUZ.T_CDA_SECTION_REGIME_DSIPANDPMO ALTER COLUMN "recomendations" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_REGIME_DSIPANDPMO ALTER COLUMN "recomendations" DROP NOT NULL;

-- T_CDA_SECTION_REGIME_NEWBORN
ALTER TABLE AKUZ.T_CDA_SECTION_REGIME_NEWBORN ALTER COLUMN "recommendedtreatment" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_REGIME_NEWBORN ALTER COLUMN "recommendedtreatment" DROP NOT NULL;

-- T_CDA_SECTION_RESINFO_AKENEO
ALTER TABLE AKUZ.T_CDA_SECTION_RESINFO_AKENEO ALTER COLUMN "protocol" SET DATA TYPE varchar(1024);
UPDATE AKUZ.T_CDA_SECTION_RESINFO_AKENEO SET "protocol" = '' WHERE "protocol" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_RESINFO_AKENEO ALTER COLUMN "protocol" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_RESINFO_AKENEO ALTER COLUMN "conclusion" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_RESINFO_AKENEO SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_RESINFO_AKENEO ALTER COLUMN "conclusion" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_RESINFO_AKENEO ALTER COLUMN "recomendations" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_SECTION_RESINFO_AKENEO ALTER COLUMN "recomendations" DROP NOT NULL;

-- T_CDA_SECTION_RESINSTR_REPORT_FOR_ELMK
ALTER TABLE AKUZ.T_CDA_SECTION_RESINSTR_REPORT_FOR_ELMK ALTER COLUMN "note" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_RESINSTR_REPORT_FOR_ELMK ALTER COLUMN "note" DROP NOT NULL;

-- T_CDA_SECTION_RESLAB_AKENEO
ALTER TABLE AKUZ.T_CDA_SECTION_RESLAB_AKENEO ALTER COLUMN "conclusion" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_RESLAB_AKENEO ALTER COLUMN "conclusion" DROP NOT NULL;

-- T_CDA_SECTION_RESPIRATORY_SYSTEM
ALTER TABLE AKUZ.T_CDA_SECTION_RESPIRATORY_SYSTEM ALTER COLUMN "respiratorysystem" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_RESPIRATORY_SYSTEM SET "respiratorysystem" = '' WHERE "respiratorysystem" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_RESPIRATORY_SYSTEM ALTER COLUMN "respiratorysystem" SET NOT NULL;

-- T_CDA_SECTION_SKIN
ALTER TABLE AKUZ.T_CDA_SECTION_SKIN ALTER COLUMN "skin" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SECTION_SKIN SET "skin" = '' WHERE "skin" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_SKIN ALTER COLUMN "skin" SET NOT NULL;

-- T_CDA_SECTION_STAGE_EPICRISIS
ALTER TABLE AKUZ.T_CDA_SECTION_STAGE_EPICRISIS ALTER COLUMN "stageepicrisis" SET DATA TYPE varchar(2500);
UPDATE AKUZ.T_CDA_SECTION_STAGE_EPICRISIS SET "stageepicrisis" = '' WHERE "stageepicrisis" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_STAGE_EPICRISIS ALTER COLUMN "stageepicrisis" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_SECTION_STAGE_EPICRISIS ALTER COLUMN "documentnote" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SECTION_STAGE_EPICRISIS ALTER COLUMN "documentnote" DROP NOT NULL;

-- T_CDA_SECTION_SURVEY
ALTER TABLE AKUZ.T_CDA_SECTION_SURVEY ALTER COLUMN "surveyplan" SET DATA TYPE varchar(2500);
UPDATE AKUZ.T_CDA_SECTION_SURVEY SET "surveyplan" = '' WHERE "surveyplan" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_SURVEY ALTER COLUMN "surveyplan" SET NOT NULL;

-- T_CDA_SECTION_TREATMENT_PLAN
ALTER TABLE AKUZ.T_CDA_SECTION_TREATMENT_PLAN ALTER COLUMN "treatmentplan" SET DATA TYPE varchar(7000);
UPDATE AKUZ.T_CDA_SECTION_TREATMENT_PLAN SET "treatmentplan" = '' WHERE "treatmentplan" IS NULL;
ALTER TABLE AKUZ.T_CDA_SECTION_TREATMENT_PLAN ALTER COLUMN "treatmentplan" SET NOT NULL;

-- T_CDA_SPECIAL_INSTRUCT
ALTER TABLE AKUZ.T_CDA_SPECIAL_INSTRUCT ALTER COLUMN "specialinstrtext" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_SPECIAL_INSTRUCT SET "specialinstrtext" = '' WHERE "specialinstrtext" IS NULL;
ALTER TABLE AKUZ.T_CDA_SPECIAL_INSTRUCT ALTER COLUMN "specialinstrtext" SET NOT NULL;

-- T_CDA_SPECIAL_INSTRUCTIONS_DRUG
ALTER TABLE AKUZ.T_CDA_SPECIAL_INSTRUCTIONS_DRUG ALTER COLUMN "specialinstructions" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_SPECIAL_INSTRUCTIONS_DRUG SET "specialinstructions" = '' WHERE "specialinstructions" IS NULL;
ALTER TABLE AKUZ.T_CDA_SPECIAL_INSTRUCTIONS_DRUG ALTER COLUMN "specialinstructions" SET NOT NULL;

-- T_CDA_SUR_DGN

ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmkdescription" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmkdescription" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmkperiod" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmkperiod" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmkreasons" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmkreasons" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmktreatment" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SUR_DGN ALTER COLUMN "onmktreatment" DROP NOT NULL;

-- T_CDA_SUR_DGN_OKS_TREATMENT_LINK
ALTER TABLE AKUZ.T_CDA_SUR_DGN_OKS_TREATMENT_LINK ALTER COLUMN "treatmentdescription" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SUR_DGN_OKS_TREATMENT_LINK SET "treatmentdescription" = '' WHERE "treatmentdescription" IS NULL;
ALTER TABLE AKUZ.T_CDA_SUR_DGN_OKS_TREATMENT_LINK ALTER COLUMN "treatmentdescription" SET NOT NULL;

-- T_CDA_SURG_INTERVENTION_LINKDOCS_DETAIL
ALTER TABLE AKUZ.T_CDA_SURG_INTERVENTION_LINKDOCS_DETAIL ALTER COLUMN "docnote" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SURG_INTERVENTION_LINKDOCS_DETAIL ALTER COLUMN "docnote" DROP NOT NULL;

-- T_CDA_SURG_INTERVENTION_SERVICES_DETAIL
ALTER TABLE AKUZ.T_CDA_SURG_INTERVENTION_SERVICES_DETAIL ALTER COLUMN "comment" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_SURG_INTERVENTION_SERVICES_DETAIL ALTER COLUMN "comment" DROP NOT NULL;

-- T_CDA_SURGICAL_INTERVENTIONS
ALTER TABLE AKUZ.T_CDA_SURGICAL_INTERVENTIONS ALTER COLUMN "textdescsurgical" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_SURGICAL_INTERVENTIONS SET "textdescsurgical" = '' WHERE "textdescsurgical" IS NULL;
ALTER TABLE AKUZ.T_CDA_SURGICAL_INTERVENTIONS ALTER COLUMN "textdescsurgical" SET NOT NULL;

-- T_CDA_VETERAN_LINKDOCS
ALTER TABLE AKUZ.T_CDA_VETERAN_LINKDOCS ALTER COLUMN "documentnote" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_VETERAN_LINKDOCS ALTER COLUMN "documentnote" DROP NOT NULL;

-- T_CDA_VIMIS_PLANNED_LAB_STUDY
ALTER TABLE AKUZ.T_CDA_VIMIS_PLANNED_LAB_STUDY ALTER COLUMN "methodstudydesc" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_VIMIS_PLANNED_LAB_STUDY ALTER COLUMN "methodstudydesc" DROP NOT NULL;

-- T_CDA_VITA_PARAMETER
ALTER TABLE AKUZ.T_CDA_VITA_PARAMETER ALTER COLUMN "refintervaldescr" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_VITA_PARAMETER ALTER COLUMN "refintervaldescr" DROP NOT NULL;

-- T_CDA_VITAL_PARAMETER_INFO
ALTER TABLE AKUZ.T_CDA_VITAL_PARAMETER_INFO ALTER COLUMN "comment" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_VITAL_PARAMETER_INFO ALTER COLUMN "comment" DROP NOT NULL;

-- T_CDA_VITALS
ALTER TABLE AKUZ.T_CDA_VITALS ALTER COLUMN "comment" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_VITALS ALTER COLUMN "comment" DROP NOT NULL;

-- T_CDA_ANAMNESIS_LIFE
ALTER TABLE AKUZ.T_CDA_ANAMNESIS_LIFE ALTER COLUMN "anamnesislifetext" SET DATA TYPE varchar(1024);
UPDATE AKUZ.T_CDA_ANAMNESIS_LIFE SET "anamnesislifetext" = '' WHERE "anamnesislifetext" IS NULL;
ALTER TABLE AKUZ.T_CDA_ANAMNESIS_LIFE ALTER COLUMN "anamnesislifetext" SET NOT NULL;

-- T_CDA_CONS_RESULT_AKENEO
ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ALTER COLUMN "resultsorconclusion" SET DATA TYPE varchar(1024);
ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ALTER COLUMN "resultsorconclusion" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ALTER COLUMN "protocol" SET DATA TYPE varchar(1024);
UPDATE AKUZ.T_CDA_CONS_RESULT_AKENEO SET "protocol" = '' WHERE "protocol" IS NULL;
ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ALTER COLUMN "protocol" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ALTER COLUMN "conclusion" SET DATA TYPE varchar(1024);
UPDATE AKUZ.T_CDA_CONS_RESULT_AKENEO SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_CONS_RESULT_AKENEO ALTER COLUMN "conclusion" SET NOT NULL;

-- T_CDA_CONSULTATION_KAS_AKENEO
ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "objectively" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "objectively" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "conclusion" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "conclusion" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "recommendations" SET DATA TYPE varchar(512);
ALTER TABLE AKUZ.T_CDA_CONSULTATION_KAS_AKENEO ALTER COLUMN "recommendations" DROP NOT NULL;

-- T_CDA_CYTOLOGICAL_PARAMETER_CYT_EXAM
ALTER TABLE AKUZ.T_CDA_CYTOLOGICAL_PARAMETER_CYT_EXAM ALTER COLUMN "result" SET DATA TYPE varchar(1024);
ALTER TABLE AKUZ.T_CDA_CYTOLOGICAL_PARAMETER_CYT_EXAM ALTER COLUMN "result" DROP NOT NULL;

-- T_CDA_DIAGNOSIS_V2
ALTER TABLE AKUZ.T_CDA_DIAGNOSIS_V2 ALTER COLUMN "nosologicaldescr" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_DIAGNOSIS_V2 ALTER COLUMN "nosologicaldescr" DROP NOT NULL;

-- T_CDA_EXAMINATION_SPECIALIST
ALTER TABLE AKUZ.T_CDA_EXAMINATION_SPECIALIST ALTER COLUMN "patientcomplaintstext" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_EXAMINATION_SPECIALIST SET "patientcomplaintstext" = '' WHERE "patientcomplaintstext" IS NULL;
ALTER TABLE AKUZ.T_CDA_EXAMINATION_SPECIALIST ALTER COLUMN "patientcomplaintstext" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_EXAMINATION_SPECIALIST ALTER COLUMN "objstatustext" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_EXAMINATION_SPECIALIST SET "objstatustext" = '' WHERE "objstatustext" IS NULL;
ALTER TABLE AKUZ.T_CDA_EXAMINATION_SPECIALIST ALTER COLUMN "objstatustext" SET NOT NULL;


-- T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO
ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "protocol" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "protocol" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "conclusion" SET DATA TYPE varchar(255);
UPDATE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO ALTER COLUMN "conclusion" SET NOT NULL;

-- T_CDA_FINAL_DGN_CONCOMITANT_PATHOLOGY_AKENEO
ALTER TABLE AKUZ.T_CDA_FINAL_DGN_CONCOMITANT_PATHOLOGY_AKENEO ALTER COLUMN "doctordesc" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_FINAL_DGN_CONCOMITANT_PATHOLOGY_AKENEO ALTER COLUMN "doctordesc" DROP NOT NULL;

-- T_CDA_MATERIAL_SAMPLE
ALTER TABLE AKUZ.T_CDA_MATERIAL_SAMPLE ALTER COLUMN "sampleldesc" SET DATA TYPE varchar(512);
UPDATE AKUZ.T_CDA_MATERIAL_SAMPLE SET "sampleldesc" = '' WHERE "sampleldesc" IS NULL;
ALTER TABLE AKUZ.T_CDA_MATERIAL_SAMPLE ALTER COLUMN "sampleldesc" SET NOT NULL;

-- T_CDA_ONKO_PROC_RESCONS
ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESCONS ALTER COLUMN "results" SET DATA TYPE varchar(255);
ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESCONS ALTER COLUMN "results" DROP NOT NULL;

ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESCONS ALTER COLUMN "conclusion" SET DATA TYPE varchar(7500);
UPDATE AKUZ.T_CDA_ONKO_PROC_RESCONS SET "conclusion" = '' WHERE "conclusion" IS NULL;
ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESCONS ALTER COLUMN "conclusion" SET NOT NULL;

ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESCONS ALTER COLUMN "recomendations" SET DATA TYPE varchar(1024);
ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESCONS ALTER COLUMN "recomendations" DROP NOT NULL;

-- T_CDA_ONKO_PROC_RESLAB
ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESLAB ALTER COLUMN "diagnosticsresultdescription" SET DATA TYPE varchar(7500);
ALTER TABLE AKUZ.T_CDA_ONKO_PROC_RESLAB ALTER COLUMN "diagnosticsresultdescription" DROP NOT NULL;

