Hi. I'm trying to get code linked to an action button that allows the user to record multiple date values for a single obsterm. I'm pretty sure I've done this in the past, but I can't find any of my old files that show me what I did. Every way I try it, the action button is recording the most recent value, but it over-writes the previous date just entered, but also adding the newly entered date.
Say I have one date obsterm for recording previously documented asthma action plans, and I just want the date - nothing else. So if I want to enter that the action plans were given during on 1/1/2010, 2/2/2011, and 3/3/2012, I want to be able to record each of those dates in a single form/chart update.
Here is what I have, which always works for me if recording multiple values and their dates together, but is proving quite bothersome today.
{fn rec_AAP(){IF DOCUMENT.AAPDATE <> "" THEN OBSNOW("AAP DATE", DOCUMENT.AAPDATE)ENDIF}}
I get the feeling I've over-processed this to the point where I'm missing something really simple. Anyone have an idea of what I need to do to make it work?
Thanks,
Mary
The syntax is OBSNOW("OBSTERM",value,date) so maybe you want something more like -
{fn rec_AAP(){IF DOCUMENT.AAPDATE <> "" THEN OBSNOW("AAP DATE", DOCUMENT.AAPVALUE,DOCUMENT.AAPDATE)ENDIF}}
or
{fn rec_AAP(){IF DOCUMENT.AAPDATE <> "" THEN OBSNOW("AAP DATE", "Done",DOCUMENT.AAPDATE)ENDIF}}
Hmm.... that is what I do for recording historic immunizations, but then we push both a value such as "done" and the date. I need the date entered to actaully be the value, in place of "done," so when I used that code but eliminated the piece that pulled in "done" for the value, that's when I ran into trouble. I'm just not grasping that last little detail today. Would I plug in the AAPDATE somehow into the "done" piece?
Okay so try something like this then -
{fn rec_AAP(){
IF DOCUMENT.AAPDATEALL <> "" THEN
DOCUMENT.AAPDATEALL = DOCUMENT.AAPDATEALL + "," + DOCUMENT.AAPDATE
ELSE DOCUMENT.AAPDATEALL = DOCUMENT.AAPDATE
ENDIF}}
In the white space in VFE -
{!DOCUMENT.AAPDATEALL}
{OBSNOW("AAP DATE",DOCUMENT.AAPDATEALL)}
Perfect!
Thanks,
Mary