From 64b23443773e96d85528eb5161c4f5d054879fac Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Wed, 21 Jan 2026 14:59:26 +0530 Subject: [PATCH] AMM-2128 new table for tb confirmed cases --- .../V41__TB_conformed_cases_DB_IEMR.sql | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/resources/db/migration/dbiemr/V41__TB_conformed_cases_DB_IEMR.sql diff --git a/src/main/resources/db/migration/dbiemr/V41__TB_conformed_cases_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V41__TB_conformed_cases_DB_IEMR.sql new file mode 100644 index 00000000..23785efe --- /dev/null +++ b/src/main/resources/db/migration/dbiemr/V41__TB_conformed_cases_DB_IEMR.sql @@ -0,0 +1,34 @@ +USE db_iemr; + +CREATE TABLE IF NOT EXISTS `tb_confirmed_cases` ( + `id` INT NOT NULL AUTO_INCREMENT, + `ben_id` BIGINT NOT NULL, + `regimen_type` VARCHAR(100) DEFAULT NULL, + `treatment_start_date` DATE NOT NULL, + `expected_treatment_completion_date` DATE DEFAULT NULL, + `follow_up_date` DATE DEFAULT NULL, + `monthly_follow_up_done` VARCHAR(20) DEFAULT NULL, + `adherence_to_medicines` VARCHAR(20) DEFAULT NULL, + `any_discomfort` TINYINT(1) DEFAULT NULL, + `treatment_completed` TINYINT(1) DEFAULT NULL, + `actual_treatment_completion_date` DATE DEFAULT NULL, + `treatment_outcome` VARCHAR(100) DEFAULT NULL, + `date_of_death` DATE DEFAULT NULL, + `place_of_death` VARCHAR(100) DEFAULT NULL, + `reason_for_death` VARCHAR(100) DEFAULT NULL, + `reason_for_not_completing` VARCHAR(255) DEFAULT NULL, + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `user_id` INT DEFAULT NULL, + + PRIMARY KEY (`id`), + INDEX `idx_ben_id` (`ben_id`), + INDEX `idx_treatment_start_date` (`treatment_start_date`), + INDEX `idx_follow_up_date` (`follow_up_date`), + INDEX `idx_user_id` (`user_id`) + +) ENGINE=InnoDB + AUTO_INCREMENT=1 + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_unicode_ci + COMMENT='TB Confirmed Cases Treatment Tracking'; \ No newline at end of file