Create/update user information

Description

Originally from https://openvpms.org/project/add-created-and-updated-details-primary-archetypes

Overview

There is currently no way to determine:

  • who last edited an object

  • who created an object (with the exception of acts)

This project will add support to track the who created and updated an object and when. This information can be:

  • displayed in the user interface

  • included in reports

Creation and update information will be added to:

  • Acts (includes financial acts, document acts)

  • Entities

  • Parties

  • Users

  • Products

  • Product Prices

  • Lookups

  • Documents

  • Archetypes

  • Roles

  • Authorities

This will be done by adding four new columns to the underlying database tables:

  • created - timestamp

  • created_id - user id that created the record

  • updated - timestamp

  • updated_id - user id that updated the record

These will be exposed on the archetypes as the following nodes:

  • created

  • createdBy

  • updated

  • updateBy

These nodes will be hidden and read-only.

This change will also:

  • remove the need for participation.author on acts

  • remove the need for createdDate on party.customerperson

  • remove the need for createdDate on party.patientpet

User Interface Changes

Editors and viewers will be updated to display the create and update information on the top right of the view.

Database changes

The following tables will be updated to include the created, created_id, updated, and updated_id columns.

  • acts

  • archetype_descriptors

  • documents

  • entities

  • lookups

  • product_prices

  • security_roles

Migration

  • for acts that provide an author node, the createdBy node will set to the author, and the author participation will be deleted

  • party.customerperson instances with a non-null createdDate will have the created time set to createdDate. The createdDate will be removed.

  • party.patientpet instances with a non-null createdDate will have the created time set to createdDate. The createdDate will be removed.

  • document templates that reference author nodes need to be updated to use
    openvpms:get(., "createdBy.name")

  • act.patientReminder instances will have the created time set to the createdTime node. The createdTime node can change (its the basis for date calculations) - this will be renamed to initialTime to avoid confusion with created.

  • all other acts will have the created time set to the start time, so long as the start time is not future dated

  • documents will have the created time and createdBy node of the associated act, where present

  • archetypes that don't have an author node won't be updated to include the created, createdBy, updated and updatedBy nodes. These aren't necessary for display. They can be added as required for reporting.

The following templates and reports will be updated:

  • reports/Customer/Counter Sale/<size>/Counter Sale.jrxml (author referenced, but not displayed)

  • reports/Customer/Credit/<size>/Credit.jrxml (author referenced, but not displayed)

  • reports/Customer/Credit Adjustment/<size>/Credit Adjustment.jrxml (author referenced, but not displayed)

  • reports/Customer/Debit Adjustment/<size>/Debit Adjustment.jrxml (author referenced, but not displayed)

  • reports/Customer/Estimate/<size>/Estimate.jrxml (author referenced, but not displayed)

  • reports/Customer/Invoice/<size>/Invoice.jrxml (author referenced, but not displayed)

  • reports/Customer/Receipt/<size>/Receipt.jrxml (author referenced, but not displayed)

  • reports/Customer/Refund/<size>/Refund.jrxml (author referenced, but not displayed)

  • reports/Patient/Insurance/<size>/Insurance Claim.jrxml

  • reports/Patient/Insurance/<size>/Insurance Claim Invoice.jrxml (author referenced, but not displayed)

  • reports/Product/Stock Adjustment/<size>/Stock Adjustment.jrxml

  • reports/Product/Stock Transfer/<size>/Stock Transfer.jrxml

  • reports/Reporting/Bank Deposit/<size>/Bank Deposit.jrxml

  • reports/Reporting/Reports/Customer/<size>/Customer Acquisition Report.jrxml

  • reports/Reporting/Reports/Customer/<size>/Customer Referral Report.jrxml

  • reports/Reporting/Reports/Customer/<size>/Customer Retention Report.jrxml

  • reports/Reporting/Reports/Financial/<size>/Key Performance Indicators.jrxml

  • reports/Reporting/Reports/Financial/<size>/Practice Summary_CountVisitsLocation.jrxml

  • reports/Reporting/Reports/Financial/<size>/Practice Summary_IncomeByClinician.jrxml

  • reports/Reporting/Reports/Financial/<size>/Practice Summary_PaymentsByLocation.jrxml

  • reports/Reporting/Reports/Patient/<size>/Patient Acquisition Report.jrxml

  • reports/Reporting/Till Balancing/<size>/Till Balance.jrxml

  • reports/Sample/<size>/Sample Patient Form.jrxml (author referenced, but not displayed)

  • reports/Supplier/Credit/<size>/Supplier Credit.jrxml (author referenced, but not displayed)

  • reports/Supplier/Delivery/<size>/Delivery.jrxml (author referenced, but not displayed)

  • reports/Supplier/Invoice/<size>/Supplier Invoice.jrxml (author referenced, but not displayed)

  • reports/Supplier/Order/<size>/Order.jrxml (author referenced, but not displayed)

  • reports/Supplier/Refund/<size>/Supplier Refund.jrxml (author referenced, but not displayed)

  • reports/Supplier/Remittance/<size>/Supplier Remittance.jrxml (author referenced, but not displayed)

  • reports/Supplier/Return/<size>/Supplier Return.jrxml (author referenced, but not displayed)

  • reports/Workflow/Appointment/<size>/Appointment.jrxml (author referenced, but not displayed)

  • reports/Customer Order/Pharmacy Order/<size>/Pharmacy Order.jrxml (author referenced, but not displayed)

  • reports/Customer Order/Pharmacy Return/<size>/Pharmacy Return.jrxml (author referenced, but not displayed)

  • reports/Workflow/Task/<size>/Task.jrxml (author referenced, but not displayed)

Exclusions

This project will not provide create/update information for:

  • contacts

  • relationships

  • identities

  • links

The information can be obtained from the parent objects e.g. for a phone number contact, the party.customerperson object will track who created or updated it.

Environment

None

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Time tracking

0m

Components

Fix versions

Priority

Minor
Configure