Hi Jo,
>> The custom fields that appear at the patient record list and templates/patient
>> list only show the custom list from patient records
The code that William provided correctly pulls out CUSTOM PATIENT fields and CUSTOM CASE FIELDS.
>> There are 3 where i have custom fields
>> 1) patient record
>> 2) patient case
>> 3) patient session.
SESSIONS and CASES are two completely different things and the custom fields for those records are stored in different tables. You only mentioned custom CASE fields before (not SESSIONS) so William didn't provide you with the code to include SESSIONS.
However, it's simply not possible to present this data on one tabular report. To understand why, you first need to understand the relationship between the records.
A patient can have ANY NUMBER of
CASES and a
CASE can contain ANY NUMBER of
SESSIONS. This is represented in ClinicOffice by a TREE structure e.g.
Patient
|- Case 1
| |- Session A
| |- Session B
| |- Session C
|- Case 2
| |- Session D
| |- Session E
| |- Session F
Here there are SIX different SESSION records, 2 different CASE records and 1 PATIENT record, a total of 9 different records (although it can potentially be unlimited). How can this be displayed on one line in a tabular list report? Which CASE would you display next to the Patient's name and which SESSION would display? You would have to display a separate line for every SESSION and every CASE which means each patient would appear multiple times. This would then make totals at the bottom of the report meaningless.
Please can you explain in detail exactly what it is you're trying to achieve? If possible, please also provide us with a complete mockup of the report that you want and then our technicians can take a look to see if it's something that we can do for you.
Many thanks!