Our OB providers have requested that the patient's EDC be added to the patient banner. Can anyone instruct me how to accomplish this? Thanks for any help!
Here's our custom banner that includes the
{fn egaCalcH(edcDate)
{
if edcDate <> "" then
local days1 = 280 - val(durationdays(str(._todaysdate), edcDate))
return str(div(days1,7)) + "W" + str(mod(days1,7)) + "D"
else return "" endif
}}{fn findPregStuffH(preg, obs, type, date)
{
if preg <> "" then
local array1 = getfield(preg, "|", "")
local array1Size = size(array1)
local array1Count = 1
local array2 = ""
local dateString = ""
while array1Count <= array1Size
do
array2 = getfield(array1[array1Count], "^", "")
dateString = if dateString <> "" then dateString + "|" + array2[2] else array2[2] endif
array1Count = array1Count + 1
endwhile
local dateArray = getfield(dateString, "|", "")
local cutOffDate = dateArray[1]
if type == "edit" then
if val(durationdays(cutOffDate, lastobsdate(obs))) < 0
then return ""
else return obsany(obs) endif
else "" endif
else
if type == "edit" then
return obsany(obs)
else "" endif
endif
}}{fn popBannerH(g, t, p, a1, a2, l)
{
return
if g <> "" then "G" + g else "" endif
+ if p <> "" then "P" + p else "" endif
}}{fn showHide(num1)
{
local dur1 = ""
local dur2 = ""
if obsprev("DYNAMIC TABL") <> "" and obsprev("nbdelivdate") <> "" then
dur1 = val(durationdays(str(._todaysdate), lastobsvalue("nbdelivdate")))
dur2 = val(durationdays(str(._todaysdate), lastobsdate("DYNAMIC TABL")))
if dur1 < dur2 then
if num1 == "1" then return
findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "EDC", "edit")
else if num1 == "3" then return
findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "LAST MP", "edit")
else if num1 == "4" then return
findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "GRPBSTREPVG", "edit")
else return
if egaCalcH(findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "edc", "edit")) <> "" then egaCalcH(findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "edc", "edit")) else findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "GEST AGE EST", "edit") endif endif endif endif
else return "" endif
else if obsprev("DYNAMIC TABL") == "" and obsprev("nbdelivdate") <> "" then
return ""
else
if num1 == "1" then return
findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "EDC", "edit")
else if num1 == "3" then return
findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "LAST MP", "edit")
else if num1 == "4" then return
findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "GRPBSTREPVG", "edit")
else return
if egaCalcH(findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "edc", "edit")) <> "" then egaCalcH(findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "edc", "edit")) else findPregStuffH(list_obs('DYNAMIC TABL','pencil','delimited','value'), "GEST AGE EST", "edit") endif endif endif endif
endif endif
}}{ PATIENT.LABELNAME} Blood Type: {if obsany("ABO BLD GRP")<>"" then obsany("ABO BLD GRP")else last obsany("ABO/RH") endif} {obsany("RH TYPE")} {if PATIENT.PSTATUS = "X" then "DECEASED: " + PATIENT.DATEOFDEATH else "" endif}{if PATIENT.PSTATUS = "I" then "INACTIVE" else "" endif}{if PATIENT.PSTATUS = "O" then "OBSOLETE" else ""endif} LMP: {obsprev("last mp")} {if showHide("4") <> "" then " GBS:" else "" endif}{showHide("4")} Preg Hx: {popBannerH(obsany("gravid"), obsany("term"), obsany("para"), obsany("elect abort"), obsany("spon abort"), obsany("living"))} {if showHide("1") <> "" then "EDC:" else "" endif}{showHide("1")}{if showHide("2") <> "" then " EGA:" else "" endif}{showHide("2")} Home: {if PATIENT.ALTPHONE = "" then "None" else PATIENT.ALTPHONE endif} Work: {if PATIENT.WORKPHONE = "" then "None" else PATIENT.WORKPHONE endif} Patient ID: {PATIENT.PATIENTID}
Insurance: {INS_PLAN()} {PATIENT.FORMATTEDAGE} (DOB: {Patient.DateOfBirth})PCP: {if PATIENT.RespProvID = "" then "None " else PATIENT.RespProvID endif} Allergies: {ALL_PRIOR("comma")}
{global usernotified if usernotified<>PATIENT.PATIENTID then usernotified = PATIENT.PATIENTID local r="" if Patient.Regnote=="" then "" else local a=getfield(Patient.Regnote,"\r","\n") while size(a) > 0 do if match(a[1],'!!') > 0 then if r<>"" then r = r + "\r\n" + a[1] else r = a[1] endif endif remove(a, 1) endwhile endif if r<>"" then a=userok(r) endif endif ""}
mjordan,
Feel free to email me at [email protected] if you have any questions about the banner. My providers are happy with what displays.
Kristina