Hi,
I am able to utilize IMMUN_ADD when hard coding the date in the AdministerDate field, however when using str(._TODAYSDATE) and trying use the current date I am getting a -9 error. Has anyone utilized IMMUN_ADD in any VFE forms?
Thanks
I utilized IMMUN_ADD as part of the $mdObject open source in HTML Encounter Form. It's very simple: a) you create an Immunization object b) call save method. Bellow it's the Immunization object usage and implementation of the "administeredDate":
var imm = new $mdObject.Immunization();
var immGroup = ['DTaP', 'HepB', 'MMR'];
var vfc = ['V01', 'V02', 'V03'];
imm.vaccineGroupName = immGroup[0];
imm.wasGiven = 'Y';
imm.historical = 'Y';
imm.vfcElegibility = vfc[0];
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear();
today = mm + '/' + dd + '/' + yyyy;
imm.administeredDate = today;
imm.doseAmount = 0.5;
imm.save();
I use str(DOCUMENT.CLINICALDATE) to populate DOCUMENT.DATEGIVEN in my VFE code and it works.
a= "{IMMUN_ADD('"+ Document.ImmGroup+
Document.MedNamestr + "^^" + DOCUMENT.SERIES + "^"+
DOCUMENT.WASGIVEN+"^^"+DOCUMENT.HCODE+
"^^V01^"+ Document.medcode + "^^^^^"+ DOCUMENT.CVX_DOSE +DOCUMENT.INJROUTE+
DOCUMENT.ROUTECODE+DOCUMENT.SITE+"^"+
sub(DOCUMENT.SITE,1,2)+"^"+DOCUMENT.MFR+"^"+ DOCUMENT.LOT +
"^"+DOCUMENT.EXP_DATE+"^"+DOCUMENT.VIS_PUB_DATE+"^"+
adm+"^"+DOCUMENT.DATEGIVEN+"^D^"+
DOCUMENT.COMMENTS+"^"+ DOCUMENT.ADVERSEDATE+"^D^"+
DOCUMENT.ADVERSEREAC+"^^^^^^')}"