9.11. Developer functions¶
Additional testing functions are provided for those superusers who have the “developer” flag set. They allow breaking of the usual restrictions on the RDBM, and should be used for authorized testing (generally on systems with fictional data) only.
9.11.1. Developer admin site¶
This Django admin site allows you full control over all models used by the site. In addition to the objects managed by the RDBM admin site, this includes:
- Clinician responses:
- Dummy patient source information:
- Patient lookups:
Some additional permissions are also added for the other models.
The developer views are those ending in
9.11.2. Generate random NHS numbers for testing¶
Self-explanatory. All are completely random (so there is a risk of generating a real one!) and pass the NHS number checksum system.
9.11.3. Test patient lookup without saving data¶
This function takes an NHS number and looks up (identifiable) patient details without saving anything. Use it to test the identity lookup system.
9.11.4. Test consent mode lookup without saving data¶
This function takes an NHS number and looks up CRATE traffic-light (etc.) consent mode information, without saving anything. Use it to test the consent mode lookup system.
9.11.5. Test templates¶
This section offers all the templates used by the consent-to-contact system (most in HTML and PDF versions), using a specific fictional patient, study, researcher, and clinician (ID number -1).
The templates vary by patient age, consent mode, and so on. You can therefore view variants by altering the default URLs to use these URL query parameters:
consent_mode=<value>; for the consent mode, specify
green, or anything else for
request_direct_approach=<value>(use 0 or 1)
consent_after_discharge=<value>(use 0 or 1)
An example is therefore
The fictional patient’s DOB is synthesized from the age you specify and today’s date.
crate_anon.crateweb.consent.models.make_dummy_objects() for defaults.