So we had a doctor today that requested the years being a smoker to update +1 from the year the patient started. Is there a way to do this automatically?
Say John Doe start 12/10/10, so hes been smoking 3 years today, on 12/10/14 it updates in the form to 4 years.
adaniel said:
So we had a doctor today that requested the years being a smoker to update +1 from the year the patient started. Is there a way to do this automatically?
Say John Doe start 12/10/10, so hes been smoking 3 years today, on 12/10/14 it updates in the form to 4 years.
Say John stops visiting your practice, and quit smoking the day after his last visit. 5 years later he comes back and it now shows he's been a smoker for 9 years, but it isn't true...sorry I am of no help, but is it really that hard to do manually? 🙂
A couple different ideas:
1) Instead of saving the number of years a smoker, translate the numeric value to a "started smoking date." Calculate the number of years each time the form is opened.
2) Or, When the form is opened, check the date that the YearsASmoker was recorded. If the date is more than a year ago, record a new value for YearsASmoker incrementing it by one. Untested pseudocode:
{!
if (LASTOBSDATE("yearsasmoker")<>"") {
if (DURATIONDAYS(LAST_OBS_DATE("yearsasmoker"), str(._todaysdate))>364) {
//here: ask user if patient still a smoker; or, check an OBS value to see if still a smoker. If so:
OBSNOW("yearsasmoker",str(val(OBSPREV("yearsasmoker"))+1))
} } }
chrishuff makes a valid point: you don't want to create new data if it may be incorrect. Discuss with your doctor a method for interacting with them to verify that the patient is still a smoker. Perhaps use a useryesno() dialog box.
Good point i'll pitch that to the doc that wants it