guilfordmedical said:
We have a lab letter that we mail out to patients that informs them of their fasting APE lab appointment date. I want to add their next two appointments on that letter to inform our patients of their lab appointment and their APE appointment date.
{APPT_Next()} only inserts their fasting lab appointment. What else do I need to do to get their actual APE date?
Any help appreciated!
Thanks!
Ashley Corbean
@guilfordmedical" rel="nofollow" target="_blank">acorbean@guilfordmedical
We use the function APPTS_BY_STATUS("Confirmed", "FULL") to return future appointments. This function will give you a list of all appointments in a delimited list and you can loop through the list and only grab the specific appointments that you want.
A couple things to note:
1. I apologize if there are any MEL errors in the code - I modified an existing function we use to meet what you are looking for, assuming the appointment type is APE.
2. Jerroll's solution above is excellent and should also solve the issue for you...however, a word of caution. I have been told by GE Support that while they will support functions that are listed in the CPS Help Menu, global MEL variables (such as _MELCurPatientAppt) are not guaranteed to work from version to version of the EMR. In short, the explanation from support was that these global variables are used by the GE developers and are not meant for us to access (even though they made it very easy for us to do so). Just a friendly piece of advice, as we were using one of these MEL variables several versions ago, upgraded, and the function calling this MEL variable no longer worked. I try to use functions listed in CPS > Help when possible, although if there is no function available (or if the function doesn't work properly), the global MEL variables are your only option.
{fn upComingApptList(){
local retStr = ""
local apptArrayOV1
local apptArrayOV2
local apptArrayOVDTL_DATES = array("DELETE", "ME")
local apptArrayOVDTL_TIMES = array("DELETE", "ME")
local apptArrayOVDTL_TYPES = array("DELETE", "ME")
local apptArrayOVDTL_PROV = array("DELETE", "ME")
if APPTS_BY_STATUS("Confirmed", "FULL") <> "" then
apptArrayOV1 = getfield(APPTS_BY_STATUS("Confirmed", "FULL"), "\r", "")
for x = 1, x <= size(apptArrayOV1) - 1, x = x + 1 do
apptArrayOV2 = getfield(apptArrayOV1[x], ",", "")
if match(apptArrayOV2[3], 1, "APE") > 0 and durationdays(apptArrayOV2[1], str(._TODAYSDATE)) < 0 then
INSERT(apptArrayOVDTL_DATES, size(apptArrayOVDTL_DATES) + 1, apptArrayOV2[1])
INSERT(apptArrayOVDTL_TIMES, size(apptArrayOVDTL_TIMES) + 1, apptArrayOV2[2])
INSERT(apptArrayOVDTL_TYPES, size(apptArrayOVDTL_TYPES) + 1, apptArrayOV2[3])
cond
case size(apptArrayOV2) == 6: INSERT(apptArrayOVDTL_PROV, size(apptArrayOVDTL_PROV) + 1, apptArrayOV2[6] + " " + apptArrayOV2[5])
case size(apptArrayOV2) == 5: INSERT(apptArrayOVDTL_PROV, size(apptArrayOVDTL_PROV) + 1, apptArrayOV2[5])
endcond
endif
endfor
endif
if size(apptArrayOVDTL_DATES) <= 2 then
retStr = "No APE Appointment Scheduled."
else
for x = 3, x <= size(apptArrayOVDTL_DATES), x = x + 1 do
if retStr <> "" then retStr = retStr + HRET endif
retStr = retStr + apptArrayOVDTL_DATES[x] + " " + apptArrayOVDTL_TIMES[x] + " -" + "\t" + apptArrayOVDTL_TYPES[x]
if apptArrayOVDTL_PROV[x] <> "" then
retStr = retStr + "," + apptArrayOVDTL_PROV[x]
endif
endfor
endif
if retStr <> "" and match(retStr, 1, "\n\n") > 0 then
retStr = replaceStr(retStr, "\n\n", "\n")
endif
return retStr
}}
Posted : July 10, 2014 6:37 am