Q. What is the Scripting Module?
The Scripting Module is an optional add-on module for ClinicOffice which allows you to code scripts to enhance program behaviour to better suit your needs. Scripts are primarily EVENT-DRIVEN which means that they get triggered when a certain event takes place in ClinicOffice.
Q. OK, so how does it work?
Let's take an example. Say you wanted to make the "REFERRED BY CATEGORY" field mandatory on the Patient Editor. In other words, you always want to record if a patient came to you through advertising, word of mouth etc. etc. By default, this field is OPTIONAL in ClinicOffice so your users are not obliged to complete it, so we want to change that behaviour.
Firstly, you need to locate the 'Script Editor' which can be found inside the Design tab in the patient record. Using the Scripting Module we are then able to add a script to the "OnBeforeSaveRecord". This is located by expanding the "frmEditorPatient" event. Simply copy and paste the script into the 'script source code' box and save.
The script would look like this :-
- Code: Select all
frmEditorBaseRec Editor = (Params[0] as frmEditorBaseRec);
cPer per = (Editor.Record as cPer);
if (per.referredcat_id == null)
{
throw new PSExc.FriendlyException("Please enter the 'Referred By Category' for this patient", "Referred By Category Required");
}
Q. Whoa! That looks complicated!
It is complicated! The script is written in a language called C# (the same language which ClinicOffice is written in), so writing scripts requires a knowledge not only of C# but also of some of the programming objects used in ClinicOffice.
Q. But we're not programmers, so surely this is of no use to us?!
If you're on the ClinicOffice Support Plan then our support team will be happy to write simple scripts (like the one above) on your behalf. Hence, all you have to do is purchase the Scripting Module for ClinicOffice (a one-off charge of £95) and join the Support Plan (if you're not already a member).
Furthermore, we're going to be building up a library of scripts which will be posted on this ClinicOffice Support Forum website. All that's required then is to COPY & PASTE them into your ClinicOffice.
NOTE: If you require a very large or complicated script to be written for you, then there may be a small charge.
Q. OK... so how do I find out if it's possible to do x, y or z with scripting?
- Firstly, please try searching the forum to see if it's already been done or already been requested.
- Secondly, you can post a new topic and one of our support team will reply to your questions.
- Thirdly, if you're on the ClinicOffice Support Plan then give our helpdesk a call and we'll be happy to help!