Example #1
0
class InfantSurvival(BaseInfantRegisteredSubjectModel):

    infant_survival_status = models.CharField(
        verbose_name="Survival Status of the participant at 18 months of age? ",
        choices=ALIVE_DECEASED,
        max_length=25,
        help_text="",
        )
    info_provider = models.CharField(
        verbose_name="Who provided this information? ",
        choices=INFO_PROVIDER,
        max_length=25,
        help_text="",
        )
    info_provider_other = OtherCharField(
        max_length=35,
        verbose_name="if other specify...",
        blank=True,
        null=True,
        )
    comment = OtherCharField(
        max_length=35,
        verbose_name="Comment",
        blank=True,
        null=True,
        )

    history = AuditTrail()

    infant_visit = models.OneToOneField(InfantVisit)

    entry_meta_data_manager = EntryMetaDataManager(InfantVisit)

    def __unicode__(self):
        return self.registered_subject.subject_identifier

    def get_report_datetime(self):
        return self.registered_subject.registration_datetime

    def get_consenting_subject_identifier(self):
        """Returns mother's identifier."""
        return self.registered_subject.relative_identifier

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantsurvival_change', args=(self.id,))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Survival"
Example #2
0
class InfantCnsAbnormalityItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    cns_abnormality = models.CharField(
        max_length=250,
        choices=CNS_ABNORMALITIES,
        verbose_name="Central nervous system abnormality",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    cns_abnormality_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantcnsabnormalityitems__change',
                       args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:Cns"
Example #3
0
class InfantMouthUpGastrointestinalItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    mouth_up_gastrointest = models.CharField(
        max_length=250,
        choices=MOUTH_UP_GASTROINT_DISORDER,
        verbose_name="Mouth and upper gastrointestinal disorders",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    mouth_up_gastrointest_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True)

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse(
            'admin:mpepu_infant_infantmouthupgastrointestinalitems__change',
            args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:MouthUpp"
Example #4
0
class InfantFacialDefectItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    facial_defect = models.CharField(
        max_length=250,
        choices=FACIAL_DEFECT,
        verbose_name="Facial defects",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    facial_defects_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantfacialdefectitems__change',
                       args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:Facial"
Example #5
0
class InfantCleftDisorderItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    cleft_disorder = models.CharField(
        max_length=250,
        choices=CLEFT_DISORDER,
        verbose_name="Cleft disorders",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    cleft_disorders_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantcleftdisorderitems__change',
                       args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:Cleft"
class InfantPrerandoLoss(BaseInfantRegisteredSubjectModel):

    #    report_datetime = models.DateTimeField(
    #        verbose_name='Report date/time',
    #        null=True)

    reason_loss = models.TextField(
        max_length=250,
        verbose_name=
        "Describe the reason that the infant who consented did not undergo randomization",
    )
    loss_code = models.CharField(
        verbose_name=
        "Please code the primary reason for pre- randomization loss to follow up:",
        max_length=25,
        choices=INFANT_PRE_RANDO_LOSS_REASON,
        help_text=
        "See Study Protocol for definition of 'Loss to follow up'. If \'refused\', explain in comments below",
    )
    reason_loss_other = OtherCharField(
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )
    comment = models.TextField(
        max_length=250,
        verbose_name=
        "Comments (Please provide any additional information pertinent to the response given in  question 3)",
        blank=True,
        null=True,
    )

    history = AuditTrail()

    infant_visit = models.OneToOneField(InfantVisit)

    entry_meta_data_manager = EntryMetaDataManager(InfantVisit)

    def __unicode__(self):
        return unicode(self.registered_subject)

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantprerandoloss_change',
                       args=(self.id, ))

    def get_consenting_subject_identifier(self):
        """Returns mother's identifier."""
        return self.registered_subject.relative_identifier

    def get_report_datetime(self):
        return self.created

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Pre-Rando Loss"
Example #7
0
class MaternalEnrollArv(BaseScheduledVisitModel):
    """Model for Maternal Enrollment: ARV History"""

    maternal_enroll = models.OneToOneField(MaternalEnroll)

    haart_start_date = models.DateField(
        verbose_name="Date of HAART first started",
        help_text="",
    )
    is_date_estimated = IsDateEstimatedField(
        verbose_name=("Is the subject's date of HAART estimated?"), )
    preg_on_haart = models.CharField(
        max_length=25,
        choices=YES_NO,
        verbose_name=
        "Was she still on HAART at the time she became pregnant for this pregnancy? ",
        help_text="",
    )
    haart_changes = models.IntegerField(
        verbose_name="How many times did you change your HAART medicines?",
        help_text="",
    )
    prior_preg = models.CharField(
        max_length=80,
        verbose_name="Prior to this pregnancy the mother has ",
        choices=PRIOR_PREG_HAART_STATUS,
        help_text="",
    )
    prior_arv = models.ManyToManyField(
        PriorArv,
        verbose_name=
        "Please list all of the ARVs that the mother ever received prior to the current pregnancy:",
        help_text="",
    )
    prior_arv_other = OtherCharField(
        max_length=35,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    history = AuditTrail()

    def __unicode__(self):
        return "%s" % (self.maternal_enroll)

    def get_absolute_url(self):
        return reverse('admin:mpepu_maternal_maternalenrollarv_change',
                       args=(self.id, ))

    class Meta:
        app_label = "mpepu_maternal"
        verbose_name = "Maternal Enrollment: ARV History"
Example #8
0
class MaternalLabDelMed(BaseScheduledVisitModel):
    """ Medical history collected during labor and delivery. """
    maternal_lab_del = models.OneToOneField(MaternalLabDel)

    has_health_cond = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name=
        "Has the mother been newly diagnosed (during this pregnancy) with any major chronic health condition(s) that remain ongoing?  ",
        help_text="if yes answer Question 4, otherwise go to Question 6",
    )
    health_cond = models.ManyToManyField(
        HealthCond,
        verbose_name="Select all that apply ",
        help_text="",
    )
    health_cond_other = OtherCharField()
    has_ob_comp = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name=
        "During this pregnancy, did the mother have any of the following obstetrical complications? (in 7)",
        help_text="",
    )
    ob_comp = models.ManyToManyField(
        ObComp,
        verbose_name="Select all that apply",
        help_text="",
    )
    ob_comp_other = models.TextField(
        max_length=250,
        blank=True,
        null=True,
    )

    comment = models.TextField(
        max_length=250,
        verbose_name="Comment if any additional pertinent information ",
        blank=True,
        null=True,
    )

    history = AuditTrail()

    class Meta:
        app_label = "mpepu_maternal"
        verbose_name = "Maternal Labour & Delivery: MedHistory"

    def get_absolute_url(self):
        return reverse(
            'admin:mpepu_maternal_maternallabour&deliverymedhistory_change',
            args=(self.id, ))
class InfantVerbalAutopsyItems(InfantBaseUuidModel):

    verbal_autopsy = models.ForeignKey(InfantVerbalAutopsy)

    sign_symptom = models.CharField(
        max_length=70,
        choices=AUTOPSY_SIGNS,
        verbose_name="Sign or Symptom",
        blank=True,
        null=True,
    )
    onset_date = models.DateField(
        verbose_name="Date of Onset",
        blank=True,
        null=True,
    )
    duration = OtherCharField(
        max_length=25,
        verbose_name="Duration (days/hours)",
        blank=True,
        null=True,
    )
    severity = models.CharField(
        max_length=20,
        choices=SEVERITY_LEVEL,
        verbose_name="Severity",
        blank=True,
        null=True,
    )

    def get_report_datetime(self):
        return self.verbal_autopsy.report_datetime

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantverbalautopsy_change',
                       args=(self.id, ))

    def get_consenting_subject_identifier(self):
        """Returns mother's identifier."""
        return self.verbal_autopsy.get_consenting_subject_identifier()

    def get_visit(self):
        return self.verbal_autopsy.infant_visit

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Verbal Autopsy:Item"
Example #10
0
class InfantSkinAbnormalItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    skin_abnormality = 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",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    skin_abnormality_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse(
            'admin:mpepu_infant_infantcongenitalanomaliesskin__change',
            args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:Skin"
Example #11
0
class InfantLowerGastrointestinalItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    lower_gastrointestinal = models.CharField(
        max_length=250,
        choices=LOWER_GASTROINTESTINAL_ABNORMALITY,
        verbose_name="Lower gastrointestinal abnormalities",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    lower_gastrointestinal_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse(
            'admin:mpepu_infant_infantlowergastrointestinalitems__change',
            args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:LowerGast"
Example #12
0
class InfantTrisomiesChromosomeItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    triso_chromo_abnormal = models.CharField(
        max_length=250,
        choices=TRISOME_CHROSOMESOME_ABNORMALITY,
        verbose_name="Trisomies / chromosomes abnormalities",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    triso_chromo_abnormal_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse(
            'admin:mpepu_infant_infantcongenitalanomaliestrisomes__change',
            args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:Trisomes"
Example #13
0
class InfantMusculoskeletalAbnormalItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    musculo_skeletal = models.CharField(
        max_length=250,
        choices=MUSCULOSKELETAL_ABNORMALITY,
        verbose_name="Musculo-skeletal abnomalities",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    musculo_skeletal_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse(
            'admin:mpepu_infant_infantcongenitalanomaliesmusculosk__change',
            args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:Musculosk"
Example #14
0
class InfantRenalAnomalyItems(BaseCnsItem):

    congenital_anomalies = models.ForeignKey(InfantCongenitalAnomalies)

    renal_amomalies = models.CharField(
        max_length=250,
        choices=RENAL_ANOMALY,
        verbose_name="Renal anomalies",
        blank=True,
        null=True,
    )
    abnormality_status = models.CharField(
        max_length=35,
        choices=CONFIRMED_SUSPECTED,
        verbose_name="Abnormality status",
        blank=True,
        null=True,
    )
    renal_amomalies_other = OtherCharField(
        max_length=250,
        verbose_name="if other specify...",
        blank=True,
        null=True,
    )

    def get_visit(self):
        return self.congenital_anomalies.infant_visit

    def get_absolute_url(self):
        return reverse(
            'admin:mpepu_infant_infantcongenitalanomaliesrenal__change',
            args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Congenital Anomalies:Renal"
Example #15
0
class InfantFeeding(BaseScheduledVisitModel):

    """MP012 - Infant Feeding """

    last_att_sche_visit = models.DateField(
        verbose_name="When was the last attended scheduled visit where an infant feeding form was completed? ",
        help_text="",
        blank=True,
        null=True,
        )

    other_feeding = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed, has the participant received any formula milk or other foods or liquids other than breastmilk? ",
        help_text=("If Formula Feeding or received any other foods or liquids answer YES. "
                     "If Breast Feeding answer is NO, then go to Q22"),
        )

    formula_intro_occur = models.CharField(
        max_length=3,
        choices=YES_NO_NA,
        verbose_name="Did the introduction of formula or other foods or liquids to the participant occur before the last attended scheduled visit where an infant feeding form was completed?",
        help_text="If this is the randomization visit you must enter NO, because no infant could take any formula ,foods or liquids before birth",
        default='N/A',
        )

    formula_date = models.DateField(
        verbose_name="Date participant first received formula milk (or other foods or liquids)since last attended scheduled visit where an infant feeding form was completed",
        help_text="Only put a date here if this is the first time you are reporting introduction of formula,food or other liquids, if you are not certain if a date has been previously reported come out of this form and press the audit trail at the end of the feeding form and then press search next to the subject identifier.For all visits after september 06 2011 infant feeding form data will be displayed.",
        blank=True,
        null=True,
        )
    reason_rcv_formula = models.CharField(
        verbose_name="Which of the following is the most significant reason why the participant received formula milk (if the baby had breastfed) or other foods or liquids (if the baby has been breastfed or formula fed) since the last attended scheduled visit where an infant feeding form was completed? ",
        max_length=25,
        help_text="If baby breastfed give reason why they received formula or other food/liquids, if the baby was formula feeding give reason for receiving other foods/liquids",
        choices=REASON_RCV_FORMULA,
        default='N/A',
        )
    reason_rcv_fm_other = models.TextField(
        max_length=250,
        verbose_name="If 'other' specify",
        blank=True,
        null=True,
        )
    water_used = models.CharField(
        max_length=50,
        verbose_name="What water do you usually use to prepare the participant's milk?",
        choices=WATER_USED,
        help_text="",
        default='N/A',
        )
    water_used_other = OtherCharField(
        max_length=35,
        verbose_name="If 'other', specify",
        blank=True,
        null=True,
        )
    formula = models.CharField(
        max_length=10,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Formula?",
        help_text="If formula feeding since last visit answer YES",
        default='N/A',
        )
    water = models.CharField(
        max_length=10,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Water?",
        help_text="Not as part of formula milk",
        default='N/A',
        )
    juice = models.CharField(
        max_length=10,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Juice?",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        default='N/A',
        )
    cow_milk = models.CharField(
        max_length=15,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Cow's milk?",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        default='N/A',
        )
    cow_milk_yes = models.CharField(
        verbose_name="If 'Yes', was cow's milk...",
        max_length=25,
        choices=COWS_MILK,
        help_text="",
        default='N/A',
        )
    other_milk = models.CharField(
        max_length=15,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Other animal milk?",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        default='N/A',
        )
    other_milk_animal = OtherCharField(
        max_length=35,
        verbose_name="If 'Yes' specify which animal:",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        blank=True,
        null=True,
        )
    milk_boiled = models.CharField(
        max_length=10,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Was milk boiled?",
        help_text="",
        default='N/A',
        )
    fruits_veg = models.CharField(
        max_length=10,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Fruits/vegetables",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        default='N/A',
        )
    cereal_porridge = models.CharField(
        max_length=12,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Cereal/porridge?",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        default='N/A',
        )
    solid_liquid = models.CharField(
        max_length=10,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Other solids and liquids",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        default='N/A',
        )
    rehydration_salts = models.CharField(
        max_length=3,
        choices=YES_NO_UNSURE_NA,
        verbose_name="Since the last attended scheduled visit where an infant feeding form was completed did the participant take Oral rehydaration salts",
        help_text="If you answered YES to Q3 you must answer YES, NO or NOT SURE to this question, you may not answer N/A ",
        default='N/A',
        )
    ever_breastfeed = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name="Since the last attended scheduled visit,did the infant ever breastfeed",
        help_text="",
        )
    complete_weaning = models.CharField(
        max_length=3,
        choices=YES_NO_NA,
        verbose_name="If 'NO', did complete weaning from breast milk take place before the last attended scheduled visit?",
        help_text="If formula fed from birth,answer as N/A. If YES, go to question 26. Otherwise continue.",
        default='N/A',
        )
    weaned_completely = models.CharField(
        max_length=3,
        choices=YES_NO_NA,
        verbose_name="Is the participant currently completely weaned from breast milk (at least 72 hours without breastfeeding,no intention to re-start)?",
        help_text="If formula fed from birth ,answer as N/A and go to question 26, otherwise continue",
        default='N/A',
        )
    most_recent_bm = models.DateField(
        verbose_name="Date of most recent breastfeeding ",
        help_text="",
        blank=True,
        null=True,
        )
    times_breastfed = models.CharField(
        max_length=50,
        verbose_name="Between the last attended scheduled visit where an infant feeding form was completed and date of most recent breastfeeding,how often did the participant receive breast milk for feeding?",
        choices=TIMES_BREASTFED,
        help_text="",
        default='N/A',
        )
    comments = models.TextField(
        max_length=200,
        verbose_name="List any comments about participant's feeding that are not answered above",
        blank=True,
        null=True,
        )

    history = AuditTrail()

    def __unicode__(self):
        return "%s" % (self.infant_visit)

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantfeeding_change', args=(self.id,))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Feeding"
Example #16
0
class MaternalLocator(MaternalOffStudyMixin, BaseLocator):

    maternal_visit = models.OneToOneField(MaternalVisit)

    care_clinic = OtherCharField(
        max_length=35,
        verbose_name=
        "Health clinic where your infant will receive their routine care ",
        help_text="",
    )

    has_caretaker_alt = models.CharField(
        max_length=25,
        choices=YES_NO,
        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?",
        help_text="",
    )

    caretaker_name = EncryptedCharField(
        max_length=35,
        verbose_name="Full Name of the responsible person",
        help_text="include firstname and surname",
        blank=True,
        null=True,
    )

    caretaker_cell = EncryptedCharField(
        max_length=8,
        verbose_name="Cell number",
        validators=[
            BWCellNumber,
        ],
        help_text="",
        blank=True,
        null=True,
    )

    caretaker_tel = EncryptedCharField(
        max_length=8,
        verbose_name="Telephone number",
        validators=[
            BWTelephoneNumber,
        ],
        help_text="",
        blank=True,
        null=True,
    )

    history = AuditTrail()

    entry_meta_data_manager = EntryMetaDataManager(MaternalVisit)

    def get_visit(self):
        return self.maternal_visit

    def get_subject_identifier(self):
        return self.maternal_visit.appointment.registered_subject.subject_identifier

    def get_report_datetime(self):
        return self.maternal_visit.get_report_datetime()

    def save(self, *args, **kwargs):
        if not self.registered_subject:
            self.registered_subject = self.maternal_visit.appointment.registered_subject
        super(MaternalLocator, self).save(*args, **kwargs)

    def __unicode__(self):
        return "%s" % unicode(self.maternal_visit)

    class Meta:
        verbose_name = 'Maternal Locator'
        app_label = 'mpepu_maternal'
Example #17
0
class FeedingChoiceSectionTwo(BaseScheduledVisitModel):

    status_disclosure = models.CharField(
        verbose_name="I have disclosed my HIV status to: ",
        max_length=45,
        choices=HIV_INSIDE_DISCLOSURE,
        help_text="",
    )
    disclose_hiv_father = models.CharField(
        verbose_name=
        "I have disclosed my HIV status to the father of this baby: ",
        max_length=3,
        choices=YES_NO,
        help_text="",
    )
    outside_disclosure = models.CharField(
        verbose_name="I have disclosed my HIV status to: ",
        max_length=45,
        choices=HIV_OUTSIDE_DISCLOSURE,
        help_text="",
    )
    influential_people = models.ManyToManyField(
        MaternalFeedingInfluence,
        verbose_name=(
            "The individual(s) most influential in assisting me in making an "
            "appropriate feeding choice for this baby is/are (select 3): "),
        help_text="Rank up to the three most influential persons",
    )
    influential_people_other = OtherCharField()

    work_influence = models.CharField(
        verbose_name=
        "My feeding choice will be influenced by my need to return to work: ",
        max_length=3,
        choices=YES_NO,
        help_text="",
    )
    work_return = models.CharField(
        verbose_name="If 'Yes' to Q7 above, I plan to return to work: ",
        max_length=35,
        choices=TIME_AFTER_DELIVERY,
    )

    #7.Please let us know if you agree with any of the following statements: """

    bf_hiv_worry = models.CharField(
        verbose_name=(
            "I am worried that my baby will become HIV infected if he/she "
            " breastfeeds: "),
        max_length=35,
        choices=AGREEING_TERMS,
    )
    infant_hiv_risk = models.CharField(
        verbose_name=(
            "I am worried that my infant is at risk for dying in the first two "
            " years of their life:  "),
        max_length=35,
        choices=AGREEING_TERMS,
    )
    hiv_worry = models.CharField(
        verbose_name=
        "I worry more about my baby getting HIV than about my baby dying: ",
        max_length=35,
        choices=AGREEING_TERMS,
    )
    death_worry = models.CharField(
        verbose_name=
        "I worry more about my baby dying than about my baby getting HIV:",
        max_length=35,
        choices=AGREEING_TERMS,
    )
    bf_hiv_arv = models.CharField(
        verbose_name=(
            "I feel I can breastfeed and still keep my baby from getting HIV by"
            " using antiretroviral medicines: "),
        max_length=35,
        choices=AGREEING_TERMS,
    )
    safe_ff = models.CharField(
        verbose_name="I feel I can safely prepare formula for my baby: ",
        max_length=35,
        choices=AGREEING_TERMS,
    )
    bf_ff_benefits = models.CharField(
        verbose_name=(
            "I understand the risks and benefits of breastfeeding and formula "
            "feeding for my baby:"),
        max_length=35,
        choices=AGREEING_TERMS,
    )
    baby_bf_choice = models.CharField(
        verbose_name=
        "I am the person who can make the best feeding choice for my baby: ",
        max_length=35,
        choices=AGREEING_TERMS,
    )
    doc_feeding_advice = models.CharField(
        verbose_name=
        "A nurse or a doctor should tell me the best way to feed my baby:  ",
        max_length=35,
        choices=AGREEING_TERMS,
    )

    history = AuditTrail()

    class Meta:
        app_label = 'mpepu_maternal'
        verbose_name = "Feeding Choice: Section 2"
        verbose_name_plural = "Feeding Choice: Section 2"

    def get_absolute_url(self):
        return reverse('admin:mpepu_maternal_feedingchoicesectiontwo_change',
                       args=(self.id, ))
Example #18
0
class MaternalPostFu(BaseScheduledVisitModel):
    """ General post-partum follow-up. """

    mother_weight = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name="Was the mother's weight measured at this visit?",
        help_text="(If Yes,complete 3.If No,go to question 4)",
    )
    enter_weight = models.DecimalField(
        max_digits=4,
        decimal_places=1,
        verbose_name="Enter mother's weight  ",
        help_text="kg",
        blank=True,
        null=True,
    )
    bp = models.CharField(
        max_length=7,
        verbose_name="Mother's blood pressure?",
        help_text="in mm/hg E.G. 120/80 ",
    )
    breastfeeding = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name="Has the mother breastfed since the last attended visit? ",
        help_text="(If no,skip to question 7)",
    )
    had_mastitis = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name=
        "If yes,since the last attended scheduled visit,has the mother had mastitis at any time? ",
        help_text="",
        blank=True,
        null=True,
    )

    has_chronic_cond = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name=
        "Since the last attended scheduled visit, has the mother had any of the following chronic health conditions, which were NEW diagnoses (never previously reported)?",
        help_text="",
    )

    chronic_cond = models.ManyToManyField(
        ChronicCond,
        verbose_name="Tick all that apply",
        help_text="",
    )
    chronic_cond_other = OtherCharField()

    started_ctx = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name=
        "Since the last attended scheduled visit, has the mother started CTX? ",
        help_text="",
    )

    comment = models.CharField(
        max_length=350,
        verbose_name="Comment if any additional pertinent information: ",
        blank=True,
        null=True,
    )

    history = AuditTrail()

    class Meta:
        app_label = "mpepu_maternal"
        verbose_name = "Maternal Postnatal Follow-Up"
Example #19
0
class InfantFuPhysical(BaseScheduledVisitModel):
    """Infant follow up physical assessment."""

    infant_fu = models.OneToOneField(InfantFu)

    weight = models.DecimalField(
        max_digits=6,
        decimal_places=2,
        verbose_name="Weight ",
        help_text="Measured in kg.",
    )
    height = models.DecimalField(
        max_digits=6,
        decimal_places=2,
        verbose_name="Height ",
        help_text="",
    )
    head_circumference = models.DecimalField(
        max_digits=5,
        decimal_places=2,
        verbose_name="What was the head circumference in centimeters? ",
        help_text="Measured in centimeters, (cm)",
    )
    has_abnormalities = models.CharField(
        max_length=25,
        choices=YES_NO,
        verbose_name="Abnormal findings ",
        help_text="If 'YES', continue, otherwise go to Question 8",
    )
    abnormalities = OtherCharField(
        max_length=100,
        verbose_name="Describe abnormal physical findings",
        blank=True,
        null=True,
    )
    was_hospitalized = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name=
        "Has the child been hospitalized overnight since the last scheduled visit (or since discharge after birth,if this is the randomization visit)?",
        help_text=
        " If 'Yes', the primary diagnosis(es) associated with the hospitalization(s) must be recorded in follow up diagnoses section.",
    )
    days_hospitalized = models.IntegerField(
        verbose_name=
        "If 'Yes', total number of days of hospitalization since the last scheduled visit.",
        help_text="",
        blank=True,
        null=True,
    )

    history = AuditTrail()

    def __unicode__(self):
        return unicode(self.infant_visit)

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantfuphysical_change',
                       args=(self.id, ))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant FollowUp: Physical"
        verbose_name_plural = "Infant FollowUp: Physical"
