CamCOPS – Admin
Back to Documentation

Viewing recent events in the audit log (basic details)

Viewing the audit log via the web viewer

There’s an option for this on the menu.

Viewing the audit log via SQL

For example:

SELECT when_access_utc, user, table_name, server_pk, LEFT(details, 100) FROM _security_audit ORDER BY when_access_utc DESC LIMIT 100;

Deleting old records, or specific records required by law to be deleted

Which records to consider?

This can a complex question. To delete clinical records in the UK, one must know the age of the records (e.g. destruction after 30 years), but also factors such as whether the patient had a mental disorder within the meaning of the Mental Health Act 1983, or died whilst in the care of an NHS organization (see UK Department of Health, 2006, Records Management: NHS Code of Practice).

CamCOPS allows you to view records created before a certain date (e.g. created more than 30 years ago), by specifying a suitable end date in the search criteria, and for privileged users, this can be done across all patients.

The other criteria for deletion (e.g. mental disorder, death) are outside the scope of CamCOPS.

Erase contents of an individual task record

Identify it as above, browse to its HTML view, and use the erasure link at the bottom (superusers only).

Note that this will not affect other records for the same subject, but it will erase predecessor or successor versions of the same record. When the record is erased, it remains in the database, but its contents are wiped. Any current records become non-current upon erasure.

Erasure is prohibited for non-finalized tasks (for one thing, the tablet might re-upload the record). Finalize (or force-finalize) first.

Delete all records for a subject by subject ID

Use the option on the main menu (superusers only).

This will completely delete the records, leaving no remnant aside from the audit trail.

Application of a special note

Identify the task, browse to its HTML view, and use the link at the bottom (superusers only).

Note that this will apply the note to all predecessor/successor versions of the same record.

Forcibly preserving/finalizing records from a damaged device

If a tablet device is damaged, it may be unable to preserve and finalize its records. In these circumstances, use the administrative option to finalize them forcibly. (After this, the finalized versions will be treated as distinct from any remaining on the tablet, if the tablet is later rescued.) The option will allow you to proceed even if the patient identification does not meet the necessary requirements; see also the facility to edit patient details, below.

Manually editing finalized patient details

Once a task is finalized, you can edit the corresponding patient details (for that and potentially other, linked, tasks). The option is offered to authorized users at the bottom of a given task.

Restarting the server after a crash

This shouldn’t be necessary, unless the crash is because the config file is mis-configured. After fixing any errors, run sudo apachectl restart to restart Apache and thus the CamCOPS server scripts.

If the error isn’t because of a misconfiguration, and isn’t because you’ve deliberately induced a crash for testing purposes with the crash action URL, then please save all the details (including those provided to the HTTP client and any details in the Apache server logs) and let us know!

Command-line use of CamCOPS

Begin with camcops --help. This produces

Launching CamCOPS command-line tool...
CamCOPS loading...
INFO:rnc_pdf:PDF processor set to: xhtml2pdf
usage: camcops [-h] [-v] [-m] [--dropsuperfluous]
               [--confirm_drop_superfluous_1] [--confirm_drop_superfluous_2]
               [-r] [-t] [-s] [-u] [-p] [-e] [-d] [-7] [-q] [-y] [-x]

CamCOPS command-line tool. Run with no arguments for an interactive menu.

positional arguments:
  configfilename        Configuration file

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -m, --maketables      Make/remake tables and views
  --dropsuperfluous     Additional option to --maketables to drop superfluous
                        columns; requires both confirmatory flags as well
                        Confirmatory flag 1/2 for --dropsuperfluous
                        Confirmatory flag 2/2 for --dropsuperfluous
  -r, --resetstoredvars
                        Redefine database title/patient ID number meanings/ID
  -t, --title           Show database title
  -s, --summarytables   Make summary tables
  -u, --superuser       Make superuser
  -p, --password        Reset a user's password
  -e, --enableuser      Re-enable a locked user account
  -d, --descriptions    Export table descriptions
  -7, --hl7             Send pending HL7 messages and outbound files
  -q, --queue           View outbound HL7/file queue (without sending)
  -y, --anonstaging     Generate/regenerate anonymisation staging database
  -x, --test            Test internal code

If you run camcops with no command-line options, you will be offered an interactive menu with these choices. Note that you must run camcops as a user that has authority to read the configuration file you want to work with (so if that file can only be read by the root user, you will need to use sudo camcops <options>.

Generating a first-pass-anonymised staging database

CamCOPS can generate a staging database for exporting clinical data to an anonymised research database, such as with the CRIS system. CamCOPS will anonymise the data to the best of its ability first. See the ANONSTAG_* and EXPOR_CRIS_* options in the CamCOPS configuration file, and the source code (available from the menus via introspection) for more detail.

This option is only available from the command line.

Valid HTML 4.01 Transitional
Valid CSS