Medical Record Locking




This project will add support to lock medical records to prevent them being edited, after a period of time.

Once locked, a record may not be not edited nor deleted except in specific circumstances - see Exceptions below.

The following records will support locking:

  • Note

  • Addendum (see below)

  • Weight

  • Medication

  • Attachment

  • Form

  • Image

  • Letter

  • Investigation


Medical record locking will be enabled by a new practice level configuration option Medical Record Lock Interval. This will specify a period and units, e.g 24 hours or 1 week. If blank, locking will be disabled.

Medical records will be locked by setting their status to Finalised. This will be done automatically by a background task that runs periodically to set the status on all In Progress or Completed medical records with:

1 Start Time < now - interval


  • Start Time = the date/time when the record was created

  • now = the current date/time

  • interval = the Medical Record Lock Interval


There are a number of exceptions to the locking rule:

  • Medication, investigation and document records linked to an invoice may be edited or removed via the invoice, until the invoice is finalised

  • Investigation and Attachment records can be updated via the Document Loader

  • Medication, investigation, and document records can be unlinked from the patient history if the invoice is reversed. See

  • Investigation records can have:

    • results attached

    • select attributes changed (see Investigation Changes below)

Addendum Record

To support changes to Notes and Medication records that have been locked, a new Addendum record will be provided. This is a type of note that:

  • is added to an existing Note or Medication

  • is displayed after the record in the history that it annotates

A record can have multiple Addendum records. They are displayed in increasing chronological order e.g.

1 2 3 4 5 6 7 8 9 20/10/2015 - Consultation - J Smith [Completed] (8 years) 20/10/2015 Note J Smith S: P presents for a 5-6 day history of rear limb weakness and crying out in pain in the mornings. O: PE unremarkable. A: Differentials: IVDD, vascular event, etc P: Treat symptomatically for now with prednisone and methocarbamol. 23/10/2015 Addendum A Bern Above note was saved incomplete: O has tramadol at home and told o to continue to give tramadol for the next 5-7 days. Recheck in 7-10 days if does not resolve. 24/10/2015 Addendum A Bern Another addendum to the note 20/10/2015 Medication J Smith Amoxil Tablets 200mg Qty: 1

An Addendum may only be created if the selected record is a Note or Medication. Adding an Addendum to another Addendum is not supported as it may make the chronology unclear.


The ability to enable or disable locking is available to administrators. A new Audit Message will be logged to Workflow - Messaging when locking is changed. e.g.

1 1/10/2015 10:00 - Medical Record Locking Interval set to 1 week by admin


1 1/10/2015 10:32 - Medical Record Locking was disabled by admin

This message may be read, but not deleted.

Investigation Changes


The patient Investigation record has a status field which is incompatible with the proposed locking mechanism i.e. its status may currently be one of:

  • In Progress

  • Received

  • Completed

  • Cancelled

  • Preliminary

  • Final

This will be changed so that the status field may be one of:

  • In Progress

  • Cancelled

  • Finalised

A new field, Order Status, will be added which may be one of:

  • Pending - the order is yet to be submitted

  • Sent - the order has been submitted

  • Received - order results have been received. This will be the status the Document Loader uses whenever it attaches a document

  • Reviewed - results have been reviewed. This must be set by users

The Completed and Received statuses will be dropped.
The existing 'Reviewed' node will be removed.

This will require a change to Workflow - Investigations workspace, to support querying by Order Status as well as Status.

Post Locking updates

Investigations need to support some updates after they have been locked:

  • Reports need to be able to be added. Adding a report should create a new version, if a report has already been attached.

  • The Order Status needs to be editable

All other fields should be read-only. It should not be possible to replace an existing Report, nor edit past versions.

Editing Records

Prior to editing an In Progress medical record, a check will be performed to ensure that it may still be edited based on the locking criteria. This is required as the background task may not have got round to change its status to Finalised.

Archetype Changes

  • The Weight, Note and Medication archetypes, need a read-only, hidden status node with possible values:

    • In Progress

    • Finalised

  • A new Addendum archetype is required

  • Each of the record types currently allow their date to be changed. These dates will need to be made read-only, as they will be used to determine when the record is locked.

Reporting Changes

The following reports need to be updated to support the Addendum record:

  • Medical Records

  • Problems

  • Patient History Search


Existing investigations need to be migrated, in order to support the new Result Status. Any investigation with:

  • Status = In Progress and no results, will have Order Status set to Pending

  • Status = In Progress and results, will have Order Status set to Received

  • Status = Received will have Status set to In Progress and Order Status set to Received

  • Status = Completed and Reviewed = true, will have Status set to Finalised, and Order Status set to Reviewed

  • Status = Completed and Reviewed = false, will have Status set to In Progress, and Order Status set to Received

  • Status = Cancelled and Reviewed = true, will have Order Status set to Reviewed

  • Status = Cancelled and Reviewed = false, will have Order Status set to Pending

  • Status = Preliminary, will have Status set to In Progress and Order Status set to Pending

  • Status = Final and Reviewed = true, will have Status set to Finalised and Order Status set to Reviewed

  • Status = Final and Reviewed = false, will have Status set to Finalised and Order Status set to Received





Tim Anderson


Tim Anderson




Fix versions