TreatmentItem

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

The Treatment Item Class is a custom data type to decribe an item of treatment.

An enumeration system is in place (as class attributes) to describe exactly what type of treatment the object refers to. Those types are

  • TreatmentItem.SIMPLE
  • TreatmentItem.TOOTH
  • TreatmentItem.ROOT
  • TreatmentItem.FILL
  • TreatmentItem.CROWN
  • TreatmentItem.BRIDGE
  • TreatmentItem.PROSTHETICS
  • TreatmentItem.OTHER

See also

ProcCode

methods and attributes

class lib_openmolar.common.db_orm.treatment_item.TreatmentItem(param)[source]

Bases: object

Note

this custom data object represents an item of treatment. the underlying procedure code can be accessed with TreatmentItem.code

raises a TreatmentItemException if errors are encountered

__init__(param)[source]

overloaded function

Param :QSql.QSqlrecord

will load values from the Record

Param :string

string should be of the form “A01” ie. uniquely identify a proc code

Param :ProcCode

pass in a ProcCode object directly

BRIDGE = 6
CROWN = 5
FILL = 4
OTHER = 8
PROSTHETICS = 7
ROOT = 3
SIMPLE = 0
TEETH = 2
TOOTH = 1
abutments[source]

a list of all metadata items which are bridge abutments

add_metadata()[source]

create a new TreatmentItemMetadata object and append to this treatment item. note - returns the item so that values can be set

allow_multiple_teeth[source]

True if this treatment can related to multiple teeth

Note

an example would be a periodontal splint

allowed_pontics[source]

which teeth are acceptable as pontics eg upper partial pontics should be in range(1,18)

category[source]
check_valid()[source]

a tuple (valid, errors), where valid is a boolean, and errors a list of errors

check to see that the item has all the attributes required by the underlying procedure code

Note

our 3 surface filling will need to know tooth and surfaces returns a tuple (valid, errors), where valid is a boolean, and errors a list of errors

clear_metadata()[source]

reset the metadata

cmp_date[source]

date the item was completed (returns None if tx incomplete)

code = None
comment[source]

any comment made by the user

comment_required[source]
commit_to_db(database)[source]
Param :database

write this item to the database

will raise an exception if item is not is_valid()

description[source]
entered_span[source]

returns the entered total span of a bridge (if this is a bridge)

errors[source]

convenience function to get the errors for this item (if any)

further_info_needed[source]
id[source]

returns the primary key of the treatments table for this item, or None if the item is not in the database

in_database[source]

returns true if the item is in the database if it is, then it will have a valid qsql_record .

is_bridge[source]
is_chartable[source]

a bool indicating whether this treatment item can be represented on a dental chart. example, an examination is not, but a filling in the UR5 is

is_completed = None
is_prosthetics[source]
is_valid[source]
metadata[source]

returns a list of all TreatmentItemMetadata objects

pontics[source]

a list of all metadata items which are pontics

pontics_required[source]
px_clinician[source]

the unique id of a clinician who prescribed the treatment

qsql_record = None
required_span[source]

how many units should this be if it is to be a bridge? returns an integer or None

set_abutments(teeth)[source]
Param :list of pontics [int, int, int...]

ints should comply with Tooth Notation

set_cmp_date(date=PyQt4.QtCore.QDate(2013, 4, 18))[source]
Param :date

sets the item as completed, on date date

set_comment(comment)[source]
Param :string
set_completed(completed=True)[source]
Kword :completed=bool
set_pontics(pontics)[source]
Param :list of pontics [int, int, int...]

ints should comply with Tooth Notation

set_px_clinician(clinician_id)[source]
Param :clinician_id (int)

Note

who prescribed this treatment int should be the unique id of a clinician

set_surfaces(surfaces)[source]
set_teeth(teeth)[source]
Param :[int, int, int...]

ints should comply with Tooth Notation

set_tx_clinician(clinician_id)[source]
Param :clinician_id (int)

Note

who prescribed this treatment int should be the unique id of a clinician

surfaces_required[source]
tooth_required[source]

returns True if this code needs tooth metadata (some don’t)

total_span[source]
tx_clinician[source]

the unique id of a clinician who performed the treatment

type[source]

Table Of Contents

Previous topic

TeethPresentDecoder

Next topic

TreatmentItemException