Notifications in Lino Welfare

This page is a tested document and the following instructions are used for initialization:

>>> from lino import startup
>>> startup('lino_welfare.projects.gerd.settings.doctests')
>>> from lino.api.doctest import *
>>> translation.activate("en")

Testing the client workflow

Automatic tests are in lino_welfare.projects.std.tests.test_notify.

Some processes are not yet covered by any automatic test because they contain Javascript dialogs. So here is a manual test suite.

The following instructions are for lino_welfare.projects.gerd, but similar steps are in lino_book.projects.mathieu.

  • Install Lino Welfare, go to the lino_welfare.projects.gerd directory, run pm prep followed by runserver.

  • Instead of logging in as Theresia, Caroline etc, consider logging in as Robin and then act as Theresia, Caroline. The advantage is that your menus and labels will be in English.

Managing newcomer requests

AssignCoach and RefuseClient)

  • Act as Caroline

  • Select Newcomers ‣ New Clients, double-click on Emil EIERSCHAL, select the Coaches tab.

  • In the Available coaches panel, click on Assign next to Hubert. Confirm dialog by clicking OK. Note that the console says:

    Notify 1 users that EIERSCHAL Emil (175) zugewiesen zu Hubert Huppertz
    
  • Note that the Workflow field now says “Coached –> Former”

  • Switch to the “History” tab and verify that a system note has been created.

  • Close the detail window and reopen it on Bruno BRAUN (another client). Select the Coaches tab. In the Workflow field click on Refuse. Select “PCSW is not competent” as Refusal reason from the selection list. Confirm dialog by clicking OK.

  • Switch to the “History” tab and verify that a system note has been created.

  • Act as Hubert and verify that he has a welcome message “You have 1 unseen notifications”. Click on this message and verify that the “About” field of the notification is a clickable pointer to the client Emil EIERSCHAL.

    No notification is sent for RefuseClient since there is no coaching.

As a reception clerk, receive a waiting visitor (ReceiveVisitor)

  • Click on the first client listed in Waiting visitors (EMONTS Daniel).

  • That client is waiting for Hubert. Click Receive in the Appointments panel. You get a confirmation Emonts Daniel begins consultation with Hubert Huppertz. Are you sure?. Click OK. Note that they are now Busy.

  • Close the detail window. Note that Daniel is no longer listed in Waiting visitors.

As a reception clerk, check out a visitor who leaves the center (CheckoutVisitor)

  • From the main menu, select Reception ‣ Busy visitors.

  • Find Daniel Emonts. Click on Checkout. Confirm the message Emonts Daniel leaves after meeting with Hubert Huppertz. Are you sure?

As a reception clerk, check in a visitor with appointment (CheckinVisitor)

  • Note that the demo data is not very realistic here.

  • Click on the first client mentioned in Waiting visitors.

  • Click Checkin on one of the appointments mentioned there

  • Confirm the dialog

  • Note that a system note has been created.

EndCoaching

  • EndCoaching seems no longer used

  • CreateClientVisit

  • CreateCoachingVisit

Managing Notifications

I added filter parameters for Messages.

I was not possible until now to override the verbose_name of the owner field of a Controllable. Now it is possible using update_controller_field.

>>> ses = rt.login("robin")
>>> ses.show(rt.models.notify.AllMessages)
===================== =================== =========== ====== ======
 Created               Subject             Recipient   seen   sent
--------------------- ------------------- ----------- ------ ------
 2014-05-22 05:48:00   Broadcast message
===================== =================== =========== ====== ======

>> ses.show(rt.models.notify.MyMessages) [✓]22/05/2014 05:48 The database has been initialized. >> ses.show(rt.models.notify.MyMessages, display_mode=”grid”) ===================== ==================================== ============== ========== Created Subject Message Type Workflow ——————— ———————————— ————– ———- 2014-05-22 05:48:00 The database has been initialized. System event [✓] ===================== ==================================== ============== ========== <BLANKLINE>