class Antimicrobial(EpisodeSubrecord): _sort = 'start_date' _icon = 'fa fa-flask' drug = ForeignKeyOrFreeText(lookuplists.DrugLookupList) dose = models.CharField(max_length=255, blank=True) route = ForeignKeyOrFreeText(lookuplists.DrugRouteLookupList) start_date = models.DateField(null=True, blank=True) end_date = models.DateField(null=True, blank=True) frequency = ForeignKeyOrFreeText(lookuplists.DrugFrequencyLookupList) class Meta: abstract = True
class Treatment(Subrecord): _title = 'Diagnosis / Treatment' condition = ForeignKeyOrFreeText(option_models['condition']) # AML details = models.CharField(max_length=255, blank=True) # M6 t(11,19) provisional = models.BooleanField() date_of_diagnosis = models.DateField(blank=True, null=True) drug = ForeignKeyOrFreeText(option_models['drug']) dose = models.CharField(max_length=255, blank=True) route = ForeignKeyOrFreeText(option_models['drug_route']) start_date = models.DateField(null=True, blank=True) end_date = models.DateField(null=True, blank=True)
class Problem(Subrecord): _title = 'Problems' condition = ForeignKeyOrFreeText(option_models['condition']) provisional = models.BooleanField() details = models.CharField(max_length=255, blank=True) date_of_diagnosis = models.DateField(blank=True, null=True)
class ReportedInfection(EpisodeSubrecord): """ Some human notes explaining what this is! """ suspected = models.NullBooleanField(blank=True, null=True) infection = ForeignKeyOrFreeText(option_models['condition']) date_reported = models.DateField(blank=True, null=True)
class PastMedicalHistory(EpisodeSubrecord): _title = 'PMH' _sort = 'year' condition = ForeignKeyOrFreeText(option_models['condition']) year = models.CharField(max_length=4, blank=True) details = models.CharField(max_length=255, blank=True)
class Allergies(PatientSubrecord): _icon = 'fa fa-warning' drug = ForeignKeyOrFreeText(lookuplists.DrugLookupList) provisional = models.BooleanField() details = models.CharField(max_length=255, blank=True) class Meta: abstract = True
class PastMedicalHistory(EpisodeSubrecord): _title = 'PMH' _sort = 'year' _icon = 'fa fa-history' condition = ForeignKeyOrFreeText(lookuplists.ConditionLookupList) year = models.CharField(max_length=4, blank=True) details = models.CharField(max_length=255, blank=True) class Meta: abstract = True
class Demographics(PatientSubrecord): _is_singleton = True name = models.CharField(max_length=255, blank=True) hospital_number = models.CharField(max_length=255, blank=True) nhs_number = models.CharField(max_length=255, blank=True, null=True) date_of_birth = models.DateField(null=True, blank=True) country_of_birth = ForeignKeyOrFreeText(lookuplists.DestinationLookupList) ethnicity = models.CharField(max_length=255, blank=True, null=True) gender = models.CharField(max_length=255, blank=True, null=True) class Meta: abstract = True
class Diagnosis(EpisodeSubrecord): _title = 'Active Diagnosis' _sort = 'date_of_diagnosis' condition = ForeignKeyOrFreeText(option_models['condition']) provisional = models.BooleanField(default=False) details = models.CharField(max_length=255, blank=True) date_of_diagnosis = models.DateField(blank=True, null=True) def __unicode__(self): return u'Diagnosis for {0}: {1} - {2}'.format( self.episode.patient.demographics_set.get().name, self.condition, self.date_of_diagnosis)
class Demographics(PatientSubrecord): _is_singleton = True name = models.CharField(max_length=255, blank=True) hospital_number = models.CharField(max_length=255, blank=True) nhs_number = models.CharField(max_length=255, blank=True, null=True) date_of_birth = models.DateField(null=True, blank=True) country_of_birth = ForeignKeyOrFreeText(option_models['destination']) ethnicity = models.CharField(max_length=255, blank=True, null=True) gender = models.CharField(max_length=255, blank=True, null=True) def age(self): import datetime return int((datetime.date.today() - self.date_of_birth).days / 365.25)
class RRT(EpisodeSubrecord): _is_singleton = True _title = 'RRT' haemodialysis = models.BooleanField(default=False) access_site = ForeignKeyOrFreeText(AccessSiteLookupList) day_mon = models.BooleanField(default=False) day_tue = models.BooleanField(default=False) day_wed = models.BooleanField(default=False) day_thu = models.BooleanField(default=False) day_fri = models.BooleanField(default=False) day_sat = models.BooleanField(default=False) day_sun = models.BooleanField(default=False) regional_unit = models.CharField(max_length=200, blank=True, null=True) peritonealdialysis = models.BooleanField(default=False) no_rrt = models.BooleanField(default=False) transplant = models.BooleanField(default=False) donor_type = models.CharField(max_length=200, blank=True, null=True)
class Diagnosis(EpisodeSubrecord): """ This is a working-diagnosis list, will often contain things that are not technically diagnoses, but is for historical reasons, called diagnosis. """ _title = 'Diagnosis / Issues' _sort = 'date_of_diagnosis' _icon = 'fa fa-stethoscope' condition = ForeignKeyOrFreeText(lookuplists.ConditionLookupList) provisional = models.BooleanField() details = models.CharField(max_length=255, blank=True) date_of_diagnosis = models.DateField(blank=True, null=True) class Meta: abstract = True def __unicode__(self): return u'Diagnosis for {0}: {1} - {2}'.format( self.episode.patient.demographics_set.get().name, self.condition, self.date_of_diagnosis)
class PresentingComplaint(EpisodeSubrecord): _title = 'Presenting Complaint' symptom = ForeignKeyOrFreeText(option_models['symptom']) duration = ForeignKeyOrFreeText(option_models['duration']) details = models.CharField(max_length=255, blank=True)
class Allergies(PatientSubrecord): drug = ForeignKeyOrFreeText(option_models['antimicrobial']) details = models.CharField(max_length=255, blank=True)