예제 #1
0
 def get_htc_pos_achievement(self, domain):
     config = {
         'domain': domain,
         'age_range': self.get_list_property('htc_pos_age_range'),
         'district': self.get_list_property('htc_pos_district'),
         'client_type': self.get_list_property('htc_pos_client_type'),
         'user_id': get_user_ids_for_group(self.get_list_property('htc_pos_user_group')),
     }
     update_date_property(config, self.post_data, 'htc_pos_post_date', 'posttest_date')
     update_date_property(config, self.post_data, 'htc_pos_hiv_test_date', 'hiv_test_date')
     achievement = HivStatusDataSource(config=config).data
     return achievement.get(POST_TEST_XMLNS, {}).get('uic', 0)
예제 #2
0
    def generate_data(self, domain):
        config = {
            'domain': domain,
            'district': self.get_list_property('district'),
            'cbo': self.get_list_property('cbo'),
            'type_visit': self.post_data.get('visit_type', None),
            'activity_type': self.post_data.get('activity_type', None),
            'client_type': self.get_list_property('client_type'),
            'user_id': get_user_ids_for_group(self.get_list_property('organization')),
            'fiscal_year': self.post_data.get('fiscal_year', None),
        }

        update_date_property(config, self.post_data, 'visit_date', 'visit_date')
        update_date_property(config, self.post_data, 'posttest_date', 'posttest_date')
        update_date_property(config, self.post_data, 'first_art_date', 'first_art_date')
        update_date_property(config, self.post_data, 'date_handshake', 'date_handshake')
        update_date_property(config, self.post_data, 'date_last_vl_test', 'date_last_vl_test')

        target_client_types = []
        for client_type in config['client_type']:
            if client_type == 'client_fsw':
                client_type = 'cfsw'
            target_client_types.append(client_type.lower())
        config.update({'clienttype': target_client_types})
        targets = TargetsDataSource(config=config.copy()).data
        kp_prev = UICFromEPMDataSource(config=config.copy()).data
        htc_tst = UICFromCCDataSource(config=config.copy()).data
        htc_pos = HivStatusDataSource(config=config.copy()).data
        care_new = FormCompletionDataSource(config=config.copy()).data
        tx_new = FirstArtDataSource(config=config.copy()).data
        tz_undetect = LastVLTestDataSource(config=config).data

        return {
            'target_kp_prev': (targets.get('target_kp_prev', 0) or 0),
            'target_htc_tst': (targets.get('target_htc_tst', 0) or 0),
            'target_htc_pos': (targets.get('target_htc_pos', 0) or 0),
            'target_care_new': (targets.get('target_care_new', 0) or 0),
            'target_tx_new': (targets.get('target_tx_new', 0) or 0),
            'target_tx_undetect': (targets.get('target_tx_undetect', 0) or 0),
            'kp_prev': (kp_prev.get(PREVENTION_XMLNS, {}).get('uic', 0) or 0),
            'htc_tst': (htc_tst.get(POST_TEST_XMLNS, {}).get('uic', 0) or 0),
            'htc_pos': (htc_pos.get(POST_TEST_XMLNS, {}).get('uic', 0) or 0),
            'care_new': (care_new.get(ACCOMPAGNEMENT_XMLNS, {}).get('uic', 0) or 0),
            'tx_new': (tx_new.get(SUIVI_MEDICAL_XMLNS, {}).get('uic', 0) or 0),
            'tx_undetect': (tz_undetect.get(SUIVI_MEDICAL_XMLNS, {}).get('uic', 0) or 0),
        }
예제 #3
0
 def get_htc_pos_achievement(self, domain):
     config = {
         'domain':
         domain,
         'age_range':
         self.get_list_property('htc_pos_age_range'),
         'district':
         self.get_list_property('htc_pos_district'),
         'client_type':
         self.get_list_property('htc_pos_client_type'),
         'user_id':
         get_user_ids_for_group(
             self.get_list_property('htc_pos_user_group')),
     }
     update_date_property(config, self.post_data, 'htc_pos_post_date',
                          'posttest_date')
     update_date_property(config, self.post_data, 'htc_pos_hiv_test_date',
                          'hiv_test_date')
     achievement = HivStatusDataSource(config=config).data
     return achievement.get(POST_TEST_XMLNS, {}).get('uic', 0)
예제 #4
0
 def get_htc_pos_achievement(self, domain):
     config = {
         'domain':
         domain,
         'posttest_date_start':
         self.post_data.get('htc_pos_post_date_start', None),
         'posttest_date_end':
         self.post_data.get('htc_pos_post_date_end', None),
         'hiv_test_date_start':
         self.post_data.get('htc_pos_hiv_test_date_start', None),
         'hiv_test_date_end':
         self.post_data.get('htc_pos_hiv_test_date_end', None),
         'age_range':
         self.post_data.get('htc_pos_age_range', None),
         'district':
         self.post_data.get('htc_pos_district', None),
         'client_type':
         self.post_data.get('htc_pos_client_type', None),
         'user_id':
         get_user_ids_for_group(
             self.post_data.get('htc_pos_user_group', None)),
     }
     achievement = HivStatusDataSource(config=config).data
     return achievement.get(POST_TEST_XMLNS, {}).get('uic', 0)
