พิมพ์
หมวด: Uncategorised
ฮิต: 482

815 FLU วัคซีนผู้ใหญ่

ตรวจสอบก่อนว่ามีวัคซีน FLU วัคซินไข้หวัดใหญ่ ในผู้ใหญ่

SELECT * FROM provis_vcctype where CODE = '815';
code name hos_guid
815 FLU

หากชื่อ FLU ไม่ตรง ให้แก้ไข

SET @FLUv = 'FLU';/*แก้ 'FLU' เป็น code ที่ต้องการ */

delete FROM person_vaccine WHERE export_vaccine_code ='815';

delete FROM vaccine_combination WHERE vaccine_code = 'FLU';

delete FROM anc_service WHERE export_vaccine_code ='815';

delete FROM provis_vcctype WHERE code ='FLU';

delete FROM provis_aptype WHERE CODE = '815';

SET @FLUv = 'FLU';/*แก้ 'FLU' เป็น code ที่ต้องการ */

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

VALUES ('815', 'FLU', NULL);

#---------

SET @FLU = (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 (@FLU, 'Flu ไข้หวัดใหญ่(Z251)', '815', @FLUv, '815', NULL, 'N', NULL);

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

SET @FLU =(SELECT MAX(vaccine_combination_id)+1 FROM vaccine_combination);

SET @FLUv = 'FLU';

INSERT IGNORE INTO`vaccine_combination` (`vaccine_combination_id`, `vaccine_code`, `vaccine_combine_code`, `hos_guid`)

VALUES (@FLU,@FLUv,'FLU', NULL);

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

SET @FLU = (SELECT MAX(anc_service_id)+1 FROM anc_service) ;

INSERT INTO `anc_service` (`anc_service_id`, `anc_service_name`, `anc_service_code`, `export_vaccine_code`, `icode`, `price`, `hos_guid`) VALUES (@FLU, 'FLU', 'FLU', '815', NULL, NULL, NULL);

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

SET @FLUz = 'Flu ไข้หวัดใหญ่(Z251)';

INSERT INTO `provis_aptype` (`code`, `name`, `hos_guid`, `hos_guid_ext`) VALUES ('815', @FLUz, NULL, NULL);

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

SET @group = (SELECT MAX(person_vaccine_group_lot_id)+1 FROM person_vaccine_group_lot) ;

INSERT INTO `person_vaccine_group_lot` (`person_vaccine_group_lot_id`, `vaccine_group`, `vaccine_lot`, `receive_date`, `expire_date`, `receive_qty`, `left_qty`, `vaccine_lot_active`, `hos_guid`)

VALUES (@group, 'Flu',NULL,NULL,NULL,NULL, NULL, 'Y', NULL);

SELECT * FROM provis_vcctype where CODE = '815';