Beispiel #1
0
    def setUp(self):
        super(TestInfantBirthData, self).setUp()
        self.maternal_eligibility = MaternalEligibilityFactory()
        self.maternal_consent = MaternalConsentFactory(
            maternal_eligibility=self.maternal_eligibility)
        self.registered_subject = self.maternal_eligibility.registered_subject

        self.assertEqual(RegisteredSubject.objects.all().count(), 1)
        options = {'registered_subject': self.registered_subject,
                   'current_hiv_status': POS,
                   'evidence_hiv_status': YES,
                   'will_get_arvs': YES,
                   'is_diabetic': NO,
                   'will_remain_onstudy': YES,
                   'rapid_test_done': NOT_APPLICABLE,
                   'last_period_date': (timezone.datetime.now() - relativedelta(weeks=25)).date()}

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.assertTrue(self.antenatal_enrollment.is_eligible)
        self.maternal_visit = MaternalVisit.objects.get(
            appointment__registered_subject=self.registered_subject,
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit, number_of_gestations=1,)
        self.maternal_visits_membership = AntenatalVisitMembershipFactory(registered_subject=self.registered_subject)
        self.maternal_labour_del = MaternalLabourDelFactory(registered_subject=self.registered_subject,
                                                            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='1010M'))
        self.antenatal_visit_2 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='1020M'))
        self.maternal_visit_2000 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='2000M'))

        infant_registered_subject = RegisteredSubject.objects.get(
            relative_identifier=self.registered_subject.subject_identifier,
            subject_type='infant')
        self.infant_birth = InfantBirthFactory(
            registered_subject=infant_registered_subject,
            maternal_labour_del=self.maternal_labour_del)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2000')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.options = {
            'report_datetime': timezone.now(),
            'infant_visit': self.infant_visit,
            'weight_kg': 3.61,
            'infant_length': 89.97,
            'head_circumference': 39.30,
            'apgar_score': NO,
            'apgar_score_min_1': '',
            'apgar_score_min_5': '',
            'apgar_score_min_10': '',
            'congenital_anomalities': NO}
