I'm trying to show only PT appointments in a data display. Our PT appointment types all begin with PT, so I was going to try to break down the APPTS_BY_STATUS list into arrays in order to do so, but I can't seem to get it to work.
This is what is in the data display:
{arrived_list(APPTS_BY_STATUS("scheduled","FULL"))}
And this is the function I created:
{!fn arrived_list(strList){
local counter
local strArrivedList
local result = ""
strArrivedList = getfield(strList,"\r","")
for
counter = 1, counter <= size(strArrivedList), counter = counter + 1
do
strArrivedList[counter] = getfield(strArrivedList[counter], ",","")
if match(strArrivedList[counter][3],"PT")>0 then
result = strArrivedList[counter][1] + ", "+strArrivedList[counter][2]+", "+strArrivedList[counter][3]+", "+strArrivedList[counter][4]+", "+strArrivedList[counter][5]+hret
else ""
endif
endfor
return result
}}
what does it end up actually returning when you use that? I think I have a function that can do that
The data display is blank.
I'd like it to return:
date, time, appt type, facility, provider
date, time, appt type, facility, provider
but only PT appointments.
Ok and is PT a separate location of care or would that be based on the summary line for the appointment?
Yes, PT has 3 separate locations and their names all end in "PT". Just like their appointment types all begin with "PT". I was trying to narrow down the results to only appointments that had an appointment type that contained "PT" (match function). I tried with facility that contained "PT" as well and that didn't work either.
Hey Aubrey, sorry but every time I try to post the function, it cuts out part of the text so I sent you an email. Let me know!