Models Documentation

AI Models

class endoreg_db.models.administration.ai.ActiveModel(*args, **kwargs)[source]

Bases: Model

ActiveModel represents an active instance of a model within the application. .. attribute:: name

A unique identifier for the active model.

type:

str

model_meta

A reference to the metadata of the model. This field acts as a ForeignKey to the ModelMeta model and can be null.

Type:

ModelMeta, optional

Notes

  • The model_meta attribute is configured with on_delete=models.SET_NULL, meaning that if the related ModelMeta record is deleted, model_meta will be set to null.

  • Type hints for model_meta are provided under a TYPE_CHECKING conditional import to avoid circular dependencies, importing ModelMeta only when type checking is performed.

Managers:

objects (ActiveModelManager): Custom manager providing specialized query capabilities for ActiveModel instances.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

model_meta: ModelMeta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

model_meta_id
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
class endoreg_db.models.administration.ai.AiModel(*args, **kwargs)[source]

Bases: Model

Represents a generic AI model that encapsulates high-level metadata about the model, including names (default, German, and English), a description, categorization details, and associated label sets and meta information.

name (str): Unique name of the AI model. name_de (str): Optional German name of the AI model. name_en (str): Optional English name of the AI model. description (str): Optional detailed description of the AI model. model_type (str): Optional type/category of the AI model. model_subtype (str): Optional subtype within the broader model type. video_segmentation_labelset (VideoSegmentationLabelSet): Optional associated label set for video segmentation tasks. active_meta (ModelMeta): Optional reference to the currently active ModelMeta instance associated with the model.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

active_meta: ModelMeta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

active_meta_id
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

metadata_versions

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

model_subtype

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

model_type: ModelType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

model_type_id
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key for this model.

objects
classmethod set_active_model_meta(model_name, meta_name, meta_version)[source]

Set the active model.

Parameters:
  • model_name (str)

  • meta_name (str)

  • meta_version (int)

video_segmentation_labelset: VideoSegmentationLabelSet

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

video_segmentation_labelset_id
class endoreg_db.models.administration.ai.ModelType(*args, **kwargs)[source]

Bases: Model

A class representing a model type.

name

The name of the model type.

Type:

str

description

A description of the model type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

ai_models: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key for this model type

objects

Case

class endoreg_db.models.administration.case.Case(*args, **kwargs)[source]

Bases: Model

Represents a clinical case, linking a patient to one or more examinations over a specific period.

patient

The patient associated with this case.

Type:

Patient

patient_examinations

Examinations included in this case.

Type:

QuerySet[PatientExamination]

hash

An optional hash value for the case.

Type:

str

start_date

The start date and time of the case.

Type:

datetime

end_date

The end date and time of the case (optional).

Type:

datetime

is_active

Indicates if the case is currently active.

Type:

bool

is_closed

Indicates if the case has been closed.

Type:

bool

is_deleted

Indicates if the case is marked as deleted.

Type:

bool

created_at

Timestamp of case creation.

Type:

datetime

updated_at

Timestamp of last case update.

Type:

datetime

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

close(end_date=None)[source]

Close this case with optional end date.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