Beispiel #2
0
 def test_maternal_required_pbmc_pl_hiv_neg(self):
     """"""
     options = {
         'registered_subject':
         self.registered_subject,
         'current_hiv_status':
         NEG,
         'evidence_hiv_status':
         YES,
         'week32_test':
         YES,
         'week32_test_date':
         (timezone.datetime.now() - relativedelta(weeks=4)).date(),
         'week32_result':
         NEG,
         'evidence_32wk_hiv_status':
         YES,
         'will_get_arvs':
         NOT_APPLICABLE,
         'rapid_test_done':
         YES,
         'rapid_test_date':
         timezone.now().date(),
         'rapid_test_result':
         NEG,
         'last_period_date':
         (timezone.datetime.now() - relativedelta(weeks=25)).date()
     }
     self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
     self.maternal_visit_1000 = MaternalVisit.objects.get(
         appointment__registered_subject=options.get('registered_subject'),
         reason=SCHEDULED,
         appointment__visit_definition__code='1000M')
     self.maternal_ultrasound = MaternalUltraSoundIniFactory(
         maternal_visit=self.maternal_visit_1000,
         number_of_gestations=1,
     )
     self.antenatal_visits_membership = AntenatalVisitMembershipFactory(
         registered_subject=options.get('registered_subject'))
     self.appointment = Appointment.objects.get(
         registered_subject=options.get('registered_subject'),
         visit_definition__code='1010M')
     self.maternal_labour_del = MaternalLabourDelFactory(
         registered_subject=self.registered_subject,
         live_infants_to_register=1)
     self.antenatal_visit_1 = MaternalVisitFactory(
         appointment=self.appointment)
     self.antenatal_visit_2 = MaternalVisitFactory(
         appointment=Appointment.objects.get(
             registered_subject=options.get('registered_subject'),
             visit_definition__code='1020M'))
     self.assertEqual(
         RequisitionMetaData.objects.filter(
             entry_status='NEW',
             lab_entry__app_label='td_lab',
             lab_entry__model_name='maternalrequisition',
             lab_entry__requisition_panel__name='PBMC Plasma (STORE ONLY)',
             appointment=self.appointment).count(), 1)
    def setUp(self):
        super(TestInfantNvpDispensingForm, self).setUp()
        self.maternal_eligibility = MaternalEligibilityFactory()
        self.maternal_consent = MaternalConsentFactory(
            maternal_eligibility=self.maternal_eligibility)
        self.registered_subject = self.maternal_eligibility.registered_subject

        self.assertEqual(RegisteredSubject.objects.all().count(), 1)
        options = {'registered_subject': self.registered_subject,
                   'current_hiv_status': POS,
                   'evidence_hiv_status': YES,
                   'will_get_arvs': YES,
                   'is_diabetic': NO,
                   'will_remain_onstudy': YES,
                   'rapid_test_done': NOT_APPLICABLE,
                   'last_period_date': (timezone.datetime.now() - relativedelta(weeks=25)).date()}

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.assertTrue(self.antenatal_enrollment.is_eligible)
        self.maternal_visit = MaternalVisit.objects.get(
            appointment__registered_subject=self.registered_subject,
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit, number_of_gestations=1,)
        self.maternal_visits_membership = AntenatalVisitMembershipFactory(registered_subject=self.registered_subject)
        self.maternal_labour_del = MaternalLabourDelFactory(registered_subject=self.registered_subject,
                                                            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='1010M'))
        self.antenatal_visit_2 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='1020M'))
        self.maternal_visit_2000 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='2000M'))

        infant_registered_subject = RegisteredSubject.objects.get(
            relative_identifier=self.registered_subject.subject_identifier,
            subject_type='infant')
        self.infant_birth = InfantBirthFactory(
            registered_subject=infant_registered_subject,
            maternal_labour_del=self.maternal_labour_del)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2000')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.options = {
            'infant_visit': self.infant_visit.id,
            'nvp_prophylaxis': YES,
            'azt_prophylaxis': NO,
            'nvp_admin_date': timezone.now().date(),
            'medication_instructions': YES,
            'dose_admin_infant': '10',
            'correct_dose': YES
        }
Beispiel #4
0
 def test_maternal_cd4_not_required_recent_grt_3months(self):
     """Test that CD4 requisition is required for all POS if recent CD4 > 3months."""
     options = {
         'registered_subject':
         self.registered_subject,
         'current_hiv_status':
         POS,
         'evidence_hiv_status':
         YES,
         'will_get_arvs':
         YES,
         'is_diabetic':
         NO,
         'will_remain_onstudy':
         YES,
         'rapid_test_done':
         NOT_APPLICABLE,
         'last_period_date':
         (timezone.datetime.now() - relativedelta(weeks=25)).date()
     }
     self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
     self.maternal_visit_1000 = MaternalVisit.objects.get(
         appointment__registered_subject=options.get('registered_subject'),
         reason=SCHEDULED,
         appointment__visit_definition__code='1000M')
     self.maternal_ultrasound = MaternalUltraSoundIniFactory(
         maternal_visit=self.maternal_visit_1000,
         number_of_gestations=1,
     )
     self.antenatal_visits_membership = AntenatalVisitMembershipFactory(
         registered_subject=options.get('registered_subject'))
     self.appointment = Appointment.objects.get(
         registered_subject=options.get('registered_subject'),
         visit_definition__code='1010M')
     self.maternal_labour_del = MaternalLabourDelFactory(
         registered_subject=self.registered_subject,
         live_infants_to_register=1)
     self.antenatal_visit_1 = MaternalVisitFactory(
         appointment=self.appointment)
     self.antenatal_visit_2 = MaternalVisitFactory(
         appointment=Appointment.objects.get(
             registered_subject=options.get('registered_subject'),
             visit_definition__code='1020M'))
     MaternalInterimIdccFactory(
         maternal_visit=self.antenatal_visit_2,
         recent_cd4=15,
         recent_cd4_date=(timezone.datetime.now() -
                          relativedelta(weeks=2)).date())
     self.assertEqual(
         RequisitionMetaData.objects.filter(
             entry_status='NEW',
             lab_entry__app_label='td_lab',
             lab_entry__model_name='maternalrequisition',
             lab_entry__requisition_panel__name='CD4',
             appointment=self.appointment).count(), 0)
