Trying to develop a letter to help streamline results. I thought I had it set up right but when I try to print the letter, it recognizes
EVERYTHING after the { that sets up the conditional statements. Anyone see what I am I doing wrong?
Thanks for all your help in advance!
Geoff
{DATESTAMP()} {PATIENT.LABELNAME} {PATIENT.ADDRESS1} {PATIENT.CITY}, {PATIENT.STATE} {PATIENT.ZIP} RE: Recent STI Testing performed on: {LAST_SIGNED_OBS_DATE("NGONOSDAVIAL")} {fn STIres(obs, days) { local result = "" if LAST_SIGNED_OBS_VALUE(obs)<>"" and (days == 0 or DURATIONDAYS(LAST_SIGNED_OBS_VALUE(obs), STR(._TODAYSDATE)) <= days) then result = LAST_SIGNED_OBS_VALUE(obs) endif return result } } Nisseria gonorrhea: {STIres("NGONOSDAVIAL", 21)} Chlamydia trachomatis: {STIres("CHLAMYD AMPL",21)} { IF LAST_SIGNED_OBS_VALUE("NGONOSDAVIAL") = "Positive" AND LAST_SIGNED_OBS_VALUE("CHLAMYD AMP") = "Negative" then "You have tested POSITIVE for Nisseria gonorrhea. If you have not already been contacted by our office, please call us at your earliest covience at (541)686-7007." else IF LAST_SIGNED_OBS_VALUE("NGONOSDAVIAL") = "Negative" AND LAST_SIGNED_OBS_VALUE(CHLAMYD AMP") = "Positive" then "You have tested POSITIVE for Chlamydia tracomatis. If you have not already been contacted by our office, please call us at your earliest covience at (541)686-7007." else IF LAST_SIGNED_OBS_VALUE("NGONOSDAVIAL") = "Positive" AND LAST_SIGNED_OBS_VALUE(CHLAMYD AMP") = "Positive" then "You have tested POSITIVE FOR BOTH Nisseria gonorrhea and Chlamydia tracomatis. If you have not already been contacted by our office, please call us at your earliest covience at (541)686-7007." else IF LAST_SIGNED_OBS_VALUE("NGONOSDAVIAL") = "Negative" AND LAST_SIGNED_OBS_VALUE(CHLAMYD AMP") = "Negative" then "Both your Nisseria gonorrhea and Chlamydia tracomtis tests were NEGATIVE. Please contact our office if you have any questions or concerns. Thank you letting us help take care of your health care needs." endif endif endif endif }
I believe in your durationdays comparison you are comparing a date to an obs value, try changing to LAST_SIGNED_OBS_DATE(obs).
hope this helps
Scott
Geoff Gill said:
LAST_SIGNED_OBS_VALUE(CHLAMYD AMP") = "Negative"
You are also missing an opening paranthesis on the obsterm, three times in the last code block
Thanks Scott but I am not sure if that is the problem. When calling the function to populate the actual results….it works with the LAST_SIGNED_OBS_VALUE in the DURATIONDAYS portion. I tried changing it to LAST_SIGNED_OBS_DATE and it no longer worked. I am not quite sure why becuase you are right about comparing a date!
Its the component AFTER calling the function that I can't get to work. I am trying to make it autopopulate a canned response based on the results of the two tests. My options are: Pos/Neg, Neg/Pos, Pos/Pos, Neg/Neg. The translation just prints exactly whats in the letter despite being enclosed in {}.
Thoughts?
GG
Mike...thanks for that catch! Starting to learn that most of my mistakes are things like that! Now I know where to search!
Despite fixing those....it's still not populating my responses.
Thanks for your help!
GG
May be a long shot but try putting an else before you 4 ending ENDIF statements.
have you tried copying the whole text into Notepad and bringing it back into your form. might be an unprintable character throwing a wrench into the works.
Your missing the else at end before endif's