<commit_before>"""
Models for the OPAL Walkin clinic plugin
"""
from django.db import models

from opal import models as omodels
from opal.core import lookuplists
from opal.core.fields import ForeignKeyOrFreeText

class Management_follow_up(lookuplists.LookupList):
    class Meta:
        verbose_name = "Management follow up"


class Management_clinics(lookuplists.LookupList):
    class Meta:
        verbose_name = "Management clinics"
        verbose_name_plural = "Management clinics"


class Wi_nurse_reason(lookuplists.LookupList):
    class Meta:
        verbose_name = "Walkin nurse reason"


class Findings_rash_type(lookuplists.LookupList):
    class Meta:
        verbose_name = "Findings rash type"


class Findings_rash_distribution(lookuplists.LookupList):
    class Meta:
        verbose_name = "Findings rash distribution"


class Symptom(omodels.EpisodeSubrecord):
    _title = 'Symptoms'
    _icon = 'fa fa-stethoscope'

    symptoms = models.ManyToManyField(omodels.Symptom, related_name="walkin_symptoms")
    symptom  = ForeignKeyOrFreeText(omodels.Symptom)
    duration = models.CharField(max_length=255, blank=True, null=True)
    details  = models.CharField(max_length=255, blank=True, null=True)
    onset    = models.CharField(max_length=255, blank=True, null=True)

    def set_symptom(self, *args, **kwargs):
        # ignore symptom for the time being
        pass


class ClinicalFindings(omodels.EpisodeSubrecord):
    _title        = 'Clinical Findings'
    _icon         = 'fa fa-stethoscope'

    lymphadenopathy         = models.CharField(max_length=20, blank=True, null=True)
    lymphadenopathy_details = models.CharField(max_length=255, blank=True, null=True)
    jaundice                = models.CharField(max_length=20, blank=True)
    dehydrated              = models.CharField(max_length=20, blank=True)<commit_msg>remove symptom from advanced search<commit_after>"""
Models for the OPAL Walkin clinic plugin
"""
from django.db import models

from opal import models as omodels
from opal.core import lookuplists
from opal.core.fields import ForeignKeyOrFreeText

class Management_follow_up(lookuplists.LookupList):
    class Meta:
        verbose_name = "Management follow up"


class Management_clinics(lookuplists.LookupList):
    class Meta:
        verbose_name = "Management clinics"
        verbose_name_plural = "Management clinics"


class Wi_nurse_reason(lookuplists.LookupList):
    class Meta:
        verbose_name = "Walkin nurse reason"


class Findings_rash_type(lookuplists.LookupList):
    class Meta:
        verbose_name = "Findings rash type"


class Findings_rash_distribution(lookuplists.LookupList):
    class Meta:
        verbose_name = "Findings rash distribution"


class Symptom(omodels.EpisodeSubrecord):
    _title = 'Symptoms'
    _icon = 'fa fa-stethoscope'

    symptoms = models.ManyToManyField(omodels.Symptom, related_name="walkin_symptoms")
    symptom  = ForeignKeyOrFreeText(omodels.Symptom)
    duration = models.CharField(max_length=255, blank=True, null=True)
    details  = models.CharField(max_length=255, blank=True, null=True)
    onset    = models.CharField(max_length=255, blank=True, null=True)

    @classmethod
    def _get_fieldnames_to_serialize(cls):
        field_names = super(Symptom, cls)._get_fieldnames_to_serialize()
        removed_fields = {u'symptom_fk_id', 'symptom_ft', 'symptom'}
        field_names = [i for i in field_names if i not in removed_fields]
        return field_names

    def set_symptom(self, *args, **kwargs):
        # ignore symptom for the time being
        pass


class ClinicalFindings(omodels.EpisodeSubrecord):
    _title        = 'Clinical Findings'
    _icon         = 'fa fa-stethoscope'

    lymphadenopathy         = models.CharField(max_length=20, blank=True, null=True)
    lymphadenopathy_details = models.CharField(max_length=255, blank=True, null=True)
    jaundice                = models.CharField(max_length=20, blank=True)
    dehydrated              = models.CharField(max_length=20, blank=True)
{'fraction_non_alphanumeric': 0.08481701285855589, 'fraction_numerical': 0.008902077151335312, 'mean_word_length': 3.844311377245509, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5240019', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1244, 'n_words': 276}