Beispiel #5
0
    def test_maternal_viral_load_not_required_1010M(self):
        options = {
            'registered_subject':
            self.registered_subject,
            'current_hiv_status':
            POS,
            'evidence_hiv_status':
            YES,
            'will_get_arvs':
            YES,
            'is_diabetic':
            NO,
            'will_remain_onstudy':
            YES,
            'rapid_test_done':
            NOT_APPLICABLE,
            'last_period_date':
            (timezone.datetime.now() - relativedelta(weeks=25)).date()
        }

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.maternal_visit_1000 = MaternalVisit.objects.get(
            appointment__registered_subject=options.get('registered_subject'),
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit_1000,
            number_of_gestations=1,
        )
        self.antenatal_visits_membership = AntenatalVisitMembershipFactory(
            registered_subject=options.get('registered_subject'))
        appointment = Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='1010M')
        self.maternal_labour_del = MaternalLabourDelFactory(
            registered_subject=options.get('registered_subject'),
            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(appointment=appointment)

        self.assertEqual(
            RequisitionMetaData.objects.filter(
                entry_status=NOT_REQUIRED,
                lab_entry__app_label='td_lab',
                lab_entry__model_name='maternalrequisition',
                lab_entry__requisition_panel__name='Viral Load',
                appointment=appointment).count(), 1)
Beispiel #6
0
 def setUp(self):
     super(TestInfantBirthMembership, self).setUp()
     self.maternal_eligibility = MaternalEligibilityFactory()
     self.maternal_consent = MaternalConsentFactory(
         maternal_eligibility=self.maternal_eligibility)
     self.registered_subject = self.maternal_eligibility.registered_subject
     # maternal visit created here.
     self.antenatal_enrollment = AntenatalEnrollmentFactory(
         registered_subject=self.registered_subject)
     self.maternal_visit = MaternalVisit.objects.get(
         appointment__registered_subject=self.registered_subject,
         reason=SCHEDULED,
         appointment__visit_definition__code='1000M')
     self.maternal_ultrasound = MaternalUltraSoundIniFactory(
         maternal_visit=self.maternal_visit, number_of_gestations=1)
     self.maternal_visits_membership = AntenatalVisitMembershipFactory(
         registered_subject=self.registered_subject)
     self.maternal_labour_del = MaternalLabourDelFactory(
         registered_subject=self.registered_subject,
         live_infants_to_register=1)
    def setUp(self):
        super(TestInfantNvpAdjustmentForm, self).setUp()
        maternal_eligibility = MaternalEligibilityFactory()
        MaternalConsentFactory(maternal_eligibility=maternal_eligibility)
        registered_subject = maternal_eligibility.registered_subject

        options = {
            'registered_subject':
            registered_subject,
            'current_hiv_status':
            POS,
            'evidence_hiv_status':
            YES,
            'will_get_arvs':
            YES,
            'is_diabetic':
            NO,
            'will_remain_onstudy':
            YES,
            'rapid_test_done':
            NOT_APPLICABLE,
            'last_period_date':
            (timezone.datetime.now() - relativedelta(weeks=25)).date()
        }

        antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.assertTrue(antenatal_enrollment.is_eligible)
        maternal_visit = MaternalVisit.objects.get(
            appointment__registered_subject=registered_subject,
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        MaternalUltraSoundIniFactory(
            maternal_visit=maternal_visit,
            number_of_gestations=1,
        )
        AntenatalVisitMembershipFactory(registered_subject=registered_subject)
        maternal_labour_del = MaternalLabourDelFactory(
            registered_subject=registered_subject, live_infants_to_register=1)

        MaternalVisitFactory(appointment=Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='1010M'))
        MaternalVisitFactory(appointment=Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='1020M'))
        MaternalVisitFactory(appointment=Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='2000M'))
        infant_registered_subject = RegisteredSubject.objects.get(
            relative_identifier=registered_subject.subject_identifier,
            subject_type='infant')
        InfantBirthFactory(registered_subject=infant_registered_subject,
                           maternal_labour_del=maternal_labour_del)
        appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2000')
        infant_visit = InfantVisitFactory(appointment=appointment)
        InfantNvpDispensingFactory(infant_visit=infant_visit,
                                   nvp_prophylaxis=YES)
        appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2010')
        infant_visit = InfantVisitFactory(appointment=appointment)
        self.options = {
            'infant_visit': infant_visit.id,
            'report_datetime': timezone.now().date(),
            'dose_adjustment': NO,
            'adjusted_dose': None,
            'dose_4_weeks': YES,
            'incomplete_dose': None,
        }
