-- Tabel jawaban screening untuk template VAKSINASI dan KHITAN
-- Satu baris per pertanyaan per order
-- Template DEFAULT tetap pakai order_screening (lama)
CREATE TABLE IF NOT EXISTS one_klinik.t_screening_answer (
  T_ScreeningAnswerID                INT(11)  NOT NULL AUTO_INCREMENT,
  T_ScreeningAnswerOrderID           INT(11)  NOT NULL,
  T_ScreeningAnswerM_ScreeningFormID INT(11)  NOT NULL,
  T_ScreeningAnswerValue             TEXT     NULL DEFAULT NULL,
  T_ScreeningAnswerIsActive          CHAR(1)  NOT NULL DEFAULT 'Y',
  T_ScreeningAnswerUserID            INT(11)  NULL DEFAULT NULL,
  T_ScreeningAnswerCreated           DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  T_ScreeningAnswerLastUpdated       DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (T_ScreeningAnswerID),
  UNIQUE KEY uk_order_form (T_ScreeningAnswerOrderID, T_ScreeningAnswerM_ScreeningFormID),
  KEY idx_T_ScreeningAnswerOrderID (T_ScreeningAnswerOrderID),
  CONSTRAINT fk_sa_form FOREIGN KEY (T_ScreeningAnswerM_ScreeningFormID)
    REFERENCES m_screening_form (M_ScreeningFormID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
  COMMENT='Jawaban screening per pertanyaan untuk template VAKSINASI & KHITAN';
