October 9, 2018 at 10:42 am #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?
SeanOctober 9, 2018 at 1:16 pm #36900Joshua BarrsKeymaster
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 firstname.lastname@example.org
We look forward to hearing from you.October 9, 2018 at 2:27 pm #36903
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.
SeanOctober 9, 2018 at 8:57 pm #36906
Never mind, the Task List report gives me everything I need to write the sql
task.id as task_id,
task.name as description,
when 1 then 'High'
when 2 then 'Normal'
when 3 then 'Low'
else 'UNKNOWN' end) as priority,
task.iscompleted as completed,
clinic.name as _clinic,
link.ref_per_id as patient_per_id,
@NAME:per as _patient_link,
staff.knownas as _staff_assigned
left join clinic on (clinic.id=task.clinic_id)
left join link on (link.task_id=task.id and link.ref_per_id is not null)
left join per on (link.ref_per_id=per.id)
left join taskstaff on (taskstaff.task_id=task.id)
left join staff on (taskstaff.staff_id=staff.id)October 10, 2018 at 8:59 am #36907Pioneer SoftwareKeymaster
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.
- You must be logged in to reply to this topic.