Beispiel #8
0
    def test_maternal_rapid_test_required_lt_3months(self):
        options = {
            'registered_subject':
            self.registered_subject,
            'current_hiv_status':
            NEG,
            'evidence_hiv_status':
            YES,
            'week32_test':
            YES,
            'week32_test_date':
            (timezone.datetime.now() - relativedelta(weeks=4)).date(),
            'week32_result':
            NEG,
            'evidence_32wk_hiv_status':
            YES,
            'will_get_arvs':
            NOT_APPLICABLE,
            'rapid_test_done':
            YES,
            'rapid_test_date':
            timezone.now().date(),
            'rapid_test_result':
            NEG,
            'last_period_date':
            (timezone.datetime.now() - relativedelta(weeks=34)).date()
        }

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.maternal_visit_1000 = MaternalVisit.objects.get(
            appointment__registered_subject=options.get('registered_subject'),
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit_1000,
            number_of_gestations=1,
        )
        self.antenatal_visits_membership = AntenatalVisitMembershipFactory(
            registered_subject=options.get('registered_subject'))
        self.appointment = Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='1010M')
        self.maternal_labour_del = MaternalLabourDelFactory(
            registered_subject=options.get('registered_subject'),
            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(
            appointment=self.appointment)

        self.antenatal_visit_2 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='1020M'))
        RapidTestResultFactory(maternal_visit=self.antenatal_visit_2,
                               rapid_test_done=YES,
                               result=NEG,
                               result_date=(timezone.datetime.now() -
                                            relativedelta(days=90)).date())

        self.appointment = Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='2000M')
        self.maternal_visit_2000 = MaternalVisitFactory(
            appointment=self.appointment)

        RapidTestResultFactory(maternal_visit=self.maternal_visit_2000,
                               rapid_test_done=YES,
                               result=NEG,
                               result_date=(timezone.datetime.now() -
                                            relativedelta(days=30)).date())

        self.appointment = Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='2010M')
        self.maternal_visit_2010 = MaternalVisitFactory(
            appointment=self.appointment)

        RapidTestResultFactory(maternal_visit=self.maternal_visit_2010,
                               rapid_test_done=YES,
                               result=NEG,
                               result_date=(timezone.datetime.now() -
                                            relativedelta(days=5)).date())

        self.appointment = Appointment.objects.get(
            registered_subject=options.get('registered_subject'),
            visit_definition__code='2020M')
        self.maternal_visit_2020 = MaternalVisitFactory(
            appointment=self.appointment)

        self.assertEqual(
            CrfMetaData.objects.filter(entry_status=NOT_REQUIRED,
                                       crf_entry__app_label='td_maternal',
                                       crf_entry__model_name='rapidtestresult',
                                       appointment=self.appointment).count(),
            1)
