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

      Hi

      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?

      thanks

      Sean

      #36900
      Joshua Barrs
      Keymaster

        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 info@pioneersoftware.co.uk

        We look forward to hearing from you.

         

        #36903
        slh
        Participant

          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.

          thanks

          Sean

          #36906
          slh
          Participant

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

            select

            task.id as task_id,
            task.name as description,
            task.due,
            (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.notes,
            task.clinic_id,
            clinic.name as _clinic,
            link.ref_per_id as patient_per_id,
            @NAME:per as _patient_link,
            taskstaff.staff_id,
            staff.knownas as _staff_assigned

            from task

            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)

            #36907
            Pioneer Software
            Keymaster

              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.