Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31134
    Support
    Keymaster

    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 :-

    per.lastname  <- a person's lastname
    per.dob <- their date of birth
    per.email <- their email address

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

    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
    #32527

    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?

    #32528
    Support
    Keymaster

    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

    frmEditorBaseRec Editor = (Params[0] as frmEditorBaseRec);
    cPer per = (Editor.Record as cPer); // <- the base PER record
    cDBBaseRec custom_patient_fields = Editor.CustomRec; // <- the CUSTOM record

    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");
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.