def prepare_data(self):
        self.previous_claim_ids.discard('')
        if len(self.previous_claim_ids) == 0:
            return

        file_utility.create_folder(self.temp_folder)
        self._unload_linked_claim_replacement_data()
        self._load_linked_claim_replacement_data()
Esempio n. 2
0
    def prepare_data(self):
        self.npi_ids.discard('')
        if len(self.npi_ids) == 0:
            return

        file_utility.create_folder(self.temp_folder)
        self._unload_npi_data()
        self._load_npi_data()
Esempio n. 3
0
    def prepare_data(self):
        self.npi_ids.discard('')
        if len(self.npi_ids) == 0:
            return

        file_utility.create_folder(self.temp_folder)
        self._unload_npi_data()
        self._download_npi_data()

        if len(os.listdir('{}/NPIJsonFiles'.format(self.temp_folder))) == 0:
            return

        self._create_csv_file()
        self._update_npi_database()
Esempio n. 4
0
 def _download_npi_data(self):
     file_utility.create_folder('{}/NPIJsonFiles'.format(self.temp_folder))
     for npi_file in os.listdir('{}/NpiValues'.format(self.temp_folder)):
         with CsvReader('{}/NpiValues/{}'.format(self.temp_folder,
                                                 npi_file),
                        '|',
                        has_header_columns=False) as csv_reader:
             with FuturesSession(max_workers=10) as session:
                 for number in csv_reader.read_records():
                     parameters = {
                         "number": number[0],
                         "version": "2.1",
                         "pretty": "on",
                         "address_purpose": ""
                     }
                     session.get(
                         "https://npiregistry.cms.hhs.gov/api",
                         params=parameters,
                         background_callback=self._create_npi_json_file)
 def prepare_data(self):
     file_utility.create_folder(self.temp_folder)
     self._unload_data()
     self._load_data()
 def _initialized(self):
     file_utility.create_folder('{0}/Input'.format(self.merge_root_path))
     file_utility.create_folder('{0}/Output'.format(self.merge_root_path))
     file_utility.copy_file(
         self.file_location,
         os.path.join(self.merge_root_path, 'Input', self.file_name))