Example #20
0
class MaternalLabDel(BaseScheduledVisitModel):
    """ Maternal Labor and Delivery which triggers registration of infants.

    .. note:: This model allocates infant identifiers. Check admin.py :func:`save_model` method
              for bhp_identifier class access."""

    delivery_datetime = models.DateTimeField(
        verbose_name="Date and time of delivery :",
        help_text="If TIME unknown, estimate",
        validators=[
            datetime_not_future,
        ],
    )
    del_time_is_est = models.CharField(
        verbose_name="Is the delivery TIME estimated?",
        max_length=3,
        choices=YES_NO,
        help_text="",
    )
    labour_hrs = models.CharField(
        verbose_name=
        "How long prior to to delivery, in HRS, did labour begin? ",
        max_length=10,
        choices=LABOUR_HOURS,
        help_text=
        "For multiple births, time of delivery = time first infant born",
    )
    del_mode = models.CharField(
        verbose_name="Mode of delivery  ",
        max_length=25,
        choices=LABOUR_MODE_OF_DELIVERY,
        help_text="",
    )

    has_ga = models.CharField(
        verbose_name='Is the gestational age at delivery known?',
        max_length=10,
        choices=YES_NO,
        help_text="If known, complete below",
    )

    ga = models.IntegerField(
        verbose_name="Gestational Age at Delivery  ",
        validators=[
            MinValueValidator(20),
            MaxValueValidator(44),
        ],
        null=True,
        blank=True,
        help_text="in weeks",
    )

    del_hosp = models.CharField(
        verbose_name="Where did the participant deliver? ",
        max_length=25,
        choices=DELIVERY_HOSPITAL,
        help_text="If 'Other health facility' or 'Other', specify below",
    )
    del_hosp_other = OtherCharField()

    has_urine_tender = models.CharField(
        max_length=10,
        choices=YES_NO_UNKNOWN,
        verbose_name="Was uterine tenderness recorded? ",
        help_text="",
    )
    labr_max_temp = models.DecimalField(
        max_digits=3,
        decimal_places=1,
        verbose_name="Indicate the maximum temperature of mother during labour",
        help_text="In degrees Celcius. -1 = unknown",
        validators=[
            MinValueValidator(-1),
            MaxValueValidator(41),
        ])
    has_chorioamnionitis = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name="Was chorio-amnionitis suspected? ",
        help_text="",
    )
    has_del_comp = models.CharField(
        max_length=3,
        choices=YES_NO,
        verbose_name="Were there other complications at delivery? ",
        help_text="( if 'YES' continue. Otherwise go to question 16 )",
    )
    del_comp = models.ManyToManyField(
        DelComp,
        verbose_name="If so, select the complication ",
        help_text="",
    )
    del_comp_other = models.TextField(
        max_length=250,
        verbose_name="if other, describe the complication",
        blank=True,
        null=True,
    )

    live_infants = models.IntegerField(
        verbose_name="How many live babies did the mother deliver? ",
        help_text="",
    )

    live_infants_to_register = models.IntegerField(
        verbose_name="How many babies are registering to the study? ",
        help_text="",
    )

    still_borns = models.IntegerField(
        verbose_name="How many stillbirths did the mother deliver?  ",
        help_text="( if '>0' continue. Otherwise go to question 21 )",
    )

    still_born_has_congen_abn = models.CharField(
        max_length=3,
        choices=YES_NO_NA_SPECIFY,
        verbose_name=
        "If any stillborns, did any have a congenital abnormality noted? ",
        help_text="",
        blank=True,
        null=True,
        default="N/A",
    )

    still_born_congen_abn = OtherCharField(
        verbose_name="If yes, specify;",
        blank=True,
        null=True,
    )

    del_comment = models.TextField(
        max_length=250,
        verbose_name=
        "List any addtional information about the labour and delivery (mother only) ",
        blank=True,
        null=True,
    )

    comment = models.TextField(
        max_length=250,
        verbose_name="Comment if any additional pertinent information ",
        blank=True,
        null=True,
    )

    history = AuditTrail()

    class Meta:
        app_label = 'mpepu_maternal'
        verbose_name = "Maternal Labour & Delivery"

    def save(self, *args, **kwargs):
        # put in to trap during testing
        if self.has_ga == 'Yes':
            if self.ga < 20 or self.ga > 44:
                raise ValidationError(
                    'Attribute \'ga\' must be between >=20 and <=44 weeks or None. Got {0}'
                    .format(self.ga))
        super(MaternalLabDel, self).save(*args, **kwargs)

    def post_save_register_infants(self, created):
        """Registers infant(s) using the bhp_identifier class which allocates identifiers and creates registered_subject instances.

        Called on the post_save signal"""
        if created:
            if self.live_infants_to_register > 0:
                for infant_order in range(0, self.live_infants_to_register):
                    infant_identifier = InfantIdentifier(
                        maternal_identifier=self.maternal_visit.appointment.
                        registered_subject.subject_identifier,
                        study_site=self.maternal_visit.appointment.
                        registered_subject.study_site,
                        birth_order=infant_order,
                        live_infants=self.live_infants,
                        live_infants_to_register=self.live_infants_to_register,
                        user=self.user_created)
                    infant_identifier.get_identifier()


