Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #36899


    I would like to automatically create a task when certain events occur such as when a patient record has certain values.

    Is there a function I can call or is it done directly by inserting a new row to the task table?

    Can you share some sample code for creating a task, allocating it to a staff member and setting a reminder and due date?



    Joshua Barrs

    Hi Sean,

    Thanks for your post.

    Unfortunately there is no function for this action. This kind of thing would require direct manipulation of the database, and as such, is quite a complex request. The purpose of the ClinicOffice scripting engine is to allow our development team to make enhancements and tweak the software to suit individual requests. It has not been designed as a customer facing feature.

    With this in mind, please could you email the full request along with a detailed specification of what you are wanting to achieve, and our development team will be able to complete the work for you. The address you need is

    We look forward to hearing from you.



    Hi Josh

    Would you be able to advise which tables require updating? ‘Tasks’ is obvious but I don’t see which table is used to associate it with a row in Per.




    Never mind, the Task List report gives me everything I need to write the sql

    select as task_id, as description,
    (case task.priority
    when 1 then 'High'
    when 2 then 'Normal'
    when 3 then 'Low'
    else 'UNKNOWN' end) as priority,
    task.iscompleted as completed,
    task.clinic_id, as _clinic,
    link.ref_per_id as patient_per_id,
    @NAME:per as _patient_link,
    staff.knownas as _staff_assigned

    from task

    left join clinic on (
    left join link on ( and link.ref_per_id is not null)
    left join per on (
    left join taskstaff on (
    left join staff on (

    Pioneer Software

    Thanks for posting your solution Sean.

    For other users reading this, please note that we don’t recommend that end-users use SQL to directly manipulate their database, unless you’re 100% sure that you know what you’re doing, since you could delete or update data irrevocably.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.