Automatically refresh workspace on display

Donate to this project

Development Project Status: Seeking Funding

Total cost estimate (ex-Tax): 
Due date for completion of this stage: 
Project funding: 

Pledges can be made by email by clicking here.
Development will not commence until fully funded.

In many workspaces, the  Find button must be clicked to refresh the display.


1. User A displays the Charges for customer X, then switches to their Information

2. User B invoices customer X

3. User A switches back to viewing Charges for customer X

Presently, when User A switches back the Charges workspace, they will see the old charges. User A then needs to click Find to get the new invoice added by User B.

This project will add support to automatically refresh the display when switching from one workspace to another.

The refresh will attempt to preserve the current selection. E.g.:

  • in Customers|Charges, if the 3rd Invoice is highlighted, and the fifth Item of that Invoice is selected, this will be displayed after the refresh
  • in Products|Information, if the 5th page of products is displayed, and the selection is "Brufen 200mg Tablets", the 5th page will be displayed after refresh (if it exists). If the "Brufen 200mg Tablets" are on this page, it will be selected.

This will apply to the following workspaces:

  • Customers|Documents
  • Customers|Estimates
  • Customers|Charges
  • Customers|Payments
  • Customers|Account
  • Customers|Notes & Alerts
  • Patients|Medical Records|Summary
  • Patients|Medical Records|Problems
  • Patients|Medical Records|Reminders/Alerts
  • Patients|Medical Records|Documents
  • Patients|Medical Records|Charges
  • Patients|Medical Records|Prescriptions
  • Suppliers|Documents
  • Suppliers|Orders
  • Suppliers|Deliveries
  • Suppliers|Charges
  • Suppliers|Payments
  • Suppliers|Account
  • Products|Information
  • Products|Stock Management
  • Reporting|Till Balancing
  • Reporting|Deposits
  • Reporting|Work In Progress
  • Reporting|Reports

The following workspaces aren't included as they shouldn't refresh:

  • Reporting|Debtors
  • Reporting|Reminders

The following workspaces aren't included as they already refresh:

  • Customers|Information
  • Patients|Information
  • Suppliers|Information
  • Workflow|Scheduling
  • Workflow|Work Lists
  • Workflow|Messaging
  • Workflow|Investigations

The following workspaces will not refresh automatically:

  • Administration|Organisation
  • Administration|Types
  • Administration|Templates
  • Administration|Lookups
  • Administration|Users
  • Administration|Groups
  • Administration|Roles
  • Administration|Authorities
  • Administration|Archetypes


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Refresh workspace on display - omit admin stuff

I don't think that we need to bother about the Admin workspaces. Unless its a versy very simple change, my recommendation would be to omit them.

Re: Refresh workspace on display - algorithm

I suspect that we may not have to be 'all encompasing'. That is, I don't think that the real problem is with the select windows (because these refresh when opened - ie if you have done a customer selection for names starting 'ai' and you select one of them, and then someone else adds say 'ainsley, john', then when you press the Reselect button, Ainsley, John will be there).

I think that the problem is as you move between "screens" ie if you move from Customer|Accounts to Customers|Payments to do a payment and then back to Customer|Accounts, then the payment that you have just done does not show [until you press Find to do a refresh].

The problem here is that a screen/workspace (Customers|Account) that we have cached has become out of date because of the payment, but when you switch back to it, it is shown as it was and not refreshed.

The following algorithm may help resolve the problem.

Concept: have a table that indicates whether or not a refresh is required when a user switches to a cached workspace.

Required data structure: a table with a row for each logged on user, and a column for each workspace/screen, with each cell containing two things, a dirty flag and an identifier.  The dirty flag, if set means that the screen should be refreshed when switched to.  The identifier is something that identifies what is displayed, for the customer, patient, and supplier screens it is the customer/patient/supplier id, for the workflow scheduling and worklist screens it is the date and shedule/worklist view. [In fact one might want a primary and secondary identifier slots - for supplier|orders one might want the supplier and store location ids as the primary and secondary identifiers.]

Program logic:

1) When an update occurs (eg the customer payment), then one runs down the appropriate column (in the case the Customers|Account column) looking for any cell (ie any user row) where the id is the same as that that just updated, and if so, set the dirty flag.

2) When the user switches to a workspace/screen, check the dirty flag, if set clear it and do a find to refresh the cached information.

3) when the user logs on, create the row for the user in the table. When the log off, delete the row.


The above logic allows the cached information to be used as is where it is not dirty, and only refreshed when it is dirty.  It also handles the cases where the update is being done by the user themselves or some other user. 

Note that it might be argued that the above logic is too much of a shotgun approach, in that if someone updates a line item in an invoice for customer X, then if I am looking a customer X's Charges screen but NOT at the date range including the updated invoice, then it will flag that a refresh is required when it is not.

However, I think that the suggested approach provides a good trade-off between simplicity of implementation and achieved result.


Regards, Tim G

Re: Refresh workspace on display - algorithm

The easiest approach is actually to re-query the data. Hibernate maintains a cache so recent queries and updates may not trigger a database access.

Syndicate content