#     def prepare_appointments(self, using):
#         """Creates all appointments linked to this instance.
#
#         Calls :func:`pre_prepare_appointments` and :func:`post_prepare_appointments`.
#
#         .. seealso:: :class:`appointment_helper.AppointmentHelper`. """
#         self.pre_prepare_appointments(using)
#         from edc.subject.appointment_helper.classes import AppointmentHelper
#         if 'registered_subject' in dir(self):
#             registered_subject = self.registered_subject
#         else:
#             registered_subject = RegisteredSubject.objects.get(subject_identifier=self.subject_identifier)
#         AppointmentHelper().create_all(registered_subject, self.__class__.__name__.lower(), using=using, source='BaseAppointmentMixin', base_appt_datetime=self.delivery_datetime)
#         self.post_prepare_appointments(using)

    def get_absolute_url(self):
        return reverse('admin:mpepu_maternal_maternallabour&delivery_change',
                       args=(self.id, ))

    def __unicode__(self):
        return "{0} delivered on {1} ({2})".format(
            self.maternal_visit.appointment.registered_subject,
            self.delivery_datetime,
            mask_encrypted(
                self.maternal_visit.appointment.registered_subject.first_name))
Example #21
0
class InfantBirthExam(BaseScheduledVisitModel):

    """infant examiniation"""

    infant_birth = models.OneToOneField(InfantBirth)

    infant_exam_date = models.DateField(
        verbose_name="Date of infant examination",
        help_text="",
        )
    gender = models.CharField(
        max_length=15,
        choices=GENDER_UNDETERMINED,
        verbose_name="Gender? ",
        help_text="",
        )
    general_activity = models.CharField(
        max_length=15,
        choices=NORMAL_ABNORMAL,
        verbose_name="General Activity? ",
        help_text="Report general activity ON THE DAY of the exam.",
        )
    abnormal_activity = OtherCharField(
        verbose_name="If abnormal (specify)",
        blank=True,
        null=True,
        )
    physical_exam_result = models.CharField(
        max_length=15,
        choices=NORMAL_ABNORMAL_NOEXAM,
        verbose_name="What was the result of the Physical Exam? ",
        help_text="",
        )
    heent_exam = models.CharField(
        max_length=15,
        choices=YES_NO_NOT_EVALUATED_NA,
        verbose_name="Was HEENT Exam Normal? ",
        help_text="",
        default="N/A",
        )
    heent_no_other = models.TextField(
        verbose_name="If abnormal or not evaluated, specify",
        blank=True,
        null=True,
        )
    resp_exam = models.CharField(
        max_length=15,
        choices=YES_NO_NOT_EVALUATED_NA,
        verbose_name="Was Respiratory Exam Normal?",
        help_text="",
        default="N/A",
        )
    resp_exam_other = models.TextField(
        verbose_name="If abnormal or not evaluated, specify",
        blank=True,
        null=True,
        )
    cardiac_exam = models.CharField(
        max_length=15,
        choices=YES_NO_NOT_EVALUATED_NA,
        verbose_name="Was Cardiac Exam Normal?",
        help_text="",
        default="N/A",
        )
    cardiac_exam_other = models.TextField(
        verbose_name="If abnormal or not evaluated,(specify)",
        blank=True,
        null=True,
        )
    abdominal_exam = models.CharField(
        max_length=15,
        choices=YES_NO_NOT_EVALUATED_NA,
        verbose_name="Was Abdominal Exam Normal?",
        help_text="",
        default="N/A",
        )
    abdominal_exam_other = models.TextField(
        verbose_name="If abnormal or not evaluated, specify",
        blank=True,
        null=True,
        )
    skin_exam = models.CharField(
        max_length=15,
        choices=YES_NO_NOT_EVALUATED_NA,
        verbose_name="Was Skin Exam Normal?",
        help_text="",
        default="N/A",
        )
    skin_exam_other = models.TextField(
        max_length=15,
        verbose_name="If abnormal or not evaluated, specify",
        help_text="",
        blank=True,
        null=True,
        )
    macular_papular_rash = models.CharField(
        max_length=15,
        choices=YES_NO_NOT_EVALUATED_NA,
        verbose_name="Was any macular / papular rash observed?",
        help_text="",
        default="N/A",
        )
    neurologic_exam = models.CharField(
        max_length=15,
        choices=YES_NO_NOT_EVALUATED_NA,
        verbose_name="Was Neurological Exam Normal?",
        help_text="",
        default="N/A",
        )
    neuro_exam_other = models.TextField(
        verbose_name="If abnormal or not evaluated, specify",
        blank=True,
        null=True,
        )
    other_exam_info = models.TextField(
        max_length=250,
        verbose_name="Other infant exam information",
        blank=True,
        null=True,
        )

    history = AuditTrail()

    def __unicode__(self):
        return unicode(self.infant_birth)

    def get_absolute_url(self):
        return reverse('admin:mpepu_infant_infantbirthexam_change', args=(self.id,))

    class Meta:
        app_label = "mpepu_infant"
        verbose_name = "Infant Birth Record: Exam"
        verbose_name_plural = "Infant Birth Records: Exam"