Beispiel #9
0
    def setUp(self):
        super(TestSolidFoodAssessementForm, self).setUp()
        self.maternal_eligibility = MaternalEligibilityFactory()
        self.maternal_consent = MaternalConsentFactory(
            maternal_eligibility=self.maternal_eligibility)
        self.registered_subject = self.maternal_eligibility.registered_subject

        self.assertEqual(RegisteredSubject.objects.all().count(), 1)
        options = {'registered_subject': self.registered_subject,
                   'current_hiv_status': POS,
                   'evidence_hiv_status': YES,
                   'will_get_arvs': YES,
                   'is_diabetic': NO,
                   'will_remain_onstudy': YES,
                   'rapid_test_done': NOT_APPLICABLE,
                   'last_period_date': (timezone.datetime.now() - relativedelta(weeks=25)).date()}

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.assertTrue(self.antenatal_enrollment.is_eligible)
        self.maternal_visit = MaternalVisit.objects.get(
            appointment__registered_subject=self.registered_subject,
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit, number_of_gestations=1,)
        self.maternal_visits_membership = AntenatalVisitMembershipFactory(registered_subject=self.registered_subject)
        self.maternal_labour_del = MaternalLabourDelFactory(registered_subject=self.registered_subject,
                                                            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='1010M'))
        self.antenatal_visit_2 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='1020M'))
        self.maternal_visit_2000 = MaternalVisitFactory(
            appointment=Appointment.objects.get(registered_subject=options.get('registered_subject'),
                                                visit_definition__code='2000M'))

        infant_registered_subject = RegisteredSubject.objects.get(
            relative_identifier=self.registered_subject.subject_identifier,
            subject_type='infant')
        self.infant_birth = InfantBirthFactory(
            registered_subject=infant_registered_subject,
            maternal_labour_del=self.maternal_labour_del)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2000')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.infant_birth_arv = InfantBirthArvFactory(infant_visit=self.infant_visit, azt_discharge_supply=YES)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2010')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)

        self.solid_foods = Foods.objects.create(name="Other", short_name="Other", display_index=7, field_name=None,
            version="1.0", created="2016-07-28T11:08:56.576", modified="2016-07-28T11:08:56.576", user_created="",
            user_modified="", hostname_created="bcpp025", hostname_modified="bcpp025",
            revision="dev01-stable-147-g6f81e43:develop:6f81e431218ceb2eaa080f81705d4cacbd83aea8")

        self.options = {'age_solid_food': 7,
                        'solid_foods': [self.solid_foods.id],
                        'solid_foods_other': None,
                        'porridge': YES,
                        'porridge_freq': 5,
                        'tsabana': YES,
                        'tsabana_week': 5,
                        'mother_tsabana': YES,
                        'meat': YES,
                        'meat_freq': 5,
                        'potatoes': YES,
                        'potatoes_freq': 5,
                        'carrot_swt_potato': YES,
                        'carrot_swt_potato_freq': 5,
                        'green_veg': YES,
                        'green_veg_freq': 5,
                        'fresh_fruits': YES,
                        'fresh_fruits_freq': 5,
                        'fullcream_milk': YES,
                        'fullcream_milk_freq': 5,
                        'skim_milk': YES,
                        'skim_milk_freq': 5,
                        'raw_milk': YES,
                        'raw_milk_freq': 5,
                        'juice': YES,
                        'juice_freq': 5,
                        'eggs': YES,
                        'eggs_freq': 5,
                        'yogurt': YES,
                        'yogurt_freq': 5,
                        'cheese': YES,
                        'cheese_freq': 5,
                        'rations': YES,
                        'rations_receviced ': '',
                        }
    def setUp(self):
        super(TestInfantFuPhysicalForm, self).setUp()
        self.maternal_eligibility = MaternalEligibilityFactory()
        self.maternal_consent = MaternalConsentFactory(
            maternal_eligibility=self.maternal_eligibility)
        self.registered_subject = self.maternal_eligibility.registered_subject

        self.assertEqual(RegisteredSubject.objects.all().count(), 1)
        options = {
            'registered_subject':
            self.registered_subject,
            'current_hiv_status':
            POS,
            'evidence_hiv_status':
            YES,
            'will_get_arvs':
            YES,
            'is_diabetic':
            NO,
            'will_remain_onstudy':
            YES,
            'rapid_test_done':
            NOT_APPLICABLE,
            'last_period_date':
            (timezone.datetime.now() - relativedelta(weeks=25)).date()
        }

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.assertTrue(self.antenatal_enrollment.is_eligible)
        self.maternal_visit = MaternalVisit.objects.get(
            appointment__registered_subject=self.registered_subject,
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit,
            number_of_gestations=1,
        )
        self.maternal_visits_membership = AntenatalVisitMembershipFactory(
            registered_subject=self.registered_subject)
        self.maternal_labour_del = MaternalLabourDelFactory(
            registered_subject=self.registered_subject,
            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='1010M'))
        self.antenatal_visit_2 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='1020M'))
        self.maternal_visit_2000 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='2000M'))

        infant_registered_subject = RegisteredSubject.objects.get(
            relative_identifier=self.registered_subject.subject_identifier,
            subject_type='infant')
        self.infant_birth = InfantBirthFactory(
            registered_subject=infant_registered_subject,
            maternal_labour_del=self.maternal_labour_del)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2000')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2010')

        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.infant_fu = InfantFuPhysicalFactory(
            infant_visit=self.infant_visit)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2020')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.options = {
            'infant_visit': self.infant_visit.id,
            'report_datetime': timezone.now(),
            'weight_kg': 3,
            'height': 45.01,
            'head_circumference': 18.01,
            'general_activity': "NORMAL",
            'physical_exam_result': "NORMAL",
            'heent_exam': YES,
            'was_hospitalized': YES,
            'resp_exam': YES,
            'cardiac_exam': YES,
            'abdominal_exam': YES,
            'skin_exam': YES,
            'neurologic_exam': YES,
        }
