14.7. New task walkthrough: CORE-10 example¶
Starting point: checked out and happily compiling.
Understand the task.
Start with the
Re the CORE-10: copyright now allows electronic reproduction: http://www.coreims.co.uk/copyright.pdf.
create class in
find a similar task, or failing that something simple!
at some point should run
qmake, as it’s a new Q_OBJECT.
.cppfile, then start to think
in constructor: is it anonymous? Does it have a clinician? Does it have a respondent?
for very simple tasks like this, can often just use a N_QUESTIONS format, with questions numbered 1 to N_QUESTIONS, and fieldname named
diversion: update the task factory, meaning update
inittasks.cppto initialize the task (create the table(s), etc.) during app startup.
back to main task
work through calculations
add it to one or more menus; see
set the minimum server version; do this for the task, not the whole CamCOPS client; this means creating a task function
bump the client version in
changelog.rstand all the other things it says in
at some point, will want an
xstring; create the
.xmlfile. Since this task is freely available, put it in
update docs all-tasks list,
update docs category task list,
special for CORE-10: remove from “prohibited/missing” list, ,
create_all_autodocs.py --make --destroy_first
check the docs build: from the
you may need to add new autogenerated files in
docs/source/autodoc/to the Git repository
create Python file:
work through, mirroring calculations on client
check with PyCharm
create database revision using
server/tools/create_database_migration.py; this will create a new file in
server/camcops_server/alembic/versions. Review this manually!
note that the revision doesn’t contain the new task! So delete it, then…
tasks/__init__.pyto load the task
create database migration (again…)
manually review the database migration for sanity
migration file will need adding to Git repository manually
upgrade the test database with
camcops upgrade_db ...
When pushed to Github, the live docs will auto-update.