Example #22
0
class MaternalEnroll(BaseScheduledVisitModel):

    """Model for Maternal enrollment (first of several).

        mp003

        this is not a registration form, just a form to collect 'other data'
        This form is initiated at the time of maternal enrollment,
        and can be completed and submitted any time before randomization
    """

    recruit_source = models.CharField(
        max_length=75,
        choices=RECRUIT_SOURCE,
        verbose_name="The mother first learned about the Mpepu study from ",
        help_text="",
        )
    recruit_source_other = OtherCharField(
        max_length=35,
        verbose_name="if other specify...",
        blank=True,
        null=True,
        )
    recruitment_clinic = models.CharField(
        max_length=100,
        verbose_name="The mother was recruited from",
        choices=RECRUIT_CLINIC,
        )
    recruitment_clinic_other = models.CharField(
        max_length=100,
        verbose_name="if other specify...",
        blank=True,
        null=True,
        )
    prev_pregnancies = models.IntegerField(
        verbose_name="Not including this pregnancy, how many previous pregnancies for this participant?",
        help_text="",
        )
    prior_health_haart = models.CharField(
        max_length=25,
        choices=YES_NO,
        verbose_name="Before this pregnancy, was the mother on HAART for her own health",
        help_text="For her own health and not just PMTCT for an earlier pregnancy or breastfeeding.",
        )
    prev_pregnancy_arv = models.CharField(
        max_length=25,
        choices=YES_NO_NA,
        verbose_name="Was the mother on any ARVs during previous pregnancies (or immediately following delivery) for PMTCT purposes (and not for her own health)? ",
        help_text="not including this pregnancy",
        )
    weight = models.DecimalField(
        max_digits=5,
        decimal_places=2,
        verbose_name="Mother's weight? ",
        help_text="Measured in Kilograms (kg)",
        )
    height = models.DecimalField(
        max_digits=5,
        decimal_places=2,
        verbose_name="Mother's height? ",
        help_text="Measured in Centimeters (cm)",
        )
    bp = models.CharField(
        max_length=7,
        verbose_name="Mother's blood pressure?",
        help_text="in mm/hg E.G. 120/80 ",
        )

    history = AuditTrail()

    def __unicode__(self):
        return "%s %s %s" % (self.maternal_visit.appointment.registered_subject, self.maternal_visit.appointment.visit_definition.code, self.maternal_visit.report_datetime)

    def get_absolute_url(self):
        return reverse('admin:mpepu_maternal_maternalenrollment_change', args=(self.id,))

    class Meta:
        app_label = "mpepu_maternal"
        verbose_name = "Maternal Enrollment"