I want to get something like the following USEROK script to work in a text component. It's important that a pop-up doesn't occur if the patient has a GFR <15 and a Dx of N18.5 OR a GFR <15 and a Dx of N18.6.
The problem I am having is my condition fires even when no GFR value is present. It also doesn't matter if I have one of the diags in the problem list. Hope someone can help.
{
cond
case str(LASTOBSVALUE("GFR")) < 15 AND str(LASTOBSVALUE("GFR")) > 0 AND match(PROB_AFTER(""),"ICD10-N18.5")=0 or
str(LASTOBSVALUE("GFR")) < 15 AND str(LASTOBSVALUE("GFR")) > 0 AND match(PROB_AFTER(""),"ICD10-N18.6")=0
USEROK("Your patient's last GFR was <15, and a diagnoses of ICD10-N18.5 or ICD10-N18.6 is missing from the problem list. To remove this reminder, update the patient's problem list with ICD10-N18.5 or N18.6 if on dialysis.")
else ""
endcond
}
You need more parenthesis I think, and you don't want a string, you want to compare a value to either 0 or 15, try this -
case (
(LASTOBSVALUE(“GFR”) < 15 AND LASTOBSVALUE(“GFR”) > 0 AND match(PROB_AFTER(“delimited”),”ICD10-N18.5″)=0)
or
(LASTOBSVALUE(“GFR”) < 15 AND LASTOBSVALUE(“GFR”)> 0 AND match(PROB_AFTER(“delimited”),”ICD10-N18.6″)=0)
)
If there are still issues try val(LASTOBSVALUE("GFR")) > 0 etc...
Thank you for the response!
I got the following to work in a text component. I switched to an "if then else" statement because I figure providers will want to just go straight to the problem list to stop the pop-up from coming back, right away. My issue now is that it returns FALSE, in the text translation if the statement is not true.
{
if LASTOBSVALUE("GFR") < 60 AND LASTOBSVALUE("GFR") >= 30 AND match(PROB_AFTER(""),"ICD10-N18.3")=0
then if USERyesNO("Your patient's last GFR was <60 and >=30, and the diagnoses ICD10-N18.3 is missing from the problem list. To remove this reminder, update the patient's problem list with ICD10-N18.3") = "Yes"
then UPDATE_PROBLEMS()
else ""
endif
endif
}
{
if LASTOBSVALUE("GFR") < 30 AND LASTOBSVALUE("GFR") >= 15 AND match(PROB_AFTER(""),"ICD10-N18.4")=0
then if USERyesNO("Your patient's last GFR was <30 and >=15, and the diagnoses CKD stage 4 is missing from the problem list. To remove this reminder, update the patient's problem list.") = "Yes"
then UPDATE_PROBLEMS()
else ""
endif
endif
}
{
if
(
LASTOBSVALUE("GFR") < 15
AND LASTOBSVALUE("GFR") > 0
AND match(PROB_AFTER(""),"ICD10-N18.5")=0
AND match(PROB_AFTER(""),"ICD10-N18.6")=0
)
then if USERYESNO("Your patient's last GFR was <15, and a diagnoses CKD stage 5 or ESRD is missing from the problem list. To remove this reminder, update the patient's problem list.") = "Yes" then UPDATE_PROBLEMS()
else ""
endif
endif
}
you just need one more else "" at the end, so the end should be -
endif
else ""
endif
}
Thanks so much!! thought I needed an extra `else""`, but I originally added it right after the other `else""` and killed the expression, causing mel garble where the `FALSE` was before.
Here's the corrected, workable version of the expressions I am using in a text component. Thanks again!
{
if LASTOBSVALUE("GFR") < 60 AND LASTOBSVALUE("GFR") >= 30 AND match(PROB_AFTER(""),"ICD10-N18.3")=0
then if USERyesNO("Your patient's last GFR was <60 and >=30, and the diagnoses CKD stage 3 is missing from the problem list. To remove this reminder, update the patient's problem list.") = "Yes"
then UPDATE_PROBLEMS()
else ""
endif
else ""
endif
}
{
if LASTOBSVALUE("GFR") < 30 AND LASTOBSVALUE("GFR") >= 15 AND match(PROB_AFTER(""),"ICD10-N18.4")=0
then if USERyesNO("Your patient's last GFR was <30 and >=15, and the diagnoses CKD stage 4 is missing from the problem list. To remove this reminder, update the patient's problem list.") = "Yes"
then UPDATE_PROBLEMS()
else ""
endif
else ""
endif
}
{
if
(
LASTOBSVALUE("GFR") < 15
AND LASTOBSVALUE("GFR") > 0
AND match(PROB_AFTER(""),"ICD10-N18.5")=0
AND match(PROB_AFTER(""),"ICD10-N18.6")=0
)
then if USERYESNO("Your patient's last GFR was <15, and a diagnoses CKD stage 5 or ESRD is missing from the problem list. To remove this reminder, update the patient's problem list.") = "Yes" then UPDATE_PROBLEMS()
else ""
endif
else ""
endif
}