-- Tabel pencatatan pemberian vaksin per kunjungan
CREATE TABLE `one_klinik`.`order_vaccine` (
  `orderVaccineID`                int(11)      NOT NULL AUTO_INCREMENT,
  `orderVaccineOrderID`           int(11)      NOT NULL DEFAULT 0,
  `orderVaccineT_TestID`          int(11)      NOT NULL DEFAULT 0   COMMENT 'FK one_lab.t_test - jenis vaksin',
  `orderVaccineBatchNumber`       varchar(50)  DEFAULT NULL,
  `orderVaccineExpiredDate`       date         DEFAULT NULL,
  `orderVaccineDosis`             tinyint(3)   NOT NULL DEFAULT 1   COMMENT 'dosis ke-',
  `orderVaccineInjectionSiteCode` varchar(30)  DEFAULT NULL         COMMENT 'FK m_injection_site.M_InjectionSiteCode',
  `orderVaccineRouteCode`         varchar(30)  DEFAULT NULL         COMMENT 'FK m_route_vaccine.M_RouteVaccineCode',
  `orderVaccinePetugasM_DoctorID` int(11)      DEFAULT NULL         COMMENT 'petugas penyuntik',
  `orderVaccineGivenAt`           datetime     NOT NULL DEFAULT current_timestamp() COMMENT 'tanggal & jam pemberian',
  `orderVaccineNextDate`          date         DEFAULT NULL         COMMENT 'tanggal vaksin selanjutnya',
  `orderVaccineCatatan`           text         DEFAULT NULL,
  `orderVaccineIsActive`          char(1)      NOT NULL DEFAULT 'Y',
  `orderVaccineUserID`            int(11)      DEFAULT NULL,
  `orderVaccineCreated`           datetime     NOT NULL DEFAULT current_timestamp(),
  `orderVaccineLastUpdated`       datetime     NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`orderVaccineID`),
  KEY `orderVaccineOrderID` (`orderVaccineOrderID`),
  KEY `orderVaccineIsActive` (`orderVaccineIsActive`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
