nlpmed_portal.annotations.api.serializers module

class nlpmed_portal.annotations.api.serializers.LabelValueSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of LabelValue

fields = ['id', 'name']
class nlpmed_portal.annotations.api.serializers.LabelCategorySerializer[source]

Bases: WritableNestedModelSerializer

class Meta[source]

Bases: object

model

alias of LabelCategory

fields = ['id', 'name', 'label_values']
class nlpmed_portal.annotations.api.serializers.ProjectListSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of Project

fields = ['id', 'name', 'annotation_type', 'required_patient_annotations', 'required_patient_adjudications', 'label_categories']
read_only_fields = ['id', 'name', 'annotation_type', 'required_patient_annotations', 'required_patient_adjudications', 'label_categories']
class nlpmed_portal.annotations.api.serializers.ProjectDetailSerializer[source]

Bases: WritableNestedModelSerializer

class Meta[source]

Bases: object

model

alias of Project

fields = ['id', 'name', 'description', 'disp_range_months_before_idx', 'disp_range_months_after_idx', 'run_nlp', 'annotation_type', 'required_patient_annotations', 'required_patient_adjudications', 'label_categories', 'nlp_setting']
class nlpmed_portal.annotations.api.serializers.PatientSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of Patient

fields = '__all__'
class nlpmed_portal.annotations.api.serializers.SentenceSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of Sentence

fields = ['id', 'text', 'start_index', 'end_index', 'is_duplicate', 'is_important', 'is_expanded']
class nlpmed_portal.annotations.api.serializers.SectionSerializer[source]

Bases: WritableNestedModelSerializer

class Meta[source]

Bases: object

model

alias of Section

fields = ['id', 'text', 'start_index', 'end_index', 'note', 'section_sentences']
class nlpmed_portal.annotations.api.serializers.NoteSerializer[source]

Bases: WritableNestedModelSerializer

class Meta[source]

Bases: object

model

alias of Note

fields = ['id', 'note_id', 'note_text', 'note_date', 'note_type', 'patient', 'preprocessed_text', 'predicted_label', 'predicted_score', 'note_sections', 'important_sentences_count', 'duplicate_sentences_count']
class nlpmed_portal.annotations.api.serializers.LabSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of Lab

fields = '__all__'
class nlpmed_portal.annotations.api.serializers.PatientAnnotationListSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of PatientAnnotation

fields = ['id', 'patient', 'annotator', 'annotator_name', 'event_date', 'notes', 'comment', 'event_label_values', 'event_label_cat_values']
read_only_fields = ['id', 'patient', 'annotator', 'annotator_name', 'event_date', 'notes', 'comment', 'event_label_values', 'event_label_cat_values']
get_event_label_cat_values(obj)[source]
class nlpmed_portal.annotations.api.serializers.PatientAnnotationDetailSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of PatientAnnotation

fields = ['id', 'patient', 'annotator', 'annotator_name', 'event_date', 'notes', 'comment', 'event_label_values', 'event_label_cat_values', 'all_label_cat_values']
read_only_fields = ['id', 'annotator_name']
get_event_label_cat_values(obj)[source]
get_all_label_cat_values(obj)[source]
validate(attrs)[source]
class nlpmed_portal.annotations.api.serializers.ProjectMembershipListSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of ProjectMembership

fields = ['id', 'assignee', 'assignee_name', 'project', 'project_name', 'group', 'group_name', 'assigner', 'assigner_name', 'created_at']
read_only_fields = ['id', 'assignee', 'assignee_name', 'project', 'project_name', 'group', 'group_name', 'assigner', 'assigner_name', 'created_at']
class nlpmed_portal.annotations.api.serializers.ProjectMembershipDetailSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of ProjectMembership

fields = ['id', 'assignee', 'assignee_name', 'project', 'project_name', 'group', 'group_name', 'assigner', 'assigner_name', 'created_at', 'all_groups', 'all_users']
read_only_fields = ['id', 'assignee_name', 'project_name', 'group_name', 'assigner_name', 'created_at']
get_all_groups(obj)[source]
get_all_users(obj)[source]
class nlpmed_portal.annotations.api.serializers.TaskListSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of Task

fields = ['id', 'assignee', 'assignee_name', 'patient', 'status', 'status_name', 'assigner', 'assigner_name', 'created_at', 'task_type', 'project_name']
read_only_fields = ['id', 'assignee', 'assignee_name', 'patient', 'status', 'status_name', 'assigner', 'assigner_name', 'created_at', 'task_type', 'project_name']
class nlpmed_portal.annotations.api.serializers.TaskDetailSerializer[source]

Bases: ModelSerializer

codenames = ['add_patientannotation', 'add_nerannotation', 'add_adjudication']
class Meta[source]

Bases: object

model

alias of Task

fields = ['id', 'assignee', 'assignee_name', 'patient', 'status', 'assigner', 'assigner_name', 'created_at', 'task_type', 'all_assignees']
read_only_fields = ['id', 'assignee_name', 'assigner_name', 'created_at']
get_all_assignees(obj)[source]
class nlpmed_portal.annotations.api.serializers.BulkCreateTaskSerializer[source]

Bases: Serializer

codenames = ['add_patientannotation', 'add_nerannotation', 'add_adjudication']
validate(attrs)[source]
class nlpmed_portal.annotations.api.serializers.ImportJobSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of ImportJob

fields = '__all__'
read_only_fields = ['job_status', 'error_message', 'created_at', 'updated_at', 'job_progress', 'new_rows_count', 'user']
class nlpmed_portal.annotations.api.serializers.AdjudicationSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of Adjudication

fields = ['id', 'patient', 'event_date', 'event_label_values', 'event_label_cat_values', 'adjudicator', 'adjudicator_name', 'notes', 'source_annotations']
read_only_fields = ['id', 'adjudicator_name', 'event_label_cat_values', 'notes']
get_event_label_cat_values(obj)[source]
validate(attrs)[source]
create(validated_data)[source]

Create an adjudication and synchronize its related objects.

update(instance, validated_data)[source]

Update an adjudication and synchronize its related objects.

class nlpmed_portal.annotations.api.serializers.NERAnnotationSerializer[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

model

alias of NERAnnotation

fields = ['pk', 'patient', 'note', 'annotator', 'annotator_name', 'spans']
read_only_fields = ['pk', 'annotator_name']
validate(attrs)[source]
class nlpmed_portal.annotations.api.serializers.ExportAnnotationSerializer[source]

Bases: Serializer

validate(attrs)[source]
class nlpmed_portal.annotations.api.serializers.PatientHistoryChangeSerializer[source]

Bases: Serializer

class nlpmed_portal.annotations.api.serializers.PatientHistorySerializer[source]

Bases: Serializer