I have code nearly identical to the following working in my banner, so I think all the MEL logic is ok. But, inside VFE nothing is being displayed. I created this as a DATA type, with a MEL connection.
(By the way, had to do lots of this because some patients have old appointments that are 'orphan' = not arrived, cancelled, no-show.)
global txtln1=""
global txtln2=""
global txtln3=""
global apptlisting=getfield(APPTS_BY_STATUS("ARRIVED","FULL"),"\r","")
global apptsize=size(apptlisting)
global lastappt2=""
for count = 1, count < apptsize, count = count + 1
do
datedelim=match(apptlisting[count],"/")
if datedelim > 0 then
appt_date=sub(apptlisting[count],datedelim-2,10)
days=DURATIONDAYS(str(._TODAYSDATE),appt_date)
if val(days) <=0 then lastappt2=appt_date else lastappt2="" endif
else ""
endif
endfor
if lastappt2=="" then txtln1="None" else txtln1=lastappt2 endif
txtln1+HRET+HRET+txtln2+HRET+HRET+txtln3+HRET+HRET
Was playing with this code for another project. Discovered that you need to declare your variables separately from setting a value to them. Make declaring and setting two different acts and I bet it works.
cant you just use
Prev Appt:
{ APPT_PRIOR() }
No, we were both looking for the last arrived appointment (I'm actually playing with seeing is the last arrived was more than 3 years ago to bill as a new patient visit). APPT_PRIOR() shows the last appointment regardless of status.
Has anyone else noticed that {APPT_PRIOR()} is showing todays appointment? I know at one time it pulled in the last visit now it is pulling in arrived visit from today. Thanks