Well I was in the ballpark at least! Tried to make those changes but still not getting it to function properly. No MEL errors though either. I was thinking the other option was to populate the DOCUMENT.BISHOP field by firing this with an action key. That way I would not have to worry about the popup. Regardless, I wanted to try using AND to see if it would work but…no. Any furhter thoughts?
/*
Calculates the Bishop score.
*/
{fn fnCalculateBishop(var1,var2,var3,var4,var5)
{DOCUMENT.BISHOP=fnCalculateBishop(DOCUMENT.POSITION,DOCUMENT.CONSISTENCY,DOCUMENT.EFFACEMENT,DOCUMENT.DILATION,DOCUMENT.STATION)
local r1=0
local r2=0
local r3=0
local r4=0
local r5=0
IF (DOCUMENT.POSITION = "") then r1=0
else if (DOCUMENT.POSITION == "Posterior") then r1=0
else if (DOCUMENT.POSITION == "Midposition") then r1=1
else if (DOCUMENT.POSITION == "Anterior") then r1=2
else ""
endif
endif
endif
endif
IF (DOCUMENT.CONSISTENCY = "") then r2=0
else if (DOCUMENT.CONSISTENCY == "Firm") then r2=0
else if (DOCUMENT.CONSISTENCY == "Medium") then r2=1
else if (DOCUMENT.CONSISTENCY == "Soft") then r2=2
else ""
endif
endif
endif
endif
IF (DOCUMENT.EFFACEMENT = "") then r3=0
else if (DOCUMENT.EFFACEMENT == "0-30%") then r3=0
else if (DOCUMENT.EFFACEMENT == "40-50%") then r3=1
else if (DOCUMENT.EFFACEMENT == "60-70%") then r3=2
else if (DOCUMENT.EFFACEMENT == "80+%") then r3=3
else ""
endif
endif
endif
endif
endif
IF (DOCUMENT.DILATION) = "" then r4=0
else if (DOCUMENT.DILATION == "0 cm") then r4=0
else if (DOCUMENT.DILATION == "1-2 cm") then r4=1
else if (DOCUMENT.DILATION == "3-4 cm") then r4=2
else if (DOCUMENT.DILATION == ">5cm") then r4=3
else ""
endif
endif
endif
endif
endif
IF (DOCUMENT.STATION = "") then r5=0
else if (DOCUMENT.STATION == "-3") then r5=0
else if (DOCUMENT.STATION == "-2") then r5=1
else if (DOCUMENT.STATION == "-1") then r5=2
else if (DOCUMENT.STATION == "0") then r5=2
else if (DOCUMENT.STATION == "+1") then r5=3
else if (DOCUMENT.STATION == "+2") then r5=3
else ""
endif
endif
endif
endif
endif
endif
endif
return str(r1 + r2 + r3 + r4 +r5)
}
}
/*
Popup warning for suboptimal Bishop Score
*/
{
if (DOCUMENT.BISHOP = "") then ""
elseif (val(DOCUMENT.BISHOP) > "6") then ""
elseif (val(DOCUMENT.BISHOP) <= "6")
AND
(DOCUMENT.POSITION<>"")
AND
(DOCUMENT.CONSISTENCY<>"")
AND
(DOCUMENT.EFFACEMENT<>"")
AND
(DOCUMENT.DILATION<>"")
AND
(DOCUMENT.STATION<>"")then userok("Your patient's Bishop score is less than adequate for induction of labor. Please be sure to document medical necessity.")
endif
endif
endif
}
Thanks again!
Posted : November 25, 2013 12:44 am