I have a dictation form for surgeons who want the 'Date of Injury' (if there is one), 'Date of Surgery' and 'Surgery' populate when clicking a 'Previous' button. Each of the fields have an obs term tied to them. However, when I click the 'previous' button, only the text will display. The date values will not go into any fields, whether text or date field.
{if useryesno("Date of Injury: " + obsprev("DATEOFINJURY") + hret + "Date of Surgery: " + obsprev("dateofsurg") + hret+ "Surgery: " + obsprev("ORTHOSURG") + hret + hret + "Accept previous value?") == "Yes" then OBSNOW("ORTHOSURG",OBSNOW("ORTHOSURG") + OBSPREV("ORTHOSURG")) + OBSNOW("DATEOFSURG",OBSNOW("DATEOFSURG") + OBSPREV("DATEOFSURG")) + OBSNOW("DATEOFINJURY",OBSNOW("DATEOFINJURY") + OBSPREV("DATEOFINJURY")) else ""
endif}
Any help will be greatly appreciated!
Brittany Webb RN BSN
Program Manager – EHR
HealthTexas Provider Network | Baylor Scott & White Health
8080 N Central Expwy | Ste 600 | Dallas, Tx 75206
What is the connection type for the fields you are trying to populate? That could make a difference...
If the code above is suppose to copy previous observations to current observations, then you have too many '+' signs, and I dont think you need to add previous to current, it would append the field and could possibly look something like '12/01/200412/01/2004' if a user clicked yes twice. Try this instead -
{if useryesno("Date of Injury: " + obsprev("DATEOFINJURY") + hret + "Date of Surgery: " + obsprev("dateofsurg") + hret+ "Surgery: " + obsprev("ORTHOSURG") + hret + hret + "Accept previous value?") == "Yes" then
OBSNOW("ORTHOSURG",OBSPREV("ORTHOSURG"))
OBSNOW("DATEOFSURG",OBSPREV("DATEOFSURG"))
OBSNOW("DATEOFINJURY",OBSPREV("DATEOFINJURY"))
else "" endif}
Michael! Thank you so much! It worked! Now, to clean up the legacy functions where those are duplicated. :-/
For any future viewers of this string...
the original connection type was 'new observation (default prev)'. However, there were issues when the pt returned for another problem that required surgery and needed to change the dates.
So, I changed the connections to 'new observation' and added the 'previous' button to enter the data for follow up pts.