do $$ begin
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_RESULTS_RESEARCH' and column_name='conclusion')
		then
		ALTER TABLE AKUZ.T_CDA_RESULTS_RESEARCH ALTER COLUMN "conclusion" TYPE text;
		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;
		END IF;
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_EXAMINATION_SPECIALIST' and column_name='patientcomplaintstext')
		then
		ALTER TABLE AKUZ.T_CDA_EXAMINATION_SPECIALIST ALTER COLUMN "patientcomplaintstext" TYPE text;
		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;
		END IF;
	IF EXISTS(select * from information_schema.columns WHERE table_name='T_CDA_EXAMINATION_SPECIALIST' and column_name='objstatustext')
		then
		ALTER TABLE AKUZ.T_CDA_EXAMINATION_SPECIALIST ALTER COLUMN "objstatustext" TYPE text;
		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;
		END IF;
end; $$;