예제 #5
0
    def generate_data(self, domain):
        config = {
            'domain':
            domain,
            'district':
            self.get_list_property('district'),
            'cbo':
            self.get_list_property('cbo'),
            'type_visit':
            self.post_data.get('visit_type', None),
            'activity_type':
            self.post_data.get('activity_type', None),
            'client_type':
            self.get_list_property('client_type'),
            'user_id':
            get_user_ids_for_group(self.get_list_property('organization')),
            'fiscal_year':
            self.post_data.get('fiscal_year', None),
        }

        update_date_property(config, self.post_data, 'visit_date',
                             'visit_date')
        update_date_property(config, self.post_data, 'posttest_date',
                             'posttest_date')
        update_date_property(config, self.post_data, 'first_art_date',
                             'first_art_date')
        update_date_property(config, self.post_data, 'date_handshake',
                             'date_handshake')
        update_date_property(config, self.post_data, 'date_last_vl_test',
                             'date_last_vl_test')

        target_client_types = []
        for client_type in config['client_type']:
            if client_type == 'client_fsw':
                client_type = 'cfsw'
            target_client_types.append(client_type.lower())
        config.update({'clienttype': target_client_types})
        targets = TargetsDataSource(config=config.copy()).data
        kp_prev = UICFromEPMDataSource(config=config.copy()).data
        htc_tst = UICFromCCDataSource(config=config.copy()).data
        htc_pos = HivStatusDataSource(config=config.copy()).data
        care_new = FormCompletionDataSource(config=config.copy()).data
        tx_new = FirstArtDataSource(config=config.copy()).data
        tz_undetect = LastVLTestDataSource(config=config).data

        return {
            'target_kp_prev': (targets.get('target_kp_prev', 0) or 0),
            'target_htc_tst': (targets.get('target_htc_tst', 0) or 0),
            'target_htc_pos': (targets.get('target_htc_pos', 0) or 0),
            'target_care_new': (targets.get('target_care_new', 0) or 0),
            'target_tx_new': (targets.get('target_tx_new', 0) or 0),
            'target_tx_undetect': (targets.get('target_tx_undetect', 0) or 0),
            'kp_prev': (kp_prev.get(PREVENTION_XMLNS, {}).get('uic', 0) or 0),
            'htc_tst': (htc_tst.get(POST_TEST_XMLNS, {}).get('uic', 0) or 0),
            'htc_pos': (htc_pos.get(POST_TEST_XMLNS, {}).get('uic', 0) or 0),
            'care_new': (care_new.get(ACCOMPAGNEMENT_XMLNS, {}).get('uic', 0)
                         or 0),
            'tx_new': (tx_new.get(SUIVI_MEDICAL_XMLNS, {}).get('uic', 0) or 0),
            'tx_undetect':
            (tz_undetect.get(SUIVI_MEDICAL_XMLNS, {}).get('uic', 0) or 0),
        }
예제 #6
0
    def generate_data(self, domain):
        config = {
            'domain':
            domain,
            'district':
            self.post_data.get('district', None),
            'type_visit':
            self.post_data.get('visit_type', None),
            'activity_type':
            self.post_data.get('activity_type', None),
            'client_type':
            self.post_data.get('client_type', None),
            'organization':
            self.post_data.get('organization', None),
            'visit_date_start':
            self.post_data.get('visit_date_start', None),
            'visit_date_end':
            self.post_data.get('visit_date_end', None),
            'posttest_date_start':
            self.post_data.get('post_date_start', None),
            'posttest_date_end':
            self.post_data.get('post_date_end', None),
            'first_art_date_start':
            self.post_data.get('first_art_date_start', None),
            'first_art_date_end':
            self.post_data.get('first_art_date_end', None),
            'date_handshake_start':
            self.post_data.get('date_handshake_start', None),
            'date_handshake_end':
            self.post_data.get('date_handshake_end', None),
            'date_last_vl_test_start':
            self.post_data.get('date_last_vl_test_start', None),
            'date_last_vl_test_end':
            self.post_data.get('date_last_vl_test_end', None),
            'fiscal_year':
            self.post_data.get('fiscal_year', None),
        }
        client_type = self.post_data.get('client_type', None)
        if client_type:
            if client_type == 'client_fsw':
                client_type = 'cfsw'
            client_type = client_type.lower()
        config.update({'clienttype': client_type})

        targets = TargetsDataSource(config=config).data
        kp_prev = UICFromEPMDataSource(config=config).data
        htc_tst = UICFromCCDataSource(config=config).data
        htc_pos = HivStatusDataSource(config=config).data
        care_new = FormCompletionDataSource(config=config).data
        tx_new = FirstArtDataSource(config=config).data
        tz_undetect = LastVLTestDataSource(config=config).data

        return {
            'target_kp_prev': (targets.get('target_kp_prev', 0) or 0),
            'target_htc_tst': (targets.get('target_htc_tst', 0) or 0),
            'target_htc_pos': (targets.get('target_htc_pos', 0) or 0),
            'target_care_new': (targets.get('target_care_new', 0) or 0),
            'target_tx_new': (targets.get('target_tx_new', 0) or 0),
            'target_tx_undetect': (targets.get('target_tx_undetect', 0) or 0),
            'kp_prev': (kp_prev.get(PREVENTION_XMLNS, {}).get('uic', 0) or 0),
            'htc_tst': (htc_tst.get(POST_TEST_XMLNS, {}).get('uic', 0) or 0),
            'htc_pos': (htc_pos.get(POST_TEST_XMLNS, {}).get('uic', 0) or 0),
            'care_new': (care_new.get(ACCOMPAGNEMENT_XMLNS, {}).get('uic', 0)
                         or 0),
            'tx_new': (tx_new.get(SUIVI_MEDICAL_XMLNS, {}).get('uic', 0) or 0),
            'tx_undetect':
            (tz_undetect.get(SUIVI_MEDICAL_XMLNS, {}).get('uic', 0) or 0),
        }