List of PER fields (for Patients, Contacts and Staff)

Scripting help and sample scripts for use with the Scripting Module
Post a reply

List of PER fields (for Patients, Contacts and Staff)

Postby Support » September 7th, 2010, 3:41 pm

PER is short for PERson, so PER objects are used to reference patient, contact and staff records in ClinicOffice.

Typically in a script, you'll find a field referenced as "per.fieldname" for example :-

Code: Select all
per.lastname  per.dob        per.email     

Here's the full list of fields available on the PER object in ClinicOffice.

Code: Select all
title
firstname
middlename
lastname
knownas
company
address1
address2
address3
towncity
county
postcode
country
telephone
worktel
mobile
fax
email
webpage
notes
clinic_id
ispatient
iscontact
patcat_id
patstatus_id
referredcat_id
refby_per_id
maritalstatus_id
occupation_id
practitioner_staff_id
gp_per_id
resp_per_id
insurance_per_id
invrecip_per_id
familyhead_per_id
contcat_id
registrationdate
code
consent
insuranceref
discpercent
invduedays
dob
sex
height
weight
archived
deleted
ClinicOffice Support Team
User avatar
Support
Site Admin
 
Posts: 875
Joined: August 25th, 2005, 6:37 pm
Top

Re: List of PER fields (for Patients, Contacts and Staff)

Postby Alfred » August 25th, 2011, 8:02 pm

Can I also access user defined fields programatically? Specifically, can I access a field referring to a list? Should I simply refer to per.custom_field_id?
Alfred
 
Posts: 3
Joined: August 25th, 2011, 6:24 pm
Top

Re: List of PER fields (for Patients, Contacts and Staff)

Postby Support » August 26th, 2011, 3:50 pm

Yes you can access custom fields from the scripts. How you do this depends on the event that the script is fired from

As an example, the following script would check a custom field called "is_smoker" and then display a message when the patient record is loaded :-

frmEditorPatient - OnAfterLoadRecord
Code: Select all
frmEditorBaseRec Editor = (Params[0] as frmEditorBaseRec);
cPer per = (Editor.Record as cPer);  // cDBBaseRec custom_patient_fields = Editor.CustomRec; //
if (custom_patient_fields.Row["is_smoker"] != DBNull.Value &&
    (bool)custom_patient_fields.Row["is_smoker"] == true)
{
  PSDevEx.cMessages.InformationBox("This Patient is a smoker!", "Smoker Alert");
}
ClinicOffice Support Team
User avatar
Support
Site Admin
 
Posts: 875
Joined: August 25th, 2005, 6:37 pm
Top


Post a reply

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron