Exemplo n.º 1
0
    def test_nadac(self):
        for s in self.suite:
            newFormat = s['formatted'].replace('-', '')
            if s['l'] < 10000:
                newFormat = '0' + newFormat

            actual = PackageNdc.parse_nadac(newFormat)
            self.assertEqual(s['l'], actual.labeler)
            self.assertEqual(s['prc'], actual.productCode)
            self.assertEqual(s['pkc'], actual.packageCode)
            self.assertEqual(s['formatted'], actual.format())
            self.assertEqual(newFormat, actual.format_nadac())
Exemplo n.º 2
0
    def test_nadac(self):
        for s in self.suite:
            newFormat = s['formatted'].replace('-', '')
            if s['l'] < 10000:
                newFormat = '0' + newFormat

            actual = PackageNdc.parse_nadac(newFormat)
            self.assertEqual(s['l'], actual.labeler)
            self.assertEqual(s['prc'], actual.productCode)
            self.assertEqual(s['pkc'], actual.packageCode)
            self.assertEqual(s['formatted'], actual.format())
            self.assertEqual(newFormat, actual.format_nadac())
Exemplo n.º 3
0
 def map_nadac(self, x):
     ''' Projects an element from a record in the Medicare cost spreadsheet.
     '''
     ndc = PackageNdc.parse_nadac(x['NDC'])
     return {'description': x['NDC Description'],
             'package_code' : ndc.packageCode,
             'product_code' : ndc.productCode,
             'labeler' : ndc.labeler,
             'package_ndc': ndc.format(),
             'product_ndc': ndc.format_product(),
             'price_per_unit': x['NADAC Per Unit'],
             'unit': x['Pricing Unit']
             }
Exemplo n.º 4
0
 def map_nadac(self, x):
     ''' Projects an element from a record in the Medicare cost spreadsheet.
     '''
     ndc = PackageNdc.parse_nadac(x['NDC'])
     return {
         'description': x['NDC Description'],
         'package_code': ndc.packageCode,
         'product_code': ndc.productCode,
         'labeler': ndc.labeler,
         'package_ndc': ndc.format(),
         'product_ndc': ndc.format_product(),
         'price_per_unit': x['NADAC Per Unit'],
         'unit': x['Pricing Unit']
     }