/*ตรวจสอบว่ามีวัคซีน MR ผู้ใหญหรือไม'*/

SELECT person_vaccine_id,vaccine_name

FROM person_vaccine

WHERE export_vaccine_code = '074'

#-------------

test mr

หากไม่มี นำคำสั่งเพิ่มไป RUN

delete FROM person_vaccine WHERE export_vaccine_code = '074';

delete FROM vaccine_combination WHERE vaccine_code = '074';

delete FROM provis_vcctype WHERE CODE = '074');

SET @MRC = (select max(person_vaccine_id)+1 from person_vaccine) ;

INSERT IGNORE INTO`person_vaccine` (`person_vaccine_id`, `vaccine_name`, `vaccine_code`, `vaccine_group`, `export_vaccine_code`, `hos_guid`, `combine_vaccine`, `icode`) VALUES (@MRC, '074 : MRR หัด หัดเยอรมัน รณรงค์ (Z244,Z245)', 'MRC', 'MMC\r\n', '074', NULL, 'N', NULL);

#--------------

SET @cmrc =(select max(vaccine_combination_id)+1 from vaccine_combination);

INSERT IGNORE INTO`vaccine_combination` (`vaccine_combination_id`, `vaccine_code`, `vaccine_combine_code`, `hos_guid`) VALUES (@cmrc, 'MRC', 'MRC', NULL);

#--------------

INSERT IGNORE INTO `provis_vcctype` (`code`, `name`, `hos_guid`)

VALUES ('074', 'MRC', NULL);

SELECT person_vaccine_id,vaccine_name

FROM person_vaccine

WHERE export_vaccine_code = '074';