Beispiel #11
0
    def setUp(self):
        super(TestInfantFeedingForm, self).setUp()
        self.maternal_eligibility = MaternalEligibilityFactory()
        self.maternal_consent = MaternalConsentFactory(
            maternal_eligibility=self.maternal_eligibility)
        self.registered_subject = self.maternal_eligibility.registered_subject

        self.assertEqual(RegisteredSubject.objects.all().count(), 1)
        options = {
            'registered_subject':
            self.registered_subject,
            'current_hiv_status':
            POS,
            'evidence_hiv_status':
            YES,
            'will_get_arvs':
            YES,
            'is_diabetic':
            NO,
            'will_remain_onstudy':
            YES,
            'rapid_test_done':
            NOT_APPLICABLE,
            'last_period_date':
            (timezone.datetime.now() - relativedelta(weeks=25)).date()
        }

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.assertTrue(self.antenatal_enrollment.is_eligible)
        self.maternal_visit = MaternalVisit.objects.get(
            appointment__registered_subject=self.registered_subject,
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit,
            number_of_gestations=1,
        )
        self.maternal_visits_membership = AntenatalVisitMembershipFactory(
            registered_subject=self.registered_subject)
        self.maternal_labour_del = MaternalLabourDelFactory(
            registered_subject=self.registered_subject,
            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='1010M'))
        self.antenatal_visit_2 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='1020M'))
        self.maternal_visit_2000 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='2000M'))

        infant_registered_subject = RegisteredSubject.objects.get(
            relative_identifier=self.registered_subject.subject_identifier,
            subject_type='infant')
        self.infant_birth = InfantBirthFactory(
            registered_subject=infant_registered_subject,
            maternal_labour_del=self.maternal_labour_del)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2000')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.infant_birth_arv = InfantBirthArvFactory(
            infant_visit=self.infant_visit, azt_discharge_supply=YES)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2010')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)

        self.options = {
            'infant_visit': self.infant_visit.id,
            'other_feeding': YES,
            'formula_intro_occur': YES,
            'formula_intro_date': date.today(),
            'took_formula': YES,
            'is_first_formula': YES,
            'date_first_formula': date.today(),
            'est_date_first_formula': YES,
            'water': YES,
            'juice': YES,
            'cow_milk': YES,
            'cow_milk_yes': 'boiled',
            'other_milk': NO,
            'other_milk_animal': None,
            'milk_boiled': NOT_APPLICABLE,
            'fruits_veg': NO,
            'cereal_porridge': NO,
            'solid_liquid': YES,
            'rehydration_salts': NO,
            'water_used': 'Water direct from source',
            'water_used_other': None,
            'ever_breastfeed': YES,
            'complete_weaning': NOT_APPLICABLE,
            'weaned_completely': NO,
            'most_recent_bm': None,
            'times_breastfed': '<1 per week',
            'comments': ''
        }
