Hey there,
I have been struggling to get the scheduled date/time associated with the document that is created. When adding a client to the schedule and checking them in, a document is created. But, I can't seem to get the scheduled date/time that is associated with the scheduled event that created the document.
The workflow of my department is such that many clients are added to a schedule and immediately checked in to get the documents added to the desktop, and then the documents are edited. (Generally this happens at the end of the day, as clients are often seen as walk-ins here.)
I have tried:
APPTS_BY_STATUS("arrived") - returns a list of all arrived appoints, but I am unable to tell which is the one is the one associated with the document
APPT_PRIOR - my best bet, however if a client is added and checked in twice on the same day (which is common here when a client is in crisis), then the document will have the most recent date and time, not the correct date and time. If I could allow the user to change this time, then this would be an okay solution, but there is too much of a possibility that the document will be stamped with the wrong date and time.
I am sure that someone has solved this problem. Could you be the one?
Thanks!
Kim
For CPS this is my exact Appointment type code -
find("_ApptType","Name","ApptTypeID",find("_PatientAppointments","ApptTypeID","AppointmentsID",find("Document","AppointmentsID")))
This modified version should give you appointment start -
find("_PatientAppointments","ApptStart","AppointmentsID",find("Document","AppointmentsID"))
You would have to run this in an update, whether it be in a data display or saving it to a document variable or observation term. I should note that the document also has to be associated with the appointment or it will be blank.
OMG, thank you so much!
I could hug you-- I have been trying to get this to work for what seems like forever now and you just solved it for me!!!! This solution works perfectly for me.
I did have to parse out the date and time, so my code wound up looking like:
{!
tdString = find("_PatientAppointments","ApptStart","AppointmentsID",find("Document","AppointmentsID"))
s = getfield(tdString, " ")
global appt_date = s[1]
}
For the time field, my code looked the same , except that for the last line I grab )s[2] + " " + s[3]) (The string that is returned from the find call returns three "words" - the date, the time, and the AM/PM. So for the time I have to grab both the time and the AM/PM part.)
My and my practice are much obliged!!
Thanks again!!
Kim
Hey there!
Having a new problem... I want the date to default to the document date if there isnt' a scheduled date. I have the following, which gives me a "COMPILER ERROR NEARBY: EOF was unexpected after IDENTIFIER" Error. Both the "find" function and the DOCUMENT.CLINICALDATE variable return the date string, but it's giving me a lot of hassle. Any idea what I am doing wrong here?
{!
tdString = find("_PatientAppointments","ApptStart","AppointmentsID",find("Document","AppointmentsID"))
if (tdString == "") then
tdString = DOCUMENT.CLINICALDATE
endif
s = getfield(tdString, " ")
global appt_date = (s[1])
}
DOCUMENT.CLINICALDATE is not actually a string, you have to convert it, try -
str(DOCUMENT.CLINICALDATE)