«
module documentation

This module defines django.forms.ModelForms for the creation and deletion of the models defined in patients.models. Generally, forms are used to capture user input in django and are rendered out by views into HTML elements.

To a large extent, these forms only define which widgets should be used for creating and changing database entries via the website itself. But they are also used to implement custom logic to check that all the inputs are valid or that the data is properly cleaned before its being passed on to the next step.

Class DataFileForm Accept and process a CSV file that can then be parsed to batch-create a number of patients at once.
Class DatasetForm Form to create and edit datasets, based on their model definition.
Class DiagnoseForm Form to create and edit diagnoses, based on their model definition. Nothing special is happening here: Only some widgets are defined for the few fields of the models.Diagnose model and a loop over all implemented LNLs saves us some hard-coding of a long list of widgets for the node levels.
Class PatientForm Form to create and edit patients, based on their model definition. Most notably, it includes custom cleaning methods like _compute_age that take - possibly sensitive - inputs and convert them into the - less sensitive - information we actually care about and want to store.
Class TumorForm Form to create and edit tumors, based on their model definition. Very straightforward, not much custom validation. This class basically just defines how some of the fields that are already defined in models.Tumor...