Beispiel #1
0
def harmonization_extract_worker(args):
  filename = args[0]
  name_queue = args[1]

  try:
    tree = extract.parse_xml(filename)
    harmonized = {}
    harmonized['spl_set_id'] = extract.extract_set_id(tree)
    harmonized['id'] = extract.extract_id(tree)
    harmonized['spl_version'] = extract.extract_version_number(tree)
    harmonized['is_original_packager'] = extract.is_original_packager(tree)
    harmonized['ProductNDCs'] = extract.extract_product_ndcs(tree)
    harmonized['OriginalPackagerProductNDSs'] = \
      extract.extract_original_packager_product_ndcs(tree)
    harmonized['PackageNDCs'] = extract.extract_package_ndcs(tree)
    name_queue.put(harmonized)

  except Exception as inst:
    print filename + 'has a problem'
    print inst
Beispiel #2
0
 def test_extract_product_ndcs(self):
   expected_ndcs = ['0071-0155', '0071-0156', '0071-0157', '0071-0158']
   extracted_ndcs = extract.extract_product_ndcs(self.tree)
   self.assertListEqual(expected_ndcs, extracted_ndcs,
                        extracted_ndcs)
Beispiel #3
0
 def test_extract_product_ndcs(self):
   expected_ndcs = ['0067-6344']
   extracted_ndcs = extract.extract_product_ndcs(self.tree)
   self.assertListEqual(expected_ndcs, extracted_ndcs,
                        extracted_ndcs)
Beispiel #4
0
 def test_extract_product_ndcs(self):
   expected_ndcs = ['0074-3799', '0074-9374', '0074-4339', '0074-3797']
   extracted_ndcs = extract.extract_product_ndcs(self.tree)
   self.assertListEqual(expected_ndcs, extracted_ndcs,
                        extracted_ndcs)
Beispiel #5
0
 def test_extract_product_ndcs(self):
   expected_ndcs = ['55289-800']
   extracted_ndcs = extract.extract_product_ndcs(self.tree)
   self.assertListEqual(expected_ndcs, extracted_ndcs,
                        extracted_ndcs)