I'm trying to create a Text Component that will figure out if the patient is due for a colonoscopy. It searches to see if they're in the right age group, whether they've ever had one previously, and if they have, whether it was within 10 years. If they're due and would like a script, it adds an order for one.
Everything works fine, except that if the user pushes "yes" in useryesno, it not only enters the order, it also returns a "0". Please help me with my code, below. And feel free to use as a screening tool.
(10 points for whoever gets the Mr. Zero reference. 🙂
{IF PATIENT_AGE()>49 AND PATIENT_AGE()<80 THEN
IF LASTOBSDATE("COLONOSCOPY")==""
THEN if useryesno("It looks like this patient has never had a colonoscopy. Do they want one?") = "Yes"
THEN MEL_ADD_ORDER("T","Gastroenterology","Colonoscopy, screening","","ICD-V70.0", "HEALTH MAINTENANCE EXAM","","","","",str(._TODAYSDATE))
else "Patient was offered colonoscopy, and declines at this time."
endif
ELSE IF val(DURATIONDAYS(LASTOBSDATE("COLONOSCOPY"),str(._TODAYSDATE)))>3650
THEN IF useryesno("Last colonoscopy was over 10 years ago. Would pt like to have a script for another?")="Yes"
THEN MEL_ADD_ORDER("T","Gastroenterology","Colonoscopy, screening","","ICD-V70.0", "HEALTH MAINTENANCE EXAM","","","","",str(._TODAYSDATE))
ELSE "Pt offered cscope and declines"
endif
ELSE ""
endif
endif
ELSE "Patient too old or young for c-scope" ENDIF}
I think the MEL_ADD_ORDER returns a 0 when successful so just put "" after the closing paranthesis.
MEL_ADD_ORDER(“T”,”Gastroenterology”,”Colonoscopy, screening”,””,”ICD-V70.0″, “HEALTH MAINTENANCE EXAM”,””,””,””,””,str(._TODAYSDATE)) ""