I am trying to display only a date & time of an appointment in an encounter form (that will have a letter output).
The APPT_NEXT() is not cutting it because of all of the extra information that displays in the field.
(Ex: This year you are scheduled for a P1 Health Screen appointment on 08/17/2012,2:00 pm,Test Appt,Test,Test Book.)
Any advice would be greatly appreciated.
SUB(APPT_NEXT(), MATCH(APPT_NEXT(), 1, "/") - 2, MATCH(APPT_NEXT(), MATCH(APPT_NEXT(), MATCH(APPT_NEXT(), 1, "/"), ","), ",") - (MATCH(APPT_NEXT(), 1, "/") - 2))
this should strip out '08/17/2012, 2:00 pm'.
You could also use a function to return the elements from appt_next() that you want. This happens to return 1, 2, and 5 without labels, but you could alter the function to meet your needs.
{fn nappt(){
local napp=""
local narr=getfield(APPT_NEXT(), ",", "")
local nsize=size(narr)
for
count=1, count<=nsize, count=count+1
do
napp=narr[1] + " " + narr[2] + " " + narr[5]
endfor
return napp}
}