class MaternalSrh(MaternalCrfModel): """ A model completed by the user on the mother's use of sexual reproductive health services. """ seen_at_clinic = models.CharField(verbose_name=( 'At the last visit, you had asked to be referred to the Sexual' ' Reproductive Health Clinic. Have you been seen in that clinic' ' since your last visit with us?'), max_length=15, choices=YES_NO_DWTA) reason_unseen_clinic = models.CharField(verbose_name='If no, why not?', max_length=45, null=True, blank=True, choices=REASON_UNSEEN_AT_CLINIC) reason_unseen_clinic_other = OtherCharField( verbose_name='If Other, describe') is_contraceptive_initiated = models.CharField( verbose_name= 'If you did attend, did you initiate a contraceptive method?', max_length=15, choices=YES_NO_DWTA, null=True, blank=True, ) contr = models.ManyToManyField( Contraceptives, blank=True, verbose_name='If yes, which method did you select? ', help_text='Tell us all that apply') contr_other = OtherCharField( max_length=35, verbose_name= "If Other enter text description of other contraceptive method being used", blank=True, null=True) reason_not_initiated = models.CharField( verbose_name=( 'If you have not initiated a contraceptive method after attending' ' a SRH clinic, please share with use the reason why you have not' ' initiated a method'), max_length=45, choices=REASON_CONTRACEPTIVE_NOT_INITIATED, blank=True, null=True) reason_not_initiated_other = OtherCharField( verbose_name='If other is selected enter text', blank=True, null=True) class Meta: app_label = 'td_maternal' verbose_name = 'Maternal SRH Services' verbose_name_plural = 'Maternal SRH Services'
class RbdDemographics(BaseScheduledVisitModel): CONSENT_MODEL = SubjectConsent religion = models.ManyToManyField( Religion, verbose_name="What is your religion affiliation?", help_text="", ) religion_other = OtherCharField() ethnic = models.ManyToManyField( EthnicGroups, verbose_name="What is your ethnic group?", help_text="Ask for the original ethnic group", ) ethnic_other = OtherCharField() marital_status = models.CharField( verbose_name="What is your current marital status?", max_length=55, choices=MARITALSTATUS_CHOICE, help_text="", ) num_wives = models.IntegerField( verbose_name= "WOMEN: How many wives does your husband have (including traditional marriage)," " including yourself?", max_length=2, null=True, blank=True, help_text= "Leave blank if participant does not want to respond. (women only)", ) husband_wives = models.IntegerField( verbose_name= "MEN: How many wives do you have, including traditional marriage?", max_length=2, null=True, blank=True, help_text= "Leave blank if participant does not want to respond. (men only)", ) live_with = models.ManyToManyField( LiveWith, verbose_name="Who do you currently live with ?", help_text="[indicate all that apply]", ) history = AuditTrail() class Meta: app_label = 'bcpp_subject' verbose_name = "RBD Demographics" verbose_name_plural = "RBD Demographics"
class MaternalLabDelMed(MaternalCrfModel): """ Medical history collected during labor and delivery. """ has_health_cond = models.CharField(verbose_name=( "Has the mother been newly diagnosed (during this pregnancy) " "with any major chronic health condition(s) that remain ongoing?"), max_length=3, choices=YES_NO) # health_cond = models.ManyToManyField( # HealthCond, # verbose_name="Select all that apply ") health_cond_other = OtherCharField() has_ob_comp = models.CharField(verbose_name=( "During this pregnancy, did the mother have any of the following " "obstetrical complications?"), max_length=3, choices=YES_NO) # ob_comp = models.ManyToManyField( # ObComp, # verbose_name="Select all that apply") ob_comp_other = OtherCharField() took_supplements = models.CharField( verbose_name= "Did the mother take any of the following medications during this pregnancy?", max_length=3, choices=YES_NO) # supplements = models.ManyToManyField( # Supplements, # verbose_name="Please select relevant medications taken:", # help_text="Select all that apply") supplements_other = OtherCharField() comment = models.TextField( verbose_name="Comment if any additional pertinent information ", max_length=250, blank=True, null=True) class Meta: app_label = 'td_maternal' verbose_name = "Delivery: Medical" verbose_name_plural = "Delivery: Medical"
class Circumcised(BaseCircumcision): CONSENT_MODEL = SubjectConsent circ_date = models.DateField( verbose_name='When were you circumcised?', null=True, blank=True, ) when_circ = models.IntegerField( verbose_name="At what age were you circumcised?", max_length=2, null=True, blank=True, help_text="Note:Leave blank if participant does not want to respond.") age_unit_circ = models.CharField( verbose_name="The unit of age of circumcision is?", max_length=25, choices=TIME_UNIT_CHOICE, null=True, blank=True, help_text="", ) where_circ = models.CharField(verbose_name="Where were you circumcised?", max_length=45, choices=PLACE_CIRC, null=True, help_text="") where_circ_other = OtherCharField(null=True) why_circ = models.CharField( verbose_name="What was the main reason why you were circumcised?", max_length=55, choices=WHYCIRC_CHOICE, null=True, help_text="") why_circ_other = OtherCharField(null=True) history = AuditTrail() class Meta: app_label = 'bcpp_subject' verbose_name = "Circumcised" verbose_name_plural = "Circumcised"
class InfantMusculoskeletal(BaseCnsItem): musculo_skeletal = models.CharField( max_length=250, choices=MUSCULOSKELETAL_ABNORMALITY, verbose_name="Musculo-skeletal abnomalities", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) musculo_skeletal_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantMusculoskeletalManager() history = AuditTrail() def natural_key(self): return (self.musculo_skeletal, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies: Musculo-sk" unique_together = ('musculo_skeletal', 'congenital_anomalies')
class InfantRenal(BaseCnsItem): renal = models.CharField( max_length=250, choices=RENAL_ANOMALY, verbose_name="Renal anomalies", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) renal_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantRenalManager() history = AuditTrail() def natural_key(self): return (self.renal, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies: Renal" unique_together = ('renal', 'congenital_anomalies')
class InfantLowerGi(BaseCnsItem): lower_gi = models.CharField( max_length=250, choices=LOWER_GASTROINTESTINAL_ABNORMALITY, verbose_name="Lower gastrointestinal abnormalities", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) lower_gi_other = OtherCharField( max_length=250, verbose_name="if other specify", blank=True, null=True, ) objects = InfantLowerGiManager() history = AuditTrail() def natural_key(self): return (self.lower_gi, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies:Lower GI" unique_together = ('lower_gi', 'congenital_anomalies')
class InfantCardioDisorder(BaseCnsItem): cardio_disorder = models.CharField( max_length=250, choices=CARDIOVASCULAR_DISORDER, verbose_name="Cardiovascular disorders", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) cardiovascular_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantCardioDisorderManager() history = AuditTrail() def natural_key(self): return (self.cardio_disorder, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies:Cardio" unique_together = ('cardio_disorder', 'congenital_anomalies')
class InfantMouthUpGi(BaseCnsItem): mouth_up_gi = models.CharField( max_length=250, choices=MOUTH_UP_GASTROINT_DISORDER, verbose_name="Mouth and upper gastrointestinal disorders", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) mouth_up_gi_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True ) objects = InfantMouthUpGiManager() history = AuditTrail() def natural_key(self): return (self.mouth_up_gi, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies:MouthUp" unique_together = ('mouth_up_gi', 'congenital_anomalies')
class InfantFacialDefect(BaseCnsItem): facial_defect = models.CharField( max_length=250, choices=FACIAL_DEFECT, verbose_name="Facial defects", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) facial_defects_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantFacialDefectManager() history = AuditTrail() def natural_key(self): return (self.facial_defect, ) + self. congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies:Facial" unique_together = ('facial_defect', 'congenital_anomalies')
class InfantTrisomies(BaseCnsItem): trisomies = models.CharField( max_length=250, choices=TRISOME_CHROSOMESOME_ABNORMALITY, verbose_name="Trisomies / chromosomes abnormalities", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) trisomies_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantTrisomiesManager() history = AuditTrail() def natural_key(self): return (self.trisomies, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies: Trisomes" unique_together = ('trisomies', 'congenital_anomalies')
class InfantRespiratoryDefect(BaseCnsItem): respiratory_defect = models.CharField( max_length=250, choices=RESPIRATORY_DEFECT, verbose_name="Respiratory defects", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) respiratory_defects_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantRespiratoryDefectManager() def natural_key(self): return (self.respiratory_defect, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'td_infant' verbose_name = "Congenital Anomalies:Respiratory" unique_together = ('respiratory_defect', 'congenital_anomalies')
class InfantCleftDisorder(BaseCnsItem): cleft_disorder = models.CharField( max_length=250, choices=CLEFT_DISORDER, verbose_name="Cleft disorders", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) cleft_disorders_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantCleftDisorderManager() def natural_key(self): return (self.cleft_disorder, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'td_infant' verbose_name = "Congenital Anomalies:Cleft" unique_together = ('cleft_disorder', 'congenital_anomalies')
class MaternalLocator(LocatorMixin, ExportTrackingFieldsMixin, BaseUuidModel): """ A model completed by the user to capture locator information and the details of the infant caretaker. """ registered_subject = models.OneToOneField(RegisteredSubject, null=True) # appointment = models.ForeignKey(Appointment, null=True) report_datetime = models.DateTimeField( verbose_name="Report Date", validators=[ datetime_not_before_study_start, datetime_not_future, ], default=timezone.now, help_text=('If reporting today, use today\'s date/time, otherwise use ' 'the date/time this information was reported.')) care_clinic = OtherCharField( verbose_name= "Health clinic where your infant will receive their routine care ", max_length=35, ) has_caretaker = models.CharField(verbose_name=( "Has the participant identified someone who will be " "responsible for the care of the baby in case of her death, to whom the " "study team could share information about her baby's health?"), max_length=25, choices=YES_NO, help_text="") caretaker_name = EncryptedCharField( verbose_name="Full Name of the responsible person", max_length=35, help_text="include firstname and surname", blank=True, null=True) caretaker_cell = EncryptedCharField(verbose_name="Cell number", max_length=8, validators=[ CellNumber, ], blank=True, null=True) caretaker_tel = EncryptedCharField(verbose_name="Telephone number", max_length=8, validators=[ TelephoneNumber, ], blank=True, null=True) entry_meta_data_manager = LocalCrfMetaDataManager(MaternalVisit) class Meta: app_label = 'td_maternal' verbose_name = 'Maternal Locator' verbose_name_plural = 'Maternal Locator'
class Tubercolosis(BaseScheduledVisitModel): """A model completed by the user to record any diagnosis of Tuberculosis in the past 12 months.""" CONSENT_MODEL = SubjectConsent date_tb = models.DateField( verbose_name="Date of the diagnosis of tuberculosis:", validators=[date_not_future], help_text="", ) dx_tb = models.CharField( verbose_name= "[Interviewer:]What is the tuberculosis diagnosis as recorded?", max_length=50, choices=DXTB_CHOICE, help_text="", ) dx_tb_other = OtherCharField(null=True, ) history = AuditTrail() class Meta: app_label = 'bcpp_subject' verbose_name = "Tubercolosis" verbose_name_plural = "Tubercolosis"
class InfantCns(BaseCnsItem): cns = models.CharField( max_length=250, choices=CNS_ABNORMALITIES, verbose_name="Central nervous system abnormality", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) cns_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantCnsManager() history = AuditTrail() def natural_key(self): return (self.cns, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies:Cns" unique_together = ('cns', 'congenital_anomalies')
class InfantMaleGenital(BaseCnsItem): male_genital = models.CharField( max_length=250, choices=MALE_GENITAL_ANOMALY, verbose_name="Male genital anomaly", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) male_genital_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantMaleGenitalManager() def natural_key(self): return (self.male_genital, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'td_infant' verbose_name = "Congenital Anomalies:Male Gen" unique_together = ('male_genital', 'congenital_anomalies')
class InfantOtherAbnormalityItems(BaseCnsItem): other_abnormalities = models.CharField( max_length=250, choices=OTHER_DEFECT, verbose_name="Other", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) other_abnormalities_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantOtherAbnormalityItemsManager() history = AuditTrail() def natural_key(self): return (self.other_abnormalities, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies: Other" unique_together = ('other_abnormalities', 'congenital_anomalies')
class ClinicRefusal(BaseSyncUuidModel): "A model completed by the user for eligible participants who decide not to participate." "" household_member = models.OneToOneField(HouseholdMember, null=True) refusal_date = models.DateField( verbose_name="Date subject refused participation", validators=[date_not_before_study_start, date_not_future], help_text="Date format is YYYY-MM-DD") community = models.CharField(max_length=25, editable=False) reason = models.CharField( verbose_name="We respect your decision to decline. It would help us" " improve the study if you could tell us the main reason" " you do not want to participate in this study?", max_length=50, choices=(('dont_want', 'I don\'t want to take part'), ('not_sure', 'I am not sure'), ('dont_want_blood_draw', 'I don\'t want to have blood drawn'), ('needles_phobia', 'Fear of needles'), ('privacy', 'I am afraid my information will not be private'), ('illiterate no witness', 'Illiterate does not want a witness'), ('on_haart', 'Already on HAART'), ('knows_status', 'I already know my status'), ('OTHER', 'Other, specify')), help_text="") reason_other = OtherCharField() comment = models.CharField( verbose_name="Comment", max_length=250, null=True, blank=True, help_text= 'IMPORTANT: Do not include any names or other personally identifying ' 'information in this comment') history = AuditTrail() objects = BaseClinicHouseholdMemberManager() def __unicode__(self): return "for participant" def natural_key(self): return self.household_member.natural_key() natural_key.dependencies = [ 'bcpp_household_member.householdmember', ] def save(self, *args, **kwargs): self.community = site_mappers.get_current_mapper().map_area super(ClinicRefusal, self).save(*args, **kwargs) class Meta: app_label = "bcpp_clinic" verbose_name = 'Clinic Refusal'
class InfantSkin(BaseCnsItem): skin = models.CharField( max_length=250, choices=SKIN_ABNORMALITY, verbose_name="Skin abnormalities", help_text="Excludes cafe au lait spots, Mongolian spots, port wine stains, " "nevus, hemangloma <4 cm in diameter. If hemangloma is >4 cm, specify", ) abnormality_status = models.CharField( max_length=35, choices=CONFIRMED_SUSPECTED, verbose_name="Abnormality status", ) skin_other = OtherCharField( max_length=250, verbose_name="if other specify...", blank=True, null=True, ) objects = InfantSkinManager() history = AuditTrail() def natural_key(self): return (self.skin, ) + self.congenital_anomalies.natural_key() class Meta: app_label = 'mb_infant' verbose_name = "Congenital Anomalies: Skin" unique_together = ('skin', 'congenital_anomalies')
class InfantRequisition(CrfModelMixin, SyncModelMixin, RequisitionModelMixin, ExportTrackingFieldsMixin, BaseUuidModel): aliquot_model = Aliquot infant_visit = models.ForeignKey(InfantVisit) packing_list = models.ForeignKey(PackingList, null=True, blank=True) aliquot_type = models.ForeignKey(AliquotType) panel = models.ForeignKey(Panel) reason_not_drawn_other = OtherCharField( max_length=35, verbose_name="if (other) specify...", blank=True, null=True) objects = InfantRequisitionManager() history = SyncHistoricalRecords() entry_meta_data_manager = RequisitionMetaDataManager(InfantVisit) def get_visit(self): return self.infant_visit class Meta: app_label = 'td_lab' verbose_name = 'Infant Laboratory Requisition' verbose_name_plural = 'Infant Laboratory Requisition' unique_together = ('infant_visit', 'panel', 'is_drawn')
class VaccinesMissed(CrfInlineModelMixin, ExportTrackingFieldsMixin, SyncModelMixin, BaseUuidModel): """ALL vaccines missed by infant""" parent_model_attr = 'infant_fu_immunizations' infant_fu_immunizations = models.ForeignKey(InfantFuImmunizations) missed_vaccine_name = models.CharField(verbose_name="Missed vaccine name", choices=IMMUNIZATIONS, max_length=100) reason_missed = models.CharField( verbose_name="Reasons infant missed vaccines", choices=REASONS_VACCINES_MISSED, max_length=100, null=True, blank=True) reason_missed_other = OtherCharField() objects = VaccinesMissedManager() history = AuditTrail() def natural_key(self): return (self.missed_vaccine_name, ) + self.infant_fu_immunizations.natural_key() class Meta: app_label = 'mb_infant' verbose_name = 'Missed Vaccines' verbose_name_plural = 'Missed Vaccines' unique_together = ('missed_vaccine_name', 'infant_fu_immunizations')
class HeartAttack(BaseScheduledVisitModel): """A model completed by the user to record any heart conditions in the past 12 months.""" CONSENT_MODEL = SubjectConsent date_heart_attack = models.DateField( verbose_name="Date of the heart disease or stroke diagnosis:", validators=[date_not_future], help_text="", ) dx_heart_attack = models.ManyToManyField( HeartDisease, verbose_name= "[Interviewer:] What is the heart disease or stroke diagnosis as recorded?", help_text=("(tick all that apply)"), ) dx_heart_attack_other = OtherCharField() history = AuditTrail() class Meta: app_label = 'bcpp_subject' verbose_name = "Heart Attack or Stroke" verbose_name_plural = "Heart Attack or Stroke"
class Pima(BaseScheduledVisitModel): CONSENT_MODEL = SubjectConsent pima_today = models.CharField( verbose_name="Was a PIMA CD4 done today?", choices=YES_NO, max_length=3, help_text="", ) pima_today_other = models.CharField( verbose_name="If no PIMA CD4 today, please explain why", max_length=50, choices=PIMA, null=True, blank=True, ) pima_today_other_other = OtherCharField() pima_id = models.CharField( verbose_name="PIMA CD4 machine ID?", max_length=9, validators=[ RegexValidator(regex='\d+', message='PIMA ID must be a two digit number.') ], null=True, blank=True, help_text="type this id directly from the machine as labeled") cd4_datetime = models.DateTimeField( verbose_name="PIMA CD4 Date and time", validators=[datetime_not_future], null=True, blank=True, ) cd4_value = models.DecimalField( verbose_name="PIMA CD4 count", null=True, blank=True, max_digits=6, decimal_places=2, validators=[MinValueValidator(0), MaxValueValidator(3000)], help_text="", ) history = AuditTrail() class Meta: app_label = 'bcpp_subject' verbose_name = "PIMA CD4 count" verbose_name_plural = "PIMA CD4 count"
class Uncircumcised(BaseCircumcision): CONSENT_MODEL = SubjectConsent reason_circ = models.CharField( verbose_name= "What is the main reason that you have not yet been circumcised?", max_length=65, null=True, choices=REASONCIRC_CHOICE, help_text="", ) reason_circ_other = OtherCharField(null=True, ) future_circ = models.CharField( verbose_name="Would you ever consider being circumcised in the future?", max_length=25, choices=YES_NO_UNSURE, help_text="", ) future_reasons_smc = models.CharField( verbose_name="Which of the following might increase your willingness to" " be circumcised the most?", max_length=75, choices=FUTUREREASONSSMC_CHOICE, null=True, help_text="", ) service_facilities = models.CharField( verbose_name="Were you aware that circumcision services are provided " "free of charge at most health facilities?", max_length=35, choices=YES_NO_DWTA, null=True, help_text="", ) aware_free = models.CharField( verbose_name="Where did you learn that circumcision services were " "available free at most health facilities?", max_length=85, null=True, blank=True, choices=AWAREFREE_CHOICE, help_text="", ) history = AuditTrail() class Meta: app_label = 'bcpp_subject' verbose_name = "Uncircumcised" verbose_name_plural = "Uncircumcised"
class BaseSubjectEntry(BaseDispatchSyncUuidModel, BaseSyncUuidModel): """For absentee and undecided log models.""" report_datetime = models.DateField( verbose_name="Report date", validators=[date_not_before_study_start, date_not_future]) reason_other = OtherCharField() next_appt_datetime = models.DateTimeField( verbose_name="Follow-up appointment", help_text="The date and time to meet with the subject") next_appt_datetime_source = models.CharField( verbose_name="Appointment date suggested by?", max_length=25, choices=NEXT_APPOINTMENT_SOURCE, help_text='') contact_details = EncryptedCharField( null=True, blank=True, help_text='Information that can be used to contact someone, ' 'preferrably the subject, to confirm the appointment') comment = EncryptedTextField( verbose_name="Comments", max_length=250, blank=True, null=True, help_text= ('IMPORTANT: Do not include any names or other personally identifying ' 'information in this comment')) @property def in_replaced_household(self): """Returns True if the household for this entry is "replaced""" "" return self.inline_parent.household_member.household_structure.household.replaced_by def dispatch_container_lookup(self): field = None for fld in self._meta.fields: if fld.rel: if issubclass(fld.rel.to, BaseMemberStatusModel): field = fld break if not field: raise TypeError( 'Method \'dispatch_container_lookup\' cannot find the "inline\'s" ' 'related field for class {0}'.format(self.__class__)) return (Plot, ('{0}__household_member__household_structure__household__' 'plot__plot_identifier').format(field.name)) class Meta: abstract = True
class MaternalLocator(LocatorMixin, MaternalCrfModel): """ A model completed by the user to capture locator information and the details of the infant caretaker. """ registered_subject = models.OneToOneField(RegisteredSubject, null=True) care_clinic = OtherCharField( verbose_name="Health clinic where your infant will receive their routine care ", max_length=35, ) has_caretaker = models.CharField( verbose_name=( "Has the participant identified someone who will be " "responsible for the care of the baby in case of her death, to whom the " "study team could share information about her baby's health?"), max_length=25, choices=YES_NO, help_text="") caretaker_name = EncryptedCharField( verbose_name="Full Name of the responsible person", max_length=35, help_text="include firstname and surname", blank=True, null=True) caretaker_cell = EncryptedCharField( verbose_name="Cell number", max_length=8, validators=[CellNumber, ], blank=True, null=True) caretaker_tel = EncryptedCharField( verbose_name="Telephone number", max_length=8, validators=[TelephoneNumber, ], blank=True, null=True) history = AuditTrail() class Meta: app_label = 'mb_maternal' verbose_name = 'Maternal Locator' verbose_name_plural = 'Maternal Locator'
class CommunityEngagement(BaseScheduledVisitModel): """A model completed by the user on the participant's engagement in the community.""" CONSENT_MODEL = SubjectConsent community_engagement = models.CharField( verbose_name="How active are you in community activities such as" " burial society, Motshelo, Syndicate, PTA, " "VDC(Village Developement Committee), Mophato" " and development of the community that surrounds you??", max_length=25, null=True, choices=COMMUNITYENGAGEMENT_CHOICE, help_text="") vote_engagement = models.CharField( verbose_name="Did you vote in the last local government election?", max_length=50, null=True, choices=VOTEENGAGEMENT_CHOICE, help_text="") problems_engagement = models.ManyToManyField( NeighbourhoodProblems, verbose_name="What are the major problems in this neighbourhood??", null=True, help_text= ("Note:Interviewer to read question but NOT the responses. Check the boxes of" " any of problems mentioned.")) problems_engagement_other = OtherCharField(null=True, ) solve_engagement = models.CharField( verbose_name="If there is a problem in this neighbourhood, do the" " adults work together in solving it?", max_length=25, null=True, choices=SOLVEENGAGEMENT_CHOICE, help_text="") history = AuditTrail() class Meta: app_label = 'bcpp_subject' verbose_name = "Community Engagement" verbose_name_plural = "Community Engagement"
class MaternalPostFuMedItems(CrfInlineModelMixin, SyncModelMixin, BaseUuidModel): maternal_post_fu_med = models.ForeignKey(MaternalPostFuMed) date_first_medication = models.DateField( verbose_name="Date of first medication use", ) medication = models.CharField( max_length=100, choices=MEDICATIONS, verbose_name="Medication", ) medication_other = OtherCharField( max_length=35, verbose_name="if other medication, specify...", blank=True, null=True) drug_route = models.CharField( max_length=20, choices=DRUG_ROUTE, verbose_name="Drug route", ) date_stoped = models.DateField( verbose_name="Date medication was stopped", blank=True, null=True, ) objects = MaternalPostMedItemsManager() history = AuditTrail() def natural_key(self): return (self.medication, self.date_first_medication, self.date_stoped) + self.maternal_post_fu_med.natural_key() class Meta: app_label = 'mb_maternal' verbose_name = "Maternal Postnatal: Med Item" unique_together = ('maternal_post_fu_med', 'medication', 'date_first_medication', 'date_stoped')
class MaternalMedicalHistory(MaternalCrfModel): """ A model completed by the user on Medical History for all mothers. """ consent_model = MaternalConsent chronic_since = models.CharField( max_length=25, choices=YES_NO, verbose_name= ("Does the mother have any significant chronic condition(s) that were" " diagnosed prior to the current pregnancy and that remain ongoing?"), ) chronic = models.ManyToManyField( ChronicConditions, verbose_name="Chronic Diagnosis. Tick all that apply", help_text="") chronic_other = OtherCharField(max_length=35, verbose_name="if other specify...", blank=True, null=True) who_diagnosis = models.CharField( max_length=25, choices=YES_NO_NA, verbose_name= ("Prior to the current pregnancy, was the participant ever diagnosed with" " a WHO Stage III or IV illness?"), help_text= "Please use the WHO Staging Guidelines. ONLY for HIV infected mothers") who = models.ManyToManyField( WcsDxAdult, verbose_name= "List any new WHO Stage III/IV diagnoses that are not reported") history = AuditTrail() class Meta: app_label = 'mb_maternal' verbose_name = "Maternal Medical History" verbose_name_plural = "Maternal Medical History"