end_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_start_date(*, field=<django.db.models.fields.DateTimeField: start_date>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_start_date(*, field=<django.db.models.fields.DateTimeField: start_date>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_active

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_closed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_deleted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

mark_as_deleted()[source]

Mark this case as deleted.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examinations: models.QuerySet['PatientExamination']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patient_id
reopen()[source]

Reopen this case if it was closed.

start_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.administration.case.CaseTemplate(*args, **kwargs)[source]

Bases: Model

Represents a case template.

name

The unique name of the case template.

Type:

str

template_type

The type of the case template.

Type:

ForeignKey

description

A description of the case template.

Type:

str

rules

The primary rules associated with the case template.

secondary_rules

Secondary rules associated with the case template.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_create_patient_medication_schedule_rule()[source]

Retrieves the “create-patient_medication_schedule” rule.

Returns:

The rule for creating a patient medication schedule.

Return type:

CaseTemplateRule

Raises:

ValueError – If multiple such rules exist.

get_create_patient_rule()[source]

Retrieves the “create-patient” rule.

Returns:

The rule that creates a patient.

Return type:

CaseTemplateRule

Raises:

ValueError – If multiple such rules exist.

get_rules()[source]

Retrieves all primary rules associated with the case template.

Returns:

A queryset of primary rules.

get_secondary_rules()[source]

Retrieves all secondary rules associated with the case template.

Returns:

A queryset of secondary rules.

Return type:

QuerySet

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key for the case template.

Returns:

The natural key consisting of the name.

Return type:

tuple

objects
rules

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

secondary_rules

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

template_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

template_type_id
class endoreg_db.models.administration.case.CaseTemplateRule(*args, **kwargs)[source]

Bases: Model

A class representing a case template rule.

name

The name of the case template rule.

Type:

str

description

A description of the case template rule.

Type:

str

name_de

The name of the case template rule in German.

Type:

str

name_en

The name of the case template rule in English.

Type:

str

rule_type

The type of the rule.

Type:

CaseTemplateRuleType

parent_model

The model on which the rule is applied.

Type:

str

target_field

The field of the parent model on which the rule is applied.

Type:

str

target_model

The model to which the foreign key points (used for foreign key and many-to-many rules).

Type:

str

rule_values

A list of string values for the rule.

Type:

list

extra_parameters

A dictionary of extra parameters for the rule.

Type:

dict

value_type

The type of the rule value.

Type:

CaseTemplateRuleValueType

chained_rules

The chained rules associated with the current rule.

Type:

QuerySet

single_categorical_value_distribution

The single categorical value distribution for the rule.

Type:

SingleCategoricalValueDistribution

numerical_value_distribution

The numerical value distribution for the rule.

Type:

NumericValueDistribution

multiple_categorical_value_distribution

The multiple categorical value distribution for the rule.

Type:

MultipleCategoricalValueDistribution

date_value_distribution

The date value distribution for the rule.

Type:

DateValueDistribution

objects

The manager for the CaseTemplateRule model.

Type:

CaseTemplateRuleManager

natural_key()[source]

Returns the natural key of the rule.

__str__()[source]

Returns a string representation of the rule.

get_rule_type()[source]

Returns the name of the rule type.

get_chained_rules()[source]

Returns all the chained rules associated with the current rule.

get_all_downward_chained_rules()[source]

Returns all the chained rules of the current rule, including indirectly chained rules.

chained_rules_has_self_reference()[source]

Checks if any directly or indirectly chained rules reference this rule, creating a non-terminating loop.

save(*args, **kwargs)

Customizes the save method to check for self-references.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

calling_rules

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

casetemplate_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

chained_rules

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

chained_rules_has_self_reference()[source]
Noindex:

Check if any directly or indirectly chained rules reference this rule, creating a non-terminating loop. Return a list containing a tuple (first_rule, self_referencing_rule) for each self-reference. first_rule is the most upward rule in the chain that references the rule. self_referencing_rule is the rule that references the current rule itself.

Returns:

A list of tuples representing the self-referencing rules.

date_value_distribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

date_value_distribution_id
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

extra_parameters

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_all_downward_chained_rules()[source]

Get all chained rules of the current rule, including indirectly chained rules.

Returns:

A set of all chained rules of the current rule.

get_chained_rules()[source]

Returns all the chained rules associated with the current rule.

Returns:

A queryset of all the chained rules associated with the current rule.

get_distribution()[source]

Returns the value distribution of the rule.

Returns:

The value distribution of the rule.

get_parent_model()[source]

Returns the parent model of the rule.

Returns:

The parent model of the rule.

get_rule_type()[source]

Returns the name of the rule type.

Returns:

The name of the rule type.

get_target_field()[source]

Returns the target field of the rule.

Returns:

The target field of the rule.

get_target_model()[source]

Returns the target model of the rule.

Returns:

The target model of the rule.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

multiple_categorical_value_distribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

multiple_categorical_value_distribution_id
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key of the rule.

Returns:

A tuple representing the natural key of the rule.

numerical_value_distribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

numerical_value_distribution_id
objects
parent_field

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

parent_model

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

rule_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

rule_type_id
rule_values

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

secondary_rules

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

single_categorical_value_distribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

single_categorical_value_distribution_id
target_field

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_model

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

value_type_id
class endoreg_db.models.administration.case.CaseTemplateRuleType(*args, **kwargs)[source]

Bases: Model

Represents a type of rule for a case template.

name

The name of the rule type.

Type:

str

name_de

The German name of the rule type.

Type:

str

name_en

The English name of the rule type.

Type:

str

description

A description of the rule type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

casetemplaterule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
class endoreg_db.models.administration.case.CaseTemplateRuleValue(*args, **kwargs)[source]

Bases: Model

Represents a case template rule value.

name

The name of the rule value.

Type:

str

description

A description of the rule value.

Type:

str

fk_value

Foreign key value stored as a string.

Type:

str

numeric_value

Numeric value for the rule.

Type:

float

text_value

Text value for the rule.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

fk_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_value()[source]

Retrieves the value based on priority: - fk_value > numeric_value > text_value > None.

Returns:

The value based on the type hierarchy.

Return type:

str | float | None

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key for the object.

numeric_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
text_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.administration.case.CaseTemplateRuleValueType(*args, **kwargs)[source]

Bases: Model

A class representing a case template rule value type.

name

The name of the case template rule value type.

Type:

str

distribution_type

One of “single_categorical”, “multiple_categorical”, “numeric”

description

A description of the case template rule value type.

Type:

str

DISTRIBUTION_TYPES
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

casetemplaterule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

distribution_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_distribution_type_display(*, field=<django.db.models.fields.CharField: distribution_type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
class endoreg_db.models.administration.case.CaseTemplateType(*args, **kwargs)[source]

Bases: Model

A class representing a case template type.

name

The name of the case template type.

Type:

str

description

A description of the case template type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

case_templates

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects

Center

class endoreg_db.models.administration.center.Center(id, name, name_de, name_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymexaminationreport_set: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center_products: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center_resources: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center_wastes: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

endoscopes: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

endoscopy_processors: QuerySet

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

examiner_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

first_names: QuerySet

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

classmethod get_by_name(name)[source]
get_endoscopes()[source]
get_first_names()[source]
get_last_names()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_names: QuerySet

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
Return type:

tuple[str]

objects: CenterManager
patient_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

rawpdffile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sensitivemeta_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

videofile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

videometa_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.center.CenterProduct(*args, **kwargs)[source]

Bases: Model

Associates a Product with a Center, indicating its usage on a specific date.

product

The product used.

Type:

Product

date_used

The date the product was used.

Type:

date

center

The center where the product was used.

Type:

Center

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
date_used

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_date_used(*, field=<django.db.models.fields.DateField: date_used>, is_next=True, **kwargs)
get_package_weight()[source]
get_previous_by_date_used(*, field=<django.db.models.fields.DateField: date_used>, is_next=False, **kwargs)
get_product_group()[source]

Returns the ProductGroup associated with this product.

Return type:

ProductGroup | None

get_product_name()[source]

Returns the name of the product.

Return type:

str

get_product_weight()[source]
get_reference_product()[source]

Returns the reference Product for this product’s group.

Return type:

Product | None

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
product: Product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

product_id
class endoreg_db.models.administration.center.CenterResource(id, name, center, name_de, name_en, quantity, resource, transport_emission_factor, use_emission_factor, year, unit)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

resource: Resource

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

resource_id
transport_emission_factor: EmissionFactor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

transport_emission_factor_id
unit: Unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

unit_id
use_emission_factor: EmissionFactor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

use_emission_factor_id
year

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.administration.center.CenterWaste(id, center, year, waste, quantity, unit, emission_factor)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
emission_factor: EmissionFactor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

emission_factor_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

unit: Unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

unit_id
waste: Waste

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

waste_id
year

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Person

class endoreg_db.models.administration.person.Examiner(id, first_name, last_name, dob, gender, email, phone, is_real_person, center, hash)[source]

Bases: Person

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymexaminationreport_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center: administration.Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
classmethod custom_get_or_create(first_name, last_name, center, substitute_names=True)[source]
Parameters:
  • first_name (str)

  • last_name (str)

  • center (administration.Center)

  • substitute_names (bool)

dob

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gender

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

gender_id
hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_real_person

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

rawpdffile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sensitivemeta_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.FirstName(id, name)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

centers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
report_reader_configs

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.LastName(id, name)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

centers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
report_reader_configs

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.Patient(*args, **kwargs)[source]

Bases: Person

A class representing a patient.

Attributes inhereted from Person:

first_name (str): The first name of the patient. last_name (str): The last name of the patient. dob (datetime.date): The date of birth of the patient. gender (Foreign Key): The gender of the patient. email (str): The email address of the patient. phone (str): The phone number of the patient.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

age()[source]

Get the age of the patient.

Returns:

The age of the patient.

anonymexaminationreport_set: models.QuerySet['AnonymExaminationReport']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set: models.QuerySet['AnonymHistologyReport']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cases

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
create_event(event_name_str, date_start=None, date_end=None, description=None)[source]
Parameters:
create_examination(examination_name_str=None, date_start=None, date_end=None)[source]

Creates a patient examination for this patient.

Parameters:
create_examination_by_indication(indication, date_start=None, date_end=None)[source]
Parameters:
create_examination_by_pdf(pdf)[source]

Creates a patient examination for this patient based on the given report file.

Parameters:

pdf (media.RawPdfFile)

classmethod create_generic(center='gplay_case_generator')[source]

Create a generic patient with random attributes.

Parameters:

center – The center of the patient.

Returns:

The created patient.

create_lab_sample(sample_type='generic', date=None, save=True)[source]

Create a lab sample for this patient.

Parameters:
  • sample_type – The sample type. Should be either string of the sample types name or the sample type object. If not set, the default sample type (“generic”) is used.

  • date – The date of the lab sample.

Returns:

The created lab sample.

dob: datetime.date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

export_patient_examinations()[source]

Get all associated PatientExaminations, ReportFiles, and Videos for the patient.

first_name: str

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gender: Gender

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

gender_id
get_dob()[source]
Return type:

date

classmethod get_dob_from_age(age, current_date=None)[source]

Get a date of birth based on the given age and current date.

Parameters:
  • age – Age of the patient.

  • current_date – Current date.

Returns:

Date of birth based on the given age and current date.

classmethod get_or_create_pseudo_patient_by_hash(patient_hash, center=None, gender=None, birth_month=None, birth_year=None)[source]
Parameters:
get_patient_examinations()[source]

Returns all patient examinations for this patient ordered by date (most recent is first).

classmethod get_random_age(min_age=55, max_age=90, mean_age=65, std_age=10, distribution='normal')[source]

Get a random age based on the given distribution.

Parameters:
  • min_age – Minimum age.

  • max_age – Maximum age.

  • mean_age – Mean age.

  • std_age – Standard deviation of the age.

  • distribution – Distribution of the age.

Returns:

Random age based on the given distribution.

classmethod get_random_gender(p_male=0.5, p_female=0.5)[source]

Get a Gender object by name (male, female) from the database with given probability.

Parameters:
  • p_male – Probability of selecting ‘male’ gender.

  • p_female – Probability of selecting ‘female’ gender.

Returns:

Gender object selected based on given probabilities.

classmethod get_random_name_for_gender(gender_obj, locale='de_DE')[source]
get_unmatched_report_files()[source]

Returns all report files for this patient that are not matched to a patient examination.

get_unmatched_video_files()[source]

Returns all video files for this patient that are not matched to a patient examination.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_real_person

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

lab_samples

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

lab_values

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

last_name: str

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient_examinations: models.QuerySet['PatientExamination']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patient_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patientdisease_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patientevent_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patientmedication_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patientmedicationschedule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

raw_pdf_files

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sensitivemeta_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

video_files

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.Person(*args, **kwargs)[source]

Bases: Model

Abstract base class for a person.

first_name

The first name of the person.

Type:

str

last_name

The last name of the person.

Type:

str

dob

The date of birth of the person.

Type:

date

gender

The gender of the person.

Type:

str

email

The email address of the person.

Type:

str

phone

The phone number of the person.

Type:

str

class Meta[source]

Bases: object

abstract
dob

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gender

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

gender_id
is_real_person

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.administration.person.PortalUserInfo(id, user, profession, works_in_endoscopy)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
profession: Profession

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

profession_id
user: User

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

user_id
works_in_endoscopy

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.administration.person.Profession(id, name, name_de, name_en, description)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
portaluserinfo_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Product

class endoreg_db.models.administration.person.Examiner(id, first_name, last_name, dob, gender, email, phone, is_real_person, center, hash)[source]

Bases: Person

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymexaminationreport_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center: administration.Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
classmethod custom_get_or_create(first_name, last_name, center, substitute_names=True)[source]
Parameters:
  • first_name (str)

  • last_name (str)

  • center (administration.Center)

  • substitute_names (bool)

dob

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gender

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

gender_id
hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_real_person

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

rawpdffile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sensitivemeta_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.FirstName(id, name)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

centers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
report_reader_configs

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.LastName(id, name)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

centers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
report_reader_configs

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.Patient(*args, **kwargs)[source]

Bases: Person

A class representing a patient.

Attributes inhereted from Person:

first_name (str): The first name of the patient. last_name (str): The last name of the patient. dob (datetime.date): The date of birth of the patient. gender (Foreign Key): The gender of the patient. email (str): The email address of the patient. phone (str): The phone number of the patient.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

age()[source]

Get the age of the patient.

Returns:

The age of the patient.

anonymexaminationreport_set: models.QuerySet['AnonymExaminationReport']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set: models.QuerySet['AnonymHistologyReport']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cases

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
create_event(event_name_str, date_start=None, date_end=None, description=None)[source]
Parameters:
create_examination(examination_name_str=None, date_start=None, date_end=None)[source]

Creates a patient examination for this patient.

Parameters:
create_examination_by_indication(indication, date_start=None, date_end=None)[source]
Parameters:
create_examination_by_pdf(pdf)[source]

Creates a patient examination for this patient based on the given report file.

Parameters:

pdf (media.RawPdfFile)

classmethod create_generic(center='gplay_case_generator')[source]

Create a generic patient with random attributes.

Parameters:

center – The center of the patient.

Returns:

The created patient.

create_lab_sample(sample_type='generic', date=None, save=True)[source]

Create a lab sample for this patient.

Parameters:
  • sample_type – The sample type. Should be either string of the sample types name or the sample type object. If not set, the default sample type (“generic”) is used.

  • date – The date of the lab sample.

Returns:

The created lab sample.

dob: datetime.date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

export_patient_examinations()[source]

Get all associated PatientExaminations, ReportFiles, and Videos for the patient.

first_name: str

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gender: Gender

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

gender_id
get_dob()[source]
Return type:

date

classmethod get_dob_from_age(age, current_date=None)[source]

Get a date of birth based on the given age and current date.

Parameters:
  • age – Age of the patient.

  • current_date – Current date.

Returns:

Date of birth based on the given age and current date.

classmethod get_or_create_pseudo_patient_by_hash(patient_hash, center=None, gender=None, birth_month=None, birth_year=None)[source]
Parameters:
get_patient_examinations()[source]

Returns all patient examinations for this patient ordered by date (most recent is first).

classmethod get_random_age(min_age=55, max_age=90, mean_age=65, std_age=10, distribution='normal')[source]

Get a random age based on the given distribution.

Parameters:
  • min_age – Minimum age.

  • max_age – Maximum age.

  • mean_age – Mean age.

  • std_age – Standard deviation of the age.

  • distribution – Distribution of the age.

Returns:

Random age based on the given distribution.

classmethod get_random_gender(p_male=0.5, p_female=0.5)[source]

Get a Gender object by name (male, female) from the database with given probability.

Parameters:
  • p_male – Probability of selecting ‘male’ gender.

  • p_female – Probability of selecting ‘female’ gender.

Returns:

Gender object selected based on given probabilities.

classmethod get_random_name_for_gender(gender_obj, locale='de_DE')[source]
get_unmatched_report_files()[source]

Returns all report files for this patient that are not matched to a patient examination.

get_unmatched_video_files()[source]

Returns all video files for this patient that are not matched to a patient examination.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_real_person

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

lab_samples

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

lab_values

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

last_name: str

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient_examinations: models.QuerySet['PatientExamination']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patient_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patientdisease_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patientevent_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patientmedication_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patientmedicationschedule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

raw_pdf_files

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sensitivemeta_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

video_files

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.administration.person.Person(*args, **kwargs)[source]

Bases: Model

Abstract base class for a person.

first_name

The first name of the person.

Type:

str

last_name

The last name of the person.

Type:

str

dob

The date of birth of the person.

Type:

date

gender

The gender of the person.

Type:

str

email

The email address of the person.

Type:

str

phone

The phone number of the person.

Type:

str

class Meta[source]

Bases: object

abstract
dob

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gender

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

gender_id
is_real_person

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.administration.person.PortalUserInfo(id, user, profession, works_in_endoscopy)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
profession: Profession

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

profession_id
user: User

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

user_id
works_in_endoscopy

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.administration.person.Profession(id, name, name_de, name_en, description)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
portaluserinfo_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Label

class endoreg_db.models.label.ImageClassificationAnnotation(*args, **kwargs)[source]

Bases: Model

Represents an image classification annotation, linking a label to a specific frame.

An annotation is associated with a single Frame instance, which itself links to either a Video or RawVideoFile.

frame

The frame associated with the annotation.

Type:

ForeignKey

label

The label assigned to the annotation.

Type:

ForeignKey

value

Indicates if the classification is true/positive.

Type:

bool

float_value

Optional float value associated with the classification (e.g., confidence score).

Type:

FloatField

annotator

Identifier for the user or process that created the annotation.

Type:

str

model_meta

Optional link to the model metadata if generated by a model.

Type:

ForeignKey

date_created

The creation timestamp of the annotation.

Type:

datetime

date_modified

The last modification timestamp of the annotation.

Type:

datetime

information_source

Optional link to the source of this information.

Type:

ForeignKey

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

annotator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

float_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frame: Frame

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

frame_id
get_next_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)
get_next_by_date_modified(*, field=<django.db.models.fields.DateTimeField: date_modified>, is_next=True, **kwargs)
get_previous_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)
get_previous_by_date_modified(*, field=<django.db.models.fields.DateTimeField: date_modified>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

information_source: InformationSource

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

information_source_id
label: Label

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

label_id
model_meta: ModelMeta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

model_meta_id
objects
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.label.Label(*args, **kwargs)[source]

Bases: Model

A class representing a label.

name

The name of the label.

Type:

str

label_type

The type of the label.

Type:

LabelType

description

A description of the label.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_classification_annotations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

label_sets: models.QuerySet['LabelSet']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

label_type: LabelType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

label_type_id
labelvideosegment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key of this label

objects
class endoreg_db.models.label.LabelSet(*args, **kwargs)[source]

Bases: Model

A class representing a label set.

name

The name of the label set.

Type:

str

description

A description of the label set.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_labels_in_order()[source]

Get all labels in this label set as list in the correct order. Ordered by string representation (a is first).

Return type:

list[Label]

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

labels: QuerySet

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

model_metadata

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key of this label set

objects
version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.label.LabelType(*args, **kwargs)[source]

Bases: Model

A class representing a label type.

name

The name of the label type.

Type:

str

description

A description of the label type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

labels

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key of this label type

objects
class endoreg_db.models.label.LabelVideoSegment(*args, **kwargs)[source]

Bases: Model

Represents a labeled segment within a video, defined by start and end frame numbers.

A segment must be associated with exactly one VideoFile. If it originates from a prediction, it links to a single VideoPredictionMeta.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classmethod create_from_video(source, prediction_meta, label, start_frame_number, end_frame_number)[source]

Create a LabelVideoSegment instance from a VideoFile.

Parameters:
end_frame_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

generate_annotations()[source]

Generate ImageClassificationAnnotations for the frames within this segment, if the segment originated from a prediction. Uses bulk_create for efficiency.

get_annotations()[source]

Returns ImageClassificationAnnotations associated with the frames in this segment.

Return type:

QuerySet

get_frames()[source]

Returns frames associated with the segment from the linked VideoFile.

Return type:

QuerySet | list

get_frames_without_annotation(n_frames)[source]

Get up to n frames within the segment that do not have an ImageClassificationAnnotation for this segment’s label.

Parameters:

n_frames (int)

Return type:

list[Frame] | list

get_model_meta()[source]

Returns the ModelMeta associated via the prediction metadata, if any.

Return type:

ModelMeta | None

get_segment_len_in_s()[source]

Calculates the segment length in seconds.

Return type:

float

get_video()[source]

Returns the associated VideoFile instance.

Return type:

VideoFile

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_validated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

label: 'Label' | None

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

label_id
objects
patient_findings: models.QuerySet['PatientFinding']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

prediction_meta: 'VideoPredictionMeta' | None

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

prediction_meta_id
source: 'InformationSource' | None

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

source_id
start_frame_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

state

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

video_file: VideoFile

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

video_file_id
class endoreg_db.models.label.VideoSegmentationAnnotation(*args, **kwargs)[source]

Bases: Model

Represents a video segmentation annotation, linking a label to a time segment within a specific video file.

An annotation must be associated with exactly one VideoFile.

video_file

The video file associated with the annotation.

Type:

ForeignKey

label

The label for the annotation.

Type:

ForeignKey

start_time

The start time of the annotation in seconds.

Type:

float

stop_time

The stop time of the annotation in seconds.

Type:

float

is_true

Indicates if the annotation is valid (defaults to True).

Type:

bool

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_video()[source]

Get the video file associated with this annotation.

Returns the VideoFile instance.

Return type:

VideoFile

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_true

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

label: VideoSegmentationLabel

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

label_id
objects
start_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stop_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

video_file: VideoFile

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

video_file_id
class endoreg_db.models.label.VideoSegmentationLabel(*args, **kwargs)[source]

Bases: Model

Represents a label for video segmentation annotations.

name

The name of the label.

Type:

str

name_de

The German name of the label.

Type:

str

name_en

The English name of the label.

Type:

str

description

A description of the label.

Type:

str

color

The color associated with the label.

Type:

str

order_priority

The priority for ordering labels.

Type:

int

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

color

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

labelsets

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
Return type:

tuple[str]

objects
order_priority

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

videosegmentationannotation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.label.VideoSegmentationLabelSet(id, name, description)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

ai_models

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

labels: QuerySet

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects

Video

class endoreg_db.models.media.video.VideoFile(id, uuid, raw_file, processed_file, video_hash, processed_video_hash, sensitive_meta, center, processor, video_meta, examination, patient, ai_model_meta, state, import_meta, original_file_name, uploaded_at, frame_dir, fps, duration, frame_count, width, height, suffix, sequences, date, meta, date_created, date_modified)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

property active_file: File | None
property active_file_path: Path | None
ai_model_meta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

ai_model_meta_id
anonymize(delete_original_raw=True)

Anonymizes the video by censoring frames and creating a new processed video file.

Parameters:
Return type:

Path

bulk_create_frames(frames_to_create)

Bulk creates Frame objects in the database.

Parameters:
center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
create_frame_object(frame_number, image_file=None, extracted=False)

Instantiates a Frame object (does not save it).

Parameters:
Return type:

Frame

classmethod create_from_file(file_path, center=None, **kwargs)[source]
Parameters:
Return type:

VideoFile | None

date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delete_frames()

Deletes extracted frame files and associated Frame database objects.

Parameters:

video (VideoFile)

Return type:

str

delete_with_file(*args, **kwargs)

Deletes the VideoFile record and its associated physical files (raw, processed, frames).

Parameters:

video (VideoFile)

duration

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

examination_id
extract_frames(quality=2, overwrite=False, ext='jpg', verbose=False)

Extracts frames from the raw video file.

Parameters:
Return type:

List[Path]

extract_text_from_frames(frame_fraction=0.001, cap=15)

Extracts text from a sample of video frames using OCR based on processor ROIs.

Parameters:
  • video (VideoFile) – The VideoFile instance.

  • frame_fraction (float) – The fraction of total frames to process.

  • cap (int) – The maximum number of frames to process.

Returns:

A dictionary mapping ROI names to the most frequent text found, or None if prerequisites are not met.

Return type:

Dict[str, str] | None

fps

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frame_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frame_dir

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frames: models.QuerySet[Frame]

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_base_frame_dir()

Gets the base directory path for storing extracted frames.

Parameters:

video (VideoFile)

Return type:

Path

get_crop_template()

Generates a crop template [y1, y2, x1, x2] from the endo ROI.

Parameters:

video (VideoFile)

Return type:

List[int] | None

get_endo_roi()

Gets the endoscope region of interest (ROI) dictionary from the linked VideoMeta.

The ROI dictionary typically contains ‘x’, ‘y’, ‘width’, ‘height’. Returns None if VideoMeta is not linked or ROI is not properly defined.

Parameters:

video (VideoFile)

Return type:

Dict[str, int] | None

get_fps()

Gets the FPS, trying instance, VideoMeta, and finally direct file access.

Parameters:

video (VideoFile)

Return type:

float | None

get_frame(frame_number)

Gets a specific Frame object by its frame number.

Parameters:
Return type:

Frame

get_frame_dir_path()

Returns the Path object for the frame directory, if set.

Parameters:

video (VideoFile)

Return type:

Path | None

get_frame_number()

Counts the number of associated Frame objects in the database.

Parameters:

video (VideoFile)

Return type:

int

get_frame_path(frame_number)

Constructs the expected path for a given frame number.

Parameters:
Return type:

Path | None

get_frame_paths()

Gets a list of existing frame file paths from the database Frame objects.

Parameters:

video (VideoFile)

Return type:

List[Path]

get_frame_range(start_frame_number, end_frame_number)

Gets a QuerySet of Frame objects within a specific range, ordered by frame number.

Parameters:
Return type:

QuerySet[Frame]

get_frames()

Gets a QuerySet of all associated Frame objects, ordered by frame number.

Parameters:

video (VideoFile)

Return type:

QuerySet[Frame]

get_next_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)
get_next_by_date_modified(*, field=<django.db.models.fields.DateTimeField: date_modified>, is_next=True, **kwargs)
get_next_by_uploaded_at(*, field=<django.db.models.fields.DateTimeField: uploaded_at>, is_next=True, **kwargs)
get_or_create_state()[source]
Return type:

VideoState

get_outside_segments()[source]
Return type:

QuerySet

get_previous_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)
get_previous_by_date_modified(*, field=<django.db.models.fields.DateTimeField: date_modified>, is_next=False, **kwargs)
get_previous_by_uploaded_at(*, field=<django.db.models.fields.DateTimeField: uploaded_at>, is_next=False, **kwargs)
get_processed_file_path()

Returns the absolute Path object for the processed file, if it exists.

Parameters:

video (VideoFile)

Return type:

Path | None

get_raw_file_path()

Returns the absolute Path object for the raw file, if it exists.

Parameters:

video (VideoFile)

Return type:

Path | None

get_target_anonymized_video_path()

Determines the target path for the anonymized/processed video file.

Parameters:

video (VideoFile)

Return type:

Path

get_temp_anonymized_frame_dir()

Gets the path for the temporary directory used during anonymization frame creation.

Parameters:

video (VideoFile)

Return type:

Path

property has_raw: bool
height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

import_meta

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

import_meta_id
initialize_frames(paths)

Initializes Frame database objects based on extracted frame file paths.

Parameters:
initialize_video_specs(use_raw=True)

Initializes basic video specs (fps, w, h, count, duration) directly from the video file.

Parameters:
Return type:

bool

property is_processed: bool
label_video_segments: models.QuerySet[LabelVideoSegment]

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

meta

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
original_file_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examination

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

patient_id
predict_video(model_meta, dataset_name='inference_dataset', smooth_window_size_s=1, binarize_threshold=0.5, test_run=False, n_test_frames=10)

Executes the video prediction pipeline using an AI model.

Parameters:
  • video (VideoFile) – The VideoFile instance.

  • model_meta (ModelMeta) – The ModelMeta instance defining the model to use.

  • dataset_name (str) – The name of the dataset class to use.

  • smooth_window_size_s (int) – Smoothing window size in seconds.

  • binarize_threshold (float) – Threshold for converting smoothed predictions to binary.

  • test_run (bool) – If True, run prediction on a small subset of frames.

  • n_test_frames (int) – Number of frames to use if test_run is True.

Returns:

A dictionary containing the predicted sequences for each label, or None if prediction failed or prerequisites were not met.

Return type:

Dict[str, List[Tuple[int, int]]] | None

processed_file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
processed_video_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

processor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

processor_id
raw_file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

sensitive_meta

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

sensitive_meta_id
sequences

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

set_frame_dir(force_update=False)

Sets the frame_dir field based on the video’s UUID.

Parameters:
state

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

state_id
suffix

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_text_metadata(ocr_frame_fraction=0.001, cap=15, save_instance=True)

Extracts text via OCR and updates/creates SensitiveMeta.

Parameters:
update_video_meta(save_instance=True)

Updates or creates the technical VideoMeta from the raw video file.

Parameters:
uploaded_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

video_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

video_meta

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

video_meta_id
video_prediction_meta

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

video_segmentation_annotations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Frame

class endoreg_db.models.media.frame.Frame(id, video, frame_number, relative_path, timestamp, is_extracted)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymize(output_path, endo_roi=None, censor_color=(0, 0, 0), all_black=False)[source]

Anonymizes the frame image and saves it to output_path. - Applies ROI masking if endo_roi is provided. - Blacks out the entire frame if all_black is True. Returns True on success, False on failure.

Parameters:
Return type:

bool

property file_path: Path

Returns the absolute path to the frame file.

frame_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_classification_annotations()[source]
Return type:

QuerySet

get_image()[source]

Reads and returns the frame image using OpenCV.

Return type:

ndarray | None

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_classification_annotations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

is_extracted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
relative_path

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

timestamp

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

video

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

video_id

Report

class endoreg_db.models.media.pdf.AnonymExaminationReport(id, meta, text, date, time, file, center, type, patient, patient_examination, sensitive_meta)[source]

Bases: AbstractExaminationReport

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examiners

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
get_or_create_examiner(examiner_first_name, examiner_last_name)[source]
Parameters:
  • examiner_first_name (str)

  • examiner_last_name (str)

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

meta

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examination: PatientExamination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examination_id
patient_id
raw_pdf_file

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

sensitive_meta: SensitiveMeta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sensitive_meta_id
set_examination_date_and_time(report_meta=None)[source]
text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type: DocumentType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

type_id
class endoreg_db.models.media.pdf.AnonymHistologyReport(*args, **kwargs)[source]

Bases: AbstractExaminationReport

Represents a histology report.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examiners

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
get_or_create_examiner(examiner_first_name, examiner_last_name)[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

meta

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examination: PatientExamination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examination_id
patient_id
sensitive_meta: SensitiveMeta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sensitive_meta_id
text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type: DocumentType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

type_id
class endoreg_db.models.media.pdf.DocumentType(*args, **kwargs)[source]

Bases: Model

Represents the type of a document.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymexaminationreport_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
class endoreg_db.models.media.pdf.RawPdfFile(id, pdf_hash, pdf_type, center, examination, examiner, text, created_at, file, patient, sensitive_meta, state_report_processing_required, state_report_processed, raw_meta, anonym_examination_report, anonymized_text)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonym_examination_report: AnonymExaminationReport

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

anonym_examination_report_id
anonymized_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
classmethod create_from_file(file_path, center_name, save=True, delete_source=True)[source]
Parameters:

file_path (Path)

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delete_with_file()[source]
examination: PatientExamination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

examination_id
examiner: Examiner

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

examiner_id
file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_report_reader_config()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_id
pdf_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pdf_type: PdfType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

pdf_type_id
process_file(text, anonymized_text, report_meta, verbose)[source]
raw_meta

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

sensitive_meta: SensitiveMeta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sensitive_meta_id
state_report_processed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

state_report_processing_required

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

verify_existing_file(fallback_file)[source]
class endoreg_db.models.media.pdf.ReportReaderConfig(*args, **kwargs)[source]

Bases: Model

Configuration settings for parsing report reports (ReportReader).

Stores locale, name lists, date format, and flags used to identify key information lines and text sections to ignore.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

cut_off_above: models.QuerySet['ReportReaderFlag']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cut_off_below: models.QuerySet['ReportReaderFlag']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

endoscope_info_line_flag: ReportReaderFlag

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

endoscope_info_line_flag_id
examiner_info_line_flag: ReportReaderFlag

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

examiner_info_line_flag_id
first_names: models.QuerySet['FirstName']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_names: models.QuerySet['LastName']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

locale

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient_info_line_flag: ReportReaderFlag

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_info_line_flag_id
text_date_format

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_flags_by_pdf_type(pdf_type, save=True)[source]

Updates the line identification flags based on a specific PdfType.

Parameters:

pdf_type (PdfType)

update_names_by_center(center, save=True)[source]

Updates the first and last name lists based on the names associated with a Center.

Parameters:

center (Center)

class endoreg_db.models.media.pdf.ReportReaderFlag(id, name, value)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
pdf_type_cut_off_above_lines

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pdf_type_cut_off_below_lines

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pdf_type_endoscopy_info_line

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pdf_type_examiner_info_line

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pdf_type_patient_info_line

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

report_reader_configs_cut_off_above

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

report_reader_configs_cut_off_below

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

report_reader_configs_endoscope_info_line

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

report_reader_configs_examiner_info_line

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

report_reader_configs_patient_info_line

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Disease

class endoreg_db.models.medical.disease.Disease(*args, **kwargs)[source]

Bases: Model

Represents a specific disease or medical condition.

Can define associated subcategories and numerical descriptors applicable to the disease itself.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

disease_classifications: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_classifications()[source]

Retrieves all classification systems associated with this disease.

Returns:

A list of related disease classification objects.

Return type:

List[DiseaseClassification]

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

medicationindication_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key (name) as a tuple.

numerical_descriptors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patientdisease_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

subcategories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.disease.DiseaseClassification(*args, **kwargs)[source]

Bases: Model

Represents a classification system applicable to a specific disease (e.g., Forrest classification for ulcers).

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

disease: Disease

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

disease_classification_choices: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

disease_id
get_choices()[source]

Retrieves all choices within this classification system.

Returns:

A list of related disease classification choices.

Return type:

List[DiseaseClassificationChoice]

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key (name) as a tuple.

objects
class endoreg_db.models.medical.disease.DiseaseClassificationChoice(*args, **kwargs)[source]

Bases: Model

Represents a specific choice within a disease classification system (e.g., Forrest IIa).

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

disease_classification: DiseaseClassification

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

disease_classification_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

medicationindication_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key (name) as a tuple.

objects
patientdisease_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.disease.DiseaseClassificationChoiceManager(*args, **kwargs)[source]

Bases: Manager

Manager for DiseaseClassificationChoice with natural key support.

get_by_natural_key(name)[source]

Retrieve a DiseaseClassificationChoice instance by its natural key (name).

Queries for and returns the instance whose ‘name’ attribute matches the provided key.

Parameters:

name – The natural key value used to match the model’s ‘name’ field.

Returns:

The DiseaseClassificationChoice instance corresponding to the provided natural key.

class endoreg_db.models.medical.disease.DiseaseClassificationManager(*args, **kwargs)[source]

Bases: Manager

Manager for DiseaseClassification with natural key support.

get_by_natural_key(name)[source]

Retrieve a DiseaseClassification instance by its natural key (name).

Parameters:

name – A unique identifier representing the natural key of the instance.

Returns:

The DiseaseClassification instance corresponding to the given natural key.

class endoreg_db.models.medical.disease.DiseaseManager(*args, **kwargs)[source]

Bases: Manager

Manager for Disease with natural key support.

get_by_natural_key(name)[source]

Retrieve a Disease instance by its natural key (name).

Parameters:

name – The natural key value used to match the model’s ‘name’ field.

Returns:

The Disease instance corresponding to the provided natural key.

Event

class endoreg_db.models.medical.event.Event(*args, **kwargs)[source]

Bases: Model

A class representing an event.

name

The name of the event.

Type:

str

name_de

The German name of the event.

Type:

str

name_en

The English name of the event.

Type:

str

description

A description of the event.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

event_classification

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

event_classification_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

medicationindication_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key for this instance.

The natural key is defined as a tuple containing the instance’s unique name.

objects
patientevent_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.event.EventClassification(*args, **kwargs)[source]

Bases: Model

Represents a classification system for events (e.g., TNM staging for cancer).

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

event_classification_choices

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

events

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_choices()[source]

Retrieves all choices associated with this classification.

Return type:

List[EventClassificationChoice]

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key (name) as a tuple.

objects
class endoreg_db.models.medical.event.EventClassificationChoice(*args, **kwargs)[source]

Bases: Model

Represents a specific choice within an event classification system (e.g., T1, N0, M0).

Can define associated subcategories and numerical descriptors.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

event_classification

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

event_classification_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key (name) as a tuple.

numerical_descriptors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patientevent_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

subcategories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.event.EventClassificationChoiceManager(*args, **kwargs)[source]

Bases: Manager

Manager for EventClassificationChoice with natural key support.

get_by_natural_key(name)[source]

Retrieves an EventClassificationChoice instance by its natural key (name).

class endoreg_db.models.medical.event.EventClassificationManager(*args, **kwargs)[source]

Bases: Manager

Manager for EventClassification with natural key support.

get_by_natural_key(name)[source]

Retrieves an EventClassification instance by its natural key (name).

class endoreg_db.models.medical.event.EventManager(*args, **kwargs)[source]

Bases: Manager

Manager for Event with custom query methods.

get_by_natural_key(name)[source]

Retrieves an Event instance using its natural key.

This method returns the event whose name matches the provided natural key. It is primarily used to support Django’s natural key serialization during data import/export and deserialization processes.

Parameters:

name (str) – The unique event name serving as the natural key.

Returns:

The Event object corresponding to the given name.

Return type:

Event

Patient

class endoreg_db.models.medical.patient.PatientDisease(*args, **kwargs)[source]

Bases: Model

Represents a specific disease diagnosed for a patient, with optional classification and dates.

Links a patient to a disease type, optional classification choices, start/end dates, and stores associated subcategory values and numerical descriptors.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classification_choices: models.QuerySet['DiseaseClassificationChoice']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

disease: Disease

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

disease_id
end_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_last_update(*, field=<django.db.models.fields.DateTimeField: last_update>, is_next=True, **kwargs)
get_previous_by_last_update(*, field=<django.db.models.fields.DateTimeField: last_update>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_update

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerical_descriptors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_id
start_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

subcategories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.patient.PatientEvent(*args, **kwargs)[source]

Bases: Model

Represents a specific event occurrence for a patient, potentially with classification details.

Links a patient to an event type, dates, description, and optional classification choices, subcategories, and numerical descriptors.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classification_choice: EventClassificationChoice

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

classification_choice_id
date_end

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_start

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

event: Event

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

event_id
get_next_by_date_start(*, field=<django.db.models.fields.DateField: date_start>, is_next=True, **kwargs)
get_next_by_last_update(*, field=<django.db.models.fields.DateTimeField: last_update>, is_next=True, **kwargs)
get_previous_by_date_start(*, field=<django.db.models.fields.DateField: date_start>, is_next=False, **kwargs)
get_previous_by_last_update(*, field=<django.db.models.fields.DateTimeField: last_update>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_update

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerical_descriptors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_id
set_numerical_descriptors_from_classification_choice()[source]

Copies numerical descriptor definitions from the linked classification choice.

set_subcategories_from_classification_choice()[source]

Copies subcategory definitions from the linked classification choice.

subcategories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.patient.PatientExamination(id, patient, examination, video, date_start, date_end, hash)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymexaminationreport_set: models.QuerySet['AnonymExaminationReport']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set: models.QuerySet['AnonymHistologyReport']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cases

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

create_finding(finding)[source]

Adds a finding to this patient examination.

Parameters:

finding (Finding)

Return type:

PatientFinding

date_end

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_start

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination: Examination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

examination_id
generate_default_hash()[source]
get_available_findings()[source]

Returns all findings that are associated with the examination of this patient examination.

get_findings()[source]

Returns all findings that are associated with this patient examination.

Return type:

QuerySet

get_indication_choices()[source]

Returns all indication choices that are associated with this patient examination.

Return type:

List[ExaminationIndicationClassificationChoice]

get_indications()[source]

Returns all indications that are associated with this patient examination.

Return type:

QuerySet

classmethod get_or_create_pseudo_patient_examination_by_hash(patient_hash, examination_hash, examination_name=None)[source]
Parameters:
  • patient_hash (str)

  • examination_hash (str)

  • examination_name (str | None)

get_patient_age_at_examination()[source]

Returns the patient’s age at the time of the examination.

Return type:

int

hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indications: models.QuerySet['PatientExaminationIndication']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_findings: models.QuerySet['PatientFinding']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patient_id
raw_pdf_files: models.QuerySet['RawPdfFile']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

sensitivemeta_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

video: VideoFile

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

video_files

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

video_id
class endoreg_db.models.medical.patient.PatientExaminationIndication(*args, **kwargs)[source]

Bases: Model

A model to store the indication for a patient examination.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

examination_indication: ExaminationIndication

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

examination_indication_id
get_choices()[source]
get_examination()[source]
get_patient_examination()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indication_choice: ExaminationIndicationClassificationChoice

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

indication_choice_id
objects
patient_examination: PatientExamination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examination_id
class endoreg_db.models.medical.patient.PatientFinding(id, patient_examination, finding)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

add_intervention(intervention, state='pending', date=None)[source]

Adds an intervention to this patient finding.

add_location_choice(location_choice, location_classification)[source]

Adds a location choice to this patient finding location.

add_morphology_choice(morphology_choice, morphology_classification)[source]

Adds a morphology choice to this patient finding morphology.

add_video_segment(video_segment)[source]
finding: Finding

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

finding_id
get_interventions()[source]

Returns all interventions that are associated with this patient finding.

get_locations()[source]

Returns all location choices that are associated with this patient finding.

get_morphologies()[source]

Returns all morphology choices that are associated with this patient finding.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

interventions: models.QuerySet['PatientFindingIntervention']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

locations: models.QuerySet['PatientFindingLocation']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

morphologies: models.QuerySet['PatientFindingMorphology']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects
patient_examination: PatientExamination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_examination_id
set_random_location(location_classification)[source]

Sets a random location for this finding based on the location classification.

video_segments

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.patient.PatientFindingIntervention(id, finding, intervention, state, time_start, time_end, date)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

finding: PatientFinding

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

finding_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

intervention: FindingIntervention

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

intervention_id
natural_key()[source]
objects
state

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

time_end

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

time_start

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.patient.PatientFindingLocation(id, finding, location_classification, location_choice, subcategories, numerical_descriptors)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

finding

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

finding_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location_choice: FindingLocationClassificationChoice

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

location_choice_id
location_classification: FindingLocationClassification

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

location_classification_id
numerical_descriptors: dict

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

set_random_numerical_descriptor(descriptor_name)[source]

Sets a random numerical descriptor for this location.

set_random_numerical_descriptors()[source]

Sets random numerical descriptors for this location if they are required.

set_random_subcategories()[source]

Sets random subcategories for this location if they are required.

set_subcategory(subcategory_name, subcategory_value)[source]

Sets a subcategory for this location.

subcategories: dict

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.patient.PatientFindingMorphology(*args, **kwargs)[source]

Bases: Model

Represents the morphological description of a specific patient finding.

Links a PatientFinding to a specific choice within a morphology classification, and stores associated subcategory values and numerical descriptors.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

finding

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

finding_id
get_numerical_descriptors()[source]

Returns the dictionary of numerical descriptors, ensuring it’s initialized.

get_random_value_for_numerical_descriptor(descriptor_name)[source]

Generates a random value for a specified numerical descriptor based on its definition.

get_subcategories()[source]

Returns the dictionary of subcategories, ensuring it’s initialized.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

morphology_choice: FindingMorphologyClassificationChoice

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

morphology_choice_id
morphology_classification: FindingMorphologyClassification

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

morphology_classification_id
numerical_descriptors: Dict[str, Dict[str, str]]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
save(*args, **kwargs)[source]

Overrides save to validate choice and initialize subcategories/descriptors from the morphology choice if they are not already set.

set_numerical_descriptor_random(descriptor_name)[source]

Sets a random value for a specified numerical descriptor.

set_random_numerical_descriptors()[source]

Sets random values for all required numerical descriptors based on their definitions.

set_subcategory(subcategory_name, subcategory_value)[source]

Sets the value for a specific subcategory.

subcategories: Dict[str, Dict[str, str]]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.patient.PatientLabSample(*args, **kwargs)[source]

Bases: Model

Represents a specific lab sample taken from a patient at a certain date and time.

Links to the patient, sample type, and associated lab values.

patient

The patient to which the lab sample belongs.

Type:

Patient

sample_type

The type of the lab sample.

Type:

PatientLabSampleType

date

The date of the lab sample.

Type:

datetime

values

The value of the lab sample.

Type:

PatientLabValue; One2Many

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classmethod create_by_patient(patient=None, sample_type=None, date=None, save=True)[source]

Creates a new patient lab sample for a given patient.

Uses default type and current time if not provided.

Parameters:
  • patient (Patient) – The patient to which the lab sample belongs.

  • sample_type (PatientLabSampleType) – The type of the lab sample.

  • date (datetime) – The date of the lab sample.

  • save (bool) – Whether to save the instance after creation.

Returns:

The new patient lab sample.

Return type:

PatientLabSample

date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_date(*, field=<django.db.models.fields.DateTimeField: date>, is_next=True, **kwargs)
get_previous_by_date(*, field=<django.db.models.fields.DateTimeField: date>, is_next=False, **kwargs)
get_values()[source]

Returns all PatientLabValue instances associated with this sample.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_id
sample_type: PatientLabSampleType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sample_type_id
values: models.QuerySet['PatientLabValue']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.patient.PatientLabSampleType(*args, **kwargs)[source]

Bases: Model

Represents the type of a patient lab sample (e.g., Blood, Urine).

name

The name of the patient lab sample type.

Type:

str

name_de

The German name of the patient lab sample type.

Type:

str

name_en

The English name of the patient lab sample type.

Type:

str

description

A description of the patient lab sample type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod get_default_sample_type()[source]

Gets or creates the default patient lab sample type (‘default’).

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key (name) as a tuple.

objects
patientlabsample_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.patient.PatientLabValue(*args, **kwargs)[source]

Bases: Model

A class representing a patient lab value.

patient

The patient.

Type:

Patient

lab_value

The lab value.

Type:

LabValue

value

The value of the lab value.

Type:

float

date

The date of the lab value.

Type:

datetime

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classmethod create_lab_value_by_sample(sample, lab_value_name, value=None, value_str=None, unit=None)[source]
Parameters:
datetime

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_datetime(*, field=<django.db.models.fields.DateTimeField: datetime>, is_next=True, **kwargs)
get_normal_range()[source]
get_previous_by_datetime(*, field=<django.db.models.fields.DateTimeField: datetime>, is_next=False, **kwargs)
get_value()[source]
get_value_field_name()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

lab_value: LabValue

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

lab_value_id
normal_range

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_id
sample: PatientLabSample

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sample_id
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

set_max_norm_value(value, save=True)[source]
set_min_norm_value(value, save=True)[source]
set_norm_values_from_default()[source]
set_unit_from_default()[source]
set_value_by_distribution(distribution=None, save=True)[source]
unit: Unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

unit_id
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value_str

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.patient.PatientMedication(*args, **kwargs)[source]

Bases: Model

Represents a specific medication prescribed or taken by a patient.

Links a patient to a medication, its indication, dosage, intake times, and unit.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

active

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod create_by_patient_and_indication(patient, medication_indication)[source]

Creates a PatientMedication instance linking a patient and an indication.

dosage: dict | None

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

intake_times: models.QuerySet['MedicationIntakeTime']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

medication: 'Medication' | None

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

medication_id
medication_indication: 'MedicationIndication' | None

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

medication_indication_id
objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_id
patient_medication_schedules

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

unit: 'Unit' | None

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

unit_id
class endoreg_db.models.medical.patient.PatientMedicationSchedule(*args, **kwargs)[source]

Bases: Model

Represents a collection of medications associated with a patient, forming their schedule.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classmethod create_by_patient_and_indication(patient, medication_indication)[source]

Creates a schedule and adds a medication based on a specific indication.

classmethod create_by_patient_and_indication_type(patient, indication_type)[source]

Creates a schedule and adds a medication based on a random indication of a given type.

create_patient_medication_from_medication_schedule(medication_schedule, medication_indication=None, start_date=None)[source]

Creates and adds a PatientMedication based on a generic MedicationSchedule template.

Parameters:

medication_schedule (MedicationSchedule)

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_patient_medication()[source]

Returns all PatientMedication instances associated with this schedule.

get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

medication: models.QuerySet['PatientMedication']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects
patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_id
updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Finding

class endoreg_db.models.medical.finding.Finding(id, name, name_de, name_en, description, description_de, description_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

causing_finding_interventions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examinations

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

finding_interventions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

finding_patient_findings

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

finding_types

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_finding_types()[source]
get_location_classifications()[source]
get_required_morphology_classification_types()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location_classifications

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
opt_causing_finding_interventions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

optional_morphology_classification_types

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_morphology_classification_types

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.finding.FindingIntervention(id, name, name_de, name_en, description, description_de, description_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

causing_findings

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

contraindications

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

findings

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indications

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

intervention_types

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
opt_causing_findings

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patient_finding_interventions

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_lab_values

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.finding.FindingInterventionType(id, name, name_de, name_en, description, description_de, description_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

interventions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
class endoreg_db.models.medical.finding.FindingLocationClassification(id, name, name_de, name_en, description, description_de, description_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

choices

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examinations

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

finding_types

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

findings

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_available_findings()[source]
get_choices()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
patient_finding_locations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

remove_unavailable_findings(findings)[source]

Returns a list of findings that are in the input list but not available for this location classification.

class endoreg_db.models.medical.finding.FindingLocationClassificationChoice(id, name, name_de, name_en, description, description_de, description_en, subcategories, numerical_descriptors)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_numerical_descriptors()[source]
Return type:

dict

get_subcategories()[source]
Return type:

dict

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location_classifications

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
numerical_descriptors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
organs

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patient_finding_locations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

subcategories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.finding.FindingMorphologyClassification(id, name, name_de, name_en, description, classification_type)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

choices

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

classification_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

classification_type_id
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_choices()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
patient_finding_morphologies

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.finding.FindingMorphologyClassificationChoice(id, name, name_de, name_en, description, classification, subcategories, numerical_descriptors)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classification

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

classification_id
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
numerical_descriptors

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient_finding_morphologies

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

subcategories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.finding.FindingMorphologyClassificationType(id, name, name_de, name_en, description)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

findingmorphologyclassification_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

classmethod get_required_classifications_for_finding(finding)[source]

Returns all required morphology classification types for a given finding.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
optional_for_findings

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_by_findings

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.finding.FindingType(id, name, name_de, name_en, description, description_de, description_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

findings

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location_classifications

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects

Risk

class endoreg_db.models.medical.risk.Risk(*args, **kwargs)[source]

Bases: Model

A class representing a risk.

name

The name of the risk.

Type:

str

name_de

The German name of the risk.

Type:

str

name_en

The English name of the risk.

Type:

str

description

A description of the risk.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return a tuple containing the natural key of the risk instance.

The tuple consists of the unique ‘name’ attribute, which enables natural key lookups and serialization within Django.

objects
risk_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

risk_type_id
risk_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.medical.risk.RiskType(*args, **kwargs)[source]

Bases: Model

A class representing a risk type.

name

The name of the risk type.

Type:

str

name_de

The German name of the risk type.

Type:

str

name_en

The English name of the risk type.

Type:

str

description

A description of the risk type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key for this risk type.

This method returns a tuple containing only the risk type’s unique name, which is used to identify the instance naturally.

objects
risks: models.QuerySet[Risk]

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Hardware

class endoreg_db.models.medical.hardware.Endoscope(id, name, name_de, name_en, sn, center, endoscope_type)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
endoscope_type: EndoscopeType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

endoscope_type_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
sn

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

videometa_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.medical.hardware.EndoscopeType(id, name, name_de, name_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

endoscopes: QuerySet

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
Return type:

tuple[str]

objects
class endoreg_db.models.medical.hardware.EndoscopyProcessor(id, name, image_width, image_height, endoscope_image_x, endoscope_image_y, endoscope_image_width, endoscope_image_height, examination_date_x, examination_date_y, examination_date_width, examination_date_height, examination_time_x, examination_time_y, examination_time_width, examination_time_height, patient_first_name_x, patient_first_name_y, patient_first_name_width, patient_first_name_height, patient_last_name_x, patient_last_name_y, patient_last_name_width, patient_last_name_height, patient_dob_x, patient_dob_y, patient_dob_width, patient_dob_height, endoscope_type_x, endoscope_type_y, endoscope_type_width, endoscope_type_height, endoscope_sn_x, endoscope_sn_y, endoscope_sn_width, endoscope_sn_height)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

centers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

endoscope_image_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_image_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_image_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_image_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_sn_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_sn_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_sn_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_sn_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_type_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_type_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_type_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_type_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_date_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_date_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_date_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_date_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_time_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_time_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_time_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_time_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod get_by_name(name)[source]
get_roi_endoscope_image()[source]
get_roi_endoscope_type()[source]
get_roi_endoscopy_sn()[source]
get_roi_examination_date()[source]
get_roi_examination_time()[source]
get_roi_patient_dob()[source]
get_roi_patient_first_name()[source]
get_roi_patient_last_name()[source]
get_rois()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
patient_dob_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_dob_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_dob_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_dob_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_first_name_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_first_name_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_first_name_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_first_name_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_last_name_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_last_name_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_last_name_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_last_name_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

videofile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

videometa_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Laboratory

class endoreg_db.models.medical.laboratory.LabValue(id, name, name_de, name_en, abbreviation, default_unit, numeric_precision, default_single_categorical_value_distribution, default_numerical_value_distribution, default_multiple_categorical_value_distribution, default_date_value_distribution, default_normal_range, normal_range_age_dependent, normal_range_gender_dependent, normal_range_special_case)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

abbreviation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

default_date_value_distribution: DateValueDistribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

default_date_value_distribution_id
default_multiple_categorical_value_distribution: MultipleCategoricalValueDistribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

default_multiple_categorical_value_distribution_id
default_normal_range

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

default_numerical_value_distribution: NumericValueDistribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

default_numerical_value_distribution_id
default_single_categorical_value_distribution: SingleCategoricalValueDistribution

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

default_single_categorical_value_distribution_id
default_unit: Unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

default_unit_id
get_default_default_distribution()[source]

Returns the first available default distribution for the lab value.

Checks the default distribution fields in the following order: default_single_categorical_value_distribution, default_numerical_value_distribution, default_multiple_categorical_value_distribution, and default_date_value_distribution. If none are set, a warning is issued and None is returned.

get_normal_range(age=None, gender=None)[source]

Retrieve the normal range for the lab value based on optional age and gender.

This method returns the default normal range when the lab value is not age-, gender-, or special-case dependent. For gender-dependent ranges, it uses a gender-specific default range and, if no gender is provided, selects one at random with a warning. Note that age-dependent and special-case normal ranges are not implemented and will issue warnings when invoked.

Parameters:
  • age (int, optional) – The age in years used for age-dependent range computation.

  • gender (Gender, optional) – The gender instance used for gender-dependent range computation.

Returns:

A dictionary with ‘min’ and ‘max’ keys indicating the lower and upper bounds of the normal range.

Return type:

dict

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return a tuple representing the natural key for this instance.

Returns:

A single-element tuple containing the instance’s unique name.

Return type:

tuple

normal_range_age_dependent

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

normal_range_gender_dependent

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

normal_range_special_case

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numeric_precision

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patientlabvalue_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_by_finding_interventions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Organ

Module for Organ models.

class endoreg_db.models.medical.organ.Organ(*args, **kwargs)[source]

Bases: Model

Model representing an organ.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location_choices

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key for the organ.

objects
class endoreg_db.models.medical.organ.OrganManager(*args, **kwargs)[source]

Bases: Manager

Manager for Organ model.

all_names()[source]

Return a list of all organ names.

get_by_natural_key(name)[source]

Retrieve an Organ by its natural key.

Metadata

Models for storing metadata associated with other data entities.

class endoreg_db.models.metadata.FFMpegMeta(*args, **kwargs)[source]

Bases: Model

Stores technical video stream information extracted using FFmpeg (ffprobe).

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

bit_rate

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

codec_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod create_from_file(file_path)[source]

Creates an FFMpegMeta instance by running ffprobe on the given file path.

Parameters:

file_path (Path)

duration

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property fps: float | None

Calculates and returns the frames per second (FPS) if possible.

frame_rate_den

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frame_rate_num

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
pixel_format

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

raw_probe_data

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

videometa

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.metadata.ModelMeta(*args, **kwargs)[source]

Bases: Model

Represents the metadata for a specific version of an AI model. Logic for creation, querying, and configuration is in model_meta_logic.py.

exception DoesNotExist

Bases: ObjectDoesNotExist

class FileSystemStorage(*args, **kwargs)

Bases: Storage, StorageSettingsMixin

Standard filesystem storage

OS_OPEN_FLAGS
base_location
base_url
deconstruct()

Return a 3-tuple of class import path, positional arguments, and keyword arguments.

delete(name)

Delete the specified file from the storage system.

directory_permissions_mode
exists(name)

Return True if a file referenced by the given name already exists in the storage system, or False if the name is available for a new file.

file_permissions_mode
get_accessed_time(name)

Return the last accessed time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

get_alternative_name(file_root, file_ext)

Return an alternative filename, by adding an underscore and a random 7 character alphanumeric string (before the file extension, if one exists) to the filename.

get_created_time(name)

Return the creation time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

get_modified_time(name)

Return the last modified time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

is_name_available(name, max_length=None)
listdir(path)

List the contents of the specified path. Return a 2-tuple of lists: the first item being directories, the second item being files.

location
path(name)

Return a local filesystem path where the file can be retrieved using Python’s built-in open() function. Storage systems that can’t be accessed using open() should not implement this method.

size(name)

Return the total size, in bytes, of the file specified by name.

url(name)

Return an absolute URL where the file’s contents can be accessed directly by a web browser.

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

activation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

active_model

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

activemodel_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

axes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

batchsize

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod create_from_file(meta_name, model_name, labelset_name, weights_file, requested_version=None, bump_if_exists=False, **kwargs)[source]

Creates or updates a ModelMeta instance using external logic.

Parameters:
  • meta_name (str)

  • model_name (str)

  • labelset_name (str)

  • weights_file (str)

  • requested_version (str | None)

  • bump_if_exists (bool)

  • kwargs (Any)

Return type:

ModelMeta

date_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

static get_activation_function(activation_name)[source]

Retrieves a PyTorch activation function using external logic.

Parameters:

activation_name (str)

Return type:

TorchModule

classmethod get_by_name_version(meta_name, model_name, version=None)[source]

Retrieves a ModelMeta instance by name, model name, and optionally version using external logic.

Parameters:
  • meta_name (str)

  • model_name (str)

  • version (str | None)

Return type:

ModelMeta

get_config_dict()[source]

Returns the model’s configuration parameters using external logic.

Return type:

Dict[str, Any]

get_inference_dataset_config()[source]

Generates an inference dataset configuration using external logic.

Return type:

Dict[str, Any]

classmethod get_latest(meta_name, model_name)[source]

Alias for get_by_name_version(meta_name, model_name, version=None) using external logic.

Parameters:
  • meta_name (str)

  • model_name (str)

Return type:

ModelMeta

classmethod get_latest_version_number(meta_name, model_name)[source]

Gets the latest version number using external logic.

Parameters:
  • meta_name (str)

  • model_name (str)

Return type:

int

get_next_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)
get_previous_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_classification_annotations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

labelset: LabelSet

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

labelset_id
mean

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

model: AiModel

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

model_id
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key for serialization.

Return type:

Tuple[str, str]

num_workers

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
size_x

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

size_y

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

std

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

videofile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

videopredictionmeta_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

weights

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
class endoreg_db.models.metadata.PdfMeta(*args, **kwargs)[source]

Bases: Model

Stores metadata associated with a specific report document file.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classmethod create_from_file(pdf_file)[source]

Creates a PdfMeta instance from a report file object. Note: This implementation seems incomplete; it doesn’t extract hash, date, time, or type.

date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)
get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
pdf_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pdf_type: PdfType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

pdf_type_id
time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.metadata.PdfType(*args, **kwargs)[source]

Bases: Model

Defines a specific type or format of report report, linking to flags used for parsing.

Used to configure how different report report layouts are processed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

cut_off_above_lines: models.QuerySet['ReportReaderFlag']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cut_off_below_lines: models.QuerySet['ReportReaderFlag']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

classmethod default_pdf_type()[source]

Returns a default PdfType instance, typically used as a fallback.

endoscope_info_line: ReportReaderFlag

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

endoscope_info_line_id
examiner_info_line: ReportReaderFlag

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

examiner_info_line_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient_info_line: ReportReaderFlag

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_info_line_id
pdfmeta_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

rawpdffile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.metadata.SensitiveMeta(*args, **kwargs)[source]

Bases: Model

Stores potentially sensitive information extracted from media. Logic for creation, hashing, pseudo-anonymization, and saving is in sensitive_meta_logic.py.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymexaminationreport_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

anonymhistologyreport_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center: Center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
classmethod create_from_dict(data)[source]

Creates a SensitiveMeta instance from a dictionary using external logic.

Parameters:

data (Dict[str, Any])

endoscope_sn

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

endoscope_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examination_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examiner_first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examiner_last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examiners: models.QuerySet['Examiner']

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_patient_examination_hash(salt=None)[source]

Calculates the examination hash using external logic.

get_patient_hash(salt=None)[source]

Calculates the patient hash using external logic.

get_pseudo_examiner()[source]

Returns the linked pseudo examiner, if one exists.

Return type:

Examiner | None

get_pseudo_patient()[source]

Returns the linked pseudo patient, if one exists.

Return type:

Patient | None

get_pseudo_patient_examination()[source]

Returns the linked pseudo patient examination, if one exists.

Return type:

PatientExamination | None

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
patient_dob

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_gender: Gender

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

patient_gender_id
patient_hash

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pseudo_examination: PatientExamination

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

pseudo_examination_id
pseudo_patient: Patient

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

pseudo_patient_id
raw_pdf_files

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

save(*args, **kwargs)[source]

Overrides the default save method to ensure data integrity, calculate hashes, link pseudo-entities, and manage related state using external logic.

state: SensitiveMetaState

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

update_from_dict(data)[source]

Updates the instance from a dictionary using external logic.

Parameters:

data (Dict[str, Any])

video_file

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class endoreg_db.models.metadata.VideoImportMeta(*args, **kwargs)[source]

Bases: Model

Stores metadata related to the import and processing status of a video.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
outside_detected

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

outside_removed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

patient_data_removed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

video_anonymized

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

video_patient_data_detected

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

videofile

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

videometa

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class endoreg_db.models.metadata.VideoMeta(*args, **kwargs)[source]

Bases: Model

Stores technical and contextual metadata related to a video file.

Links to hardware (processor, endoscope), center, import details, and FFmpeg technical specs.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

center_id
classmethod create_from_file(video_path, center, processor=None, endoscope=None, save_instance=True)[source]

Create a new VideoMeta from a video file path, initializing FFMpegMeta.

Parameters:
Return type:

VideoMeta

property duration: float | None

Returns the duration in seconds from the linked FFMpegMeta.

endoscope

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

endoscope_id
ffmpeg_meta

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

ffmpeg_meta_id
property fps: float | None

Returns the frame rate (FPS) from the linked FFMpegMeta.

property frame_count: int | None

Calculates frame count based on duration and FPS from FFMpegMeta.

get_endo_roi()[source]

Retrieves the endoscope region of interest (ROI) from the associated processor.

property height: int | None

Returns the video height in pixels from the linked FFMpegMeta.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

import_meta

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

import_meta_id
initialize_ffmpeg_meta(video_path)[source]

Initializes FFMpeg metadata for the video file if not already done.

Parameters:

video_path (Path)

objects
processor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

processor_id
save(*args, **kwargs)[source]

Ensures VideoImportMeta exists before saving.

update_meta(video_path)[source]

Updates the FFMpeg metadata from the file, replacing existing data.

Parameters:

video_path (Path)

video_file

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

property width: int | None

Returns the video width in pixels from the linked FFMpegMeta.

class endoreg_db.models.metadata.VideoPredictionMeta(*args, **kwargs)[source]

Bases: Model

Stores metadata about predictions made by a model for a specific video.

Must be associated with exactly one VideoFile.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

apply_running_mean(confidence_array, window_size_in_seconds=None)[source]

Apply a running mean filter to the confidence array for smoothing, assuming a padding of 0.5 for the edges.

Parameters:

window_size_in_seconds (int)

calculate_prediction_array(window_size_in_seconds=None)[source]

Fetches all predictions for the associated video, labelset, and model meta, applies smoothing, and saves the resulting binary prediction array.

Parameters:

window_size_in_seconds (int)

create_video_segments(segment_length_threshold_in_s=None)[source]

Generates LabelVideoSegments based on the stored prediction array.

Parameters:

segment_length_threshold_in_s (float)

create_video_segments_for_label(segments, label)[source]

Creates LabelVideoSegment instances for the given label and segments.

Parameters:
date_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_label_list()[source]

Get the ordered list of labels from the model’s labelset.

Return type:

list[Label]

get_labelset()[source]

Get the labelset associated with the model.

Return type:

LabelSet | None

get_next_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)
get_next_by_date_modified(*, field=<django.db.models.fields.DateTimeField: date_modified>, is_next=True, **kwargs)
get_prediction_array()[source]

Get the prediction array from the database.

get_previous_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)
get_previous_by_date_modified(*, field=<django.db.models.fields.DateTimeField: date_modified>, is_next=False, **kwargs)
get_video()[source]

Returns the associated VideoFile instance.

Return type:

VideoFile

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

label_video_segments: models.Manager[LabelVideoSegment]

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

model_meta: ModelMeta

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

model_meta_id
objects
prediction_array

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

save_prediction_array(prediction_array)[source]

Save the prediction array to the database.

Parameters:

prediction_array (array)

video_file: VideoFile

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

video_file_id

Requirement

class endoreg_db.models.requirement.Requirement(*args, **kwargs)[source]

Bases: Model

A class representing a requirement.

name

The name of the requirement.

Type:

str

name_de

The German name of the requirement.

Type:

str

name_en

The English name of the requirement.

Type:

str

description

A description of the requirement.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

disease_classification_choices: models.QuerySet[DiseaseClassificationChoice]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

diseases: models.QuerySet[Disease]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

evaluate(**kwargs)[source]
events: models.QuerySet[Event]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

examination_indications: models.QuerySet[ExaminationIndication]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

examinations: models.QuerySet[Examination]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

finding_interventions: models.QuerySet[FindingIntervention]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

finding_location_classification_choices: models.QuerySet[FindingLocationClassificationChoice]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

finding_morphology_classification_choices: models.QuerySet[FindingMorphologyClassificationChoice]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

findings: models.QuerySet[Finding]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_models_dict()[source]

Returns a RequirementsModelDict with querysets of all associated models.

This method aggregates related models by invoking .all() on each many-to-many field of the requirement. The resulting RequirementsModelDict includes querysets for requirement types, operators, requirement sets, examinations, examination indications, lab values, diseases, disease classification choices, events, findings, finding morphology classification choices, finding location classification choices, and finding interventions.

Return type:

RequirementsModelDict

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

lab_values: models.QuerySet[LabValue]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return a tuple containing the natural key of the instance.

The tuple, comprised solely of the instance’s name, serves as an alternative unique identifier for serialization.

numeric_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numeric_value_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numeric_value_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
operators: models.QuerySet[RequirementOperator]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

requirement_sets: models.QuerySet[RequirementSet]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

requirement_types: models.QuerySet[RequirementType]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

string_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

string_values

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

unit_id
class endoreg_db.models.requirement.RequirementOperator(*args, **kwargs)[source]

Bases: Model

A class representing a requirement operator.

name

The name of the requirement operator.

Type:

str

name_de

The German name of the requirement operator.

Type:

str

name_en

The English name of the requirement operator.

Type:

str

description

A description of the requirement operator.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key for the requirement operator.

This method returns a tuple containing the operator’s name, which serves as its natural key for serialization and unique identification within the system.

objects
required_in

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.requirement.RequirementSet(*args, **kwargs)[source]

Bases: Model

A class representing a set of requirements.

name

The name of the requirement set.

Type:

str

name_de

The German name of the requirement set.

Type:

str

name_en

The English name of the requirement set.

Type:

str

description

A description of the requirement set.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

information_sources

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key as a tuple containing the instance’s name.

objects
requirement_set_type: RequirementSetType

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

requirement_set_type_id
requirements: models.QuerySet[Requirement]

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.requirement.RequirementSetType(*args, **kwargs)[source]

Bases: Model

A class representing a type of requirement set.

name

The name of the requirement set type.

Type:

str

name_de

The German name of the requirement set type.

Type:

str

name_en

The English name of the requirement set type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key tuple for the instance.

Returns:

A one-element tuple containing the instance’s name, used as its natural key.

Return type:

tuple

objects
requirement_sets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.requirement.RequirementType(*args, **kwargs)[source]

Bases: Model

A class representing a type of requirement.

name

The name of the requirement type.

Type:

str

name_de

The German name of the requirement type.

Type:

str

name_en

The English name of the requirement type.

Type:

str

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

linked_requirements

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Return the natural key for the instance as a tuple containing its name.

This tuple enables the use of natural key lookups for serialization and deserialization.

objects

State

class endoreg_db.models.state.LabelVideoSegmentState(*args, **kwargs)[source]

Bases: AbstractState

State for label video segment data.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

annotation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frames_extracted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
origin

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

origin_id
prediction

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.state.SensitiveMetaState(*args, **kwargs)[source]

Bases: AbstractState

State for sensitive meta data.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dob_verified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

names_verified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
origin: SensitiveMeta

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

origin_id
updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.state.VideoState(*args, **kwargs)[source]

Bases: AbstractVideoState

State for video data.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

anonymized

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frames_extracted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

frames_initialized

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

initial_prediction_completed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

lvs_annotated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

lvs_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
sensitive_data_retrieved

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

video_file: 'VideoFile' | None

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

Other

class endoreg_db.models.other.BaseValueDistribution(*args, **kwargs)[source]

Bases: Model

Abstract base class for value distributions.

class Meta[source]

Bases: object

abstract
generate_value()[source]

Generate a value based on the distribution rules. Must be implemented by subclasses.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
class endoreg_db.models.other.DateValueDistribution(*args, **kwargs)[source]

Bases: BaseValueDistribution

Assign date values based on specified distribution. Expects distribution_type (uniform, normal) and mode (date, timedelta) and based on this either date_min, date_max, date_mean, date_std_dev or timedelta_days_min, timedelta_days_max, timedelta_days_mean, timedelta_days_std_dev

DISTRIBUTION_CHOICES
exception DoesNotExist

Bases: ObjectDoesNotExist

MODE_CHOICES
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

casetemplaterule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

date_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_mean

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_std_dev

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

default_date_value_distribution

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

distribution_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

generate_value()[source]

Generate a value based on the distribution rules. Must be implemented by subclasses.

get_distribution_type_display(*, field=<django.db.models.fields.CharField: distribution_type>)
get_mode_display(*, field=<django.db.models.fields.CharField: mode>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

mode

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
timedelta_days_max

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

timedelta_days_mean

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

timedelta_days_min

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

timedelta_days_std_dev

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.other.EmissionFactor(*args, **kwargs)[source]

Bases: Model

Represents an emission factor with associated unit and value.

name

The name of the emission factor.

Type:

str

name_de

The German name of the emission factor.

Type:

str

name_en

The English name of the emission factor.

Type:

str

unit

The unit associated with the emission factor.

Type:

ForeignKey

value

The value of the emission factor.

Type:

float

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

center_resource_transport_emission_factor

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

center_resource_use_emission_factor

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

centerwaste_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_reference_products()[source]

Retrieves all reference products associated with the emission factor.

Returns:

A list of ReferenceProduct instances associated with this emission factor.

Return type:

list

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

material_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key for the emission factor.

Returns:

The natural key consisting of the name.

Return type:

tuple

objects
reference_product_package: models.QuerySet['ReferenceProduct']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

reference_product_product: models.QuerySet['ReferenceProduct']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

reference_products: models.QuerySet['ReferenceProduct']

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sources()[source]

Retrieves all sources related to the emission factor.

Returns:

A list of sources related to the emission factor.

Return type:

list

transportroute_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

unit: Unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

unit_id
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.other.Gender(*args, **kwargs)[source]

Bases: Model

A class representing gender.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

abbreviation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

examiner_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
patient_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sensitivemeta_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.other.InformationSource(id, name, name_de, name_en, url, description, date, date_created, date_modified, abbreviation)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

abbreviation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_date_created(*, field=<django.db.models.fields.DateField: date_created>, is_next=True, **kwargs)
get_next_by_date_modified(*, field=<django.db.models.fields.DateField: date_modified>, is_next=True, **kwargs)
get_previous_by_date_created(*, field=<django.db.models.fields.DateField: date_created>, is_next=False, **kwargs)
get_previous_by_date_modified(*, field=<django.db.models.fields.DateField: date_modified>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_classification_annotations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

labelvideosegment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

medicationindication_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]

Returns the natural key tuple for the information source.

The tuple contains the object’s name, which uniquely identifies it for serialization and natural key lookup.

objects
requirement_sets

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class endoreg_db.models.other.Material(id, name, name_de, name_en, emission_factor)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

emission_factor: EmissionFactor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

emission_factor_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

material_product_materials

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
class endoreg_db.models.other.MultipleCategoricalValueDistribution(*args, **kwargs)[source]

Bases: BaseValueDistribution

Multiple categorical value distribution model. Assigns a specific number or varying number of values based on probabilities.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

casetemplaterule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

categories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

count_distribution_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

count_mean

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

count_std_dev

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

default_multiple_categorical_value_distribution

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

generate_value()[source]

Generate a value based on the distribution rules. Must be implemented by subclasses.

get_count_distribution_type_display(*, field=<django.db.models.fields.CharField: count_distribution_type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

max_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

min_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
class endoreg_db.models.other.NumericValueDistribution(*args, **kwargs)[source]

Bases: BaseValueDistribution

Numeric value distribution model. Supports uniform, normal, and skewed normal distributions with hard limits.

DISTRIBUTION_CHOICES
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

casetemplaterule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

default_numerical_value_distribution

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

distribution_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

generate_value(lab_value, patient)[source]

Generate a value based on the distribution rules.

get_distribution_type_display(*, field=<django.db.models.fields.CharField: distribution_type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

max_descriptor

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

min_descriptor

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
parse_value_descriptor(value_descriptor)[source]

Parse the value descriptor string into a dict with a lambda function.

Parameters:

value_descriptor (str)

class endoreg_db.models.other.Resource(id, name, name_de, name_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

centerresource_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
class endoreg_db.models.other.SingleCategoricalValueDistribution(*args, **kwargs)[source]

Bases: BaseValueDistribution

Single categorical value distribution model. Assigns a single value based on specified probabilities.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

casetemplaterule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

categories

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

default_single_categorical_value_distribution

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

generate_value()[source]

Generate a value based on the distribution rules. Must be implemented by subclasses.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects
class endoreg_db.models.other.TransportRoute(id, distance, name, name_de, name_en, emission_factor, unit)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

distance

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

emission_factor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

emission_factor_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

unit_id
class endoreg_db.models.other.Unit(id, name, name_de, name_en, description, abbreviation)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

abbreviation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

centerresource_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

centerwaste_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

emissionfactor_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

labvalue_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

medication_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

medicationschedule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects
patientlabvalue_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

patientmedication_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

productweight_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required_in

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

transportroute_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

unit_product_materials

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class endoreg_db.models.other.Waste(id, name, name_de, name_en)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

centerwaste_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_de

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_en

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

natural_key()[source]
objects