TreatmentModel

Author:Neil Wallace (neil@openmolar.com)
Release:2.0.906~hg207
Date:April 18, 2013

For Treatment Plans, a model/view design is in place.

This model keeps a list of all TreatmentItem objects for the patient, and is aware whether they are in the database or not (ie. have just been added).

The model will inform any views of changes.

Note

This is the current focus of development.

methods and attributes

class lib_openmolar.client.db_orm.treatment_model.TreatmentModel[source]

Bases: object

__init__()[source]

instanciates with no params

exception ItemError

Bases: exceptions.Exception

TreatmentModel.add_to_chart_model(treatment_item)[source]

represent the treatment_item on the charts page somehow.

TreatmentModel.add_treatment_item(treatment_item)[source]

add a TreatmentItem Object returns True if the TreatmentItem is valid, else False

TreatmentModel.clear()[source]

reset this model

TreatmentModel.cmp_tx_chartmodel = None

a pointer to the treatment completed ChartDataModel

TreatmentModel.commit_changes()[source]

push all changes to the database

TreatmentModel.commit_item(item)[source]

Commit the item to the database

TreatmentModel.complete_treatment_item(treatment_item, completed=True)[source]
Param :treatment_item (TreatmentItem)
Kword :completed=bool (default True)

toggles the state of a TreatmentItem to completed

TreatmentModel.deleted_items[source]

returns a list of all TreatmentItem which have been deleted

TreatmentModel.get_records()[source]

pulls all treatment items in the database (for the patient with the id specified during load_patient function)

TreatmentModel.is_dirty[source]

will return True if the model differs from that in the database

TreatmentModel.load_patient(patient_id)[source]
Parameters:patient_id – integer
TreatmentModel.plan_tx_chartmodel = None

a pointer to the treatment plan ChartDataModel

TreatmentModel.remove_treatment_item(treatment_item)[source]

removes a TreatmentItem Object

TreatmentModel.treatment_items[source]

returns a list of all TreatmentItem in the model

TreatmentModel.update_chart_models()[source]

completely reloads the chart models.

TreatmentModel.update_views()[source]

this should be called after adding to the model update all submodels (treeview, charts etc.)

Table Of Contents

Previous topic

TreatmentItemFinaliseDialog

Next topic

TreatmentPage