1. Is it possible to use an edit field for the "administered by" or "expiration date" fields when pushing a form to CVX?
For example, this current code is working:
if (DOCUMENT.HPV__1_ "") then
IMMUN_ADD("HPV, quadrivalent^" + DOCUMENT.HPV__1_ + "^^1^Y^^N^^V01^^^^^^62^^''^"+ DOCUMENT.HPV__1_RTE_ + "^^" + DOCUMENT.HPV__1_SITE_ + "^^" + DOCUMENT.HPV__1_MFR_ + "^^" + DOCUMENT.HPV__1_LOT_ + "^^" + DOCUMENT.HPV__1_VIS_ + "^^" + document.HPV1date + "^D^^^^^^^^''^''")
endif
but when I try to add in the Admin By edit field or the Expiration Date edit fields, it stops working:
if (DOCUMENT.HPV__1_ "") then
IMMUN_ADD("HPV, quadrivalent^" + DOCUMENT.HPV__1_ + "^^1^Y^^N^^V01^^^^^^62^^''^"+ DOCUMENT.HPV__1_RTE_ + "^^" + DOCUMENT.HPV__1_SITE_ + "^^" + DOCUMENT.HPV__1_MFR_ + "^^" + DOCUMENT.HPV__1_LOT_ + "^" + DOCUMENT.HPVEXPIR + "^" + DOCUMENT.HPV__1_VIS_ + "^" + DOCUMENT.HPVADMINBY + "^" + document.HPV1date + "^D^^^^^^^^''^''")
endif
2. Is there a way to have the Administered Date default to the current date of the encounter (today's date)?
Just add this in the white space -
{!if document.HPV1date == "" then
document.HPV1date = str(._TODAYSDATE)
endif}
Also if you are having trouble getting it to work when adding or changing fields, you can wrap the whole thing in a userok() to get a popup with the response code while testing/developing. There is a list of the error codes and descriptions in the help file.
thank you! its weird that almost all fields can push to CVX via edit fields, but it you have to hard code the "admin by" "admin date" and expiration.
The dates need to be in a proper format, MM/DD/YYYY. The admin by needs to be a valid username. For the dates you can do it -
{.....
if ADDDATES(document.date_field,"0","0","0") =="" then
userok("invalid date entered, try again")
else
.... add immunization....
endif}
The username I would just make a dropdown with users, the _UserSearch object is an option but can really slow down a form with a large database. Hope that helps!