Hello All,
I have a form that was pulling New Observation (default previous) in one of the fields. I found that unless the user touched the field, it would write to the note, but it would not be saved in the clinical list update as an observation for the day's visit. I would like to pull the previous obs term automatically if possible and have it save.
Trying to fix this I came up with the following snippet of code. I was concerned about having the provider put the visit on hold and having the previous value pull back into the note if they changed it. So the goal was to take an obs term that we would not use (DASHMDHK1) and use it as a flag to keep track if the visit has been loaded or not. When I tested this it continues to pull the previous value for chief complaint when I take the visit off of hold. I'm not sure why it is not working. If anyone has some feedback I would appreciate it.
{!
//check if the form has been put on hold
if (OBSNOW("DASHMDHK1") == "DONE") then
//Do nothing
""
else
//first time the form has been loaded
OBSNOW("DASHMDHK1","DONE")
//Pull previous
if (OBSPREV("CHIEF CMPLNT") <> "") then
OBSNOW("CHIEF CMPLNT",OBSPREV("CHIEF CMPLNT"))
else
""
endif
endif
}
We had a similar situation - during the MA Initial Screen process, the HEIGHT defaults to previous. When this was not being changed, it was not written to the OBS. To remedy, I added an Action-Button next to the HEIGHT to "Store Height". For connection = RUNPROCESS, and the commands:
{
obsnow("HEIGHT",lastobsvalue("HEIGHT"))
}
~Joe
Joe,
I think I'm going to have to add a button too. I'm trying to avoid that, but I'm not sure if that's possible.
Brad
how about something like
{!fn fnRecordLastValue(var){
if obsnow(var) == "" and last_signed_obs_value(var) "" then obsnow(var,last_signed_obs_value(var),str(._todaysdate)
else ""
endif}}
where var is the obsterm to evaluate.
haven't tested it
Thanks Ken -- that worked perfectly for me.
Brad