Beispiel #12
0
    def setUp(self):
        super(TestInfantFuDxItemsForm, self).setUp()
        self.maternal_eligibility = MaternalEligibilityFactory()
        self.maternal_consent = MaternalConsentFactory(
            maternal_eligibility=self.maternal_eligibility)
        self.registered_subject = self.maternal_eligibility.registered_subject

        self.assertEqual(RegisteredSubject.objects.all().count(), 1)
        options = {
            'registered_subject':
            self.registered_subject,
            'current_hiv_status':
            POS,
            'evidence_hiv_status':
            YES,
            'will_get_arvs':
            YES,
            'is_diabetic':
            NO,
            'will_remain_onstudy':
            YES,
            'rapid_test_done':
            NOT_APPLICABLE,
            'last_period_date':
            (timezone.datetime.now() - relativedelta(weeks=25)).date()
        }

        self.antenatal_enrollment = AntenatalEnrollmentFactory(**options)
        self.assertTrue(self.antenatal_enrollment.is_eligible)
        self.maternal_visit = MaternalVisit.objects.get(
            appointment__registered_subject=self.registered_subject,
            reason=SCHEDULED,
            appointment__visit_definition__code='1000M')
        self.maternal_ultrasound = MaternalUltraSoundIniFactory(
            maternal_visit=self.maternal_visit,
            number_of_gestations=1,
        )
        self.maternal_visits_membership = AntenatalVisitMembershipFactory(
            registered_subject=self.registered_subject)
        self.maternal_labour_del = MaternalLabourDelFactory(
            registered_subject=self.registered_subject,
            live_infants_to_register=1)
        self.antenatal_visit_1 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='1010M'))
        self.antenatal_visit_2 = MaternalVisitFactory(
            appointment=Appointment.objects.get(
                registered_subject=options.get('registered_subject'),
                visit_definition__code='1020M'))

        infant_registered_subject = RegisteredSubject.objects.get(
            relative_identifier=self.registered_subject.subject_identifier,
            subject_type='infant')
        self.infant_birth = InfantBirthFactory(
            registered_subject=infant_registered_subject,
            maternal_labour_del=self.maternal_labour_del)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2000')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.appointment = Appointment.objects.get(
            registered_subject=infant_registered_subject,
            visit_definition__code='2010')
        self.infant_visit = InfantVisitFactory(appointment=self.appointment)
        self.infant_fu_factory = InfantFuFactory(
            was_hospitalized=YES, infant_visit=self.infant_visit)
        self.infant_fu_dx_factory = InfantFuDxFactory(
            infant_visit=self.infant_visit)
        self.options = {
            'infant_vist': self.infant_visit,
            'infant_fu_dx': self.infant_fu_dx_factory.id,
            'fu_dx': 'Appendicitis',
            'fu_dx_specify': None,
            'health_facility': YES,
            'was_hospitalized': YES,
        }