Exemple #1
0
HNH_VENTS = SheetMapping(
    sheet_name=RegexMatch("H\+H (\d+-\d+) \d+[AP]M",
                          take_latest=True),  # 'H+H 4-3 3PM',
    data_file=DataFile.PPE_ORDERINGCHARTS_DATE_XLSX,
    mappings={
        Mapping(
            sheet_column_name="Equipment Detail",
            obj_column_name="type",
        ),
        Mapping(sheet_column_name="Adjusted ETA",
                obj_column_name="eta",
                proc=parse_date),
        Mapping(
            sheet_column_name="Quantity Ordered",
            obj_column_name="quantity",
            proc=parse_int,
        ),
        Mapping(
            sheet_column_name="Quantity Delivered",
            obj_column_name="quantity_delivered",
            proc=parse_int,
        ),
        Mapping(sheet_column_name="Functionality",
                obj_column_name="functionality"),
        Mapping(sheet_column_name="Supplier", obj_column_name="vendor"),
        Mapping(sheet_column_name="Delivered?", obj_column_name="delivered"),
    },
    include_raw=True,
    obj_constructor=VentilatorRow,
)
Exemple #2
0
DONATION_DATA = SheetMapping(
    data_file=DataFile.CSH_DONATIONS,
    sheet_name="List of Donations",
    header_row_idx=2,
    mappings={
        Mapping(
            sheet_column_name="Donor",
            obj_column_name="donor",
        ),
        Mapping(
            # NOTE: typo. They might fix.
            sheet_column_name="Donation notifcation Date",
            obj_column_name="notification_date",
            proc=utils.parse_date,
        ),
        Mapping(
            sheet_column_name="Person of Contact",
            obj_column_name="contact_person",
        ),
        Mapping(
            sheet_column_name="Detailed item description",
            obj_column_name="description",
        ),
        Mapping(
            sheet_column_name="Critical Asset",
            obj_column_name="item",
            proc=utils.asset_name_to_item,
        ),
        Mapping(
            sheet_column_name="Total Quantity ",
            obj_column_name="quantity",
            proc=utils.parse_int,
        ),
        Mapping(
            sheet_column_name="Status Shipped DOHMH  Y/N   ",
            obj_column_name="picked_up",
            proc=utils.parse_bool,
        ),
        Mapping(
            sheet_column_name="Received at CSH",
            obj_column_name="received_date",
            proc=date_or_pending,
        ),
        Mapping(
            sheet_column_name="Comments",
            obj_column_name="comments",
            proc=utils.parse_string_or_none,
        ),
    },
    include_raw=True,
    obj_constructor=DonationRow,
)
Exemple #3
0
            objs.append(delivery)

        return objs


sheet_columns = [
    "Face Shields",
    "ISO Gowns "
]

item_mappings = [
    Mapping(
        sheet_column_name=column,
        obj_column_name=column.strip().lower().replace(" ", "_"),
        proc=parse_int_or_zero,
    )
    for column in sheet_columns
]

EDC_PO_TRACKER = SheetMapping(
    data_file=DataFile.SUPPLIERS_PARTNERS_XLSX,
    sheet_name="Daily Delivery Roll up",
    mappings={
        *item_mappings,
        Mapping(sheet_column_name="Date", obj_column_name="delivery_date", proc=parse_date),
    },
    include_raw=True,
    obj_constructor=MakeRow,
    header_row_idx=3
)
Exemple #4
0
    "Coveralls", "Shoe/Boot Covers", "Scrubs", "Multipurpose PPE",
    "Hand Sanitizer", "Misc", "Misc Non-Deployable"
]

item_mappings = [
    Mapping(
        sheet_column_name=column,
        obj_column_name=column,
        proc=parse_int_or_zero,
    ) for column in sheet_columns
]

FACILITY_DELIVERIES = SheetMapping(
    sheet_name="Facility Deliveries Summaries",
    data_file=DataFile.FACILITY_DELIVERIES,
    mappings={
        Mapping(sheet_column_name="Date",
                obj_column_name="date",
                proc=parse_date),
        Mapping(
            sheet_column_name="Facility Name or Network",
            obj_column_name="facility_name",
        ),
        Mapping(sheet_column_name="Facility Type",
                obj_column_name="facility_type"),
        *item_mappings,
    },
    obj_constructor=DeliveryRow,
    include_raw=True,
)
Exemple #5
0
DONATION_DATA = SheetMapping(
    data_file=DataFile.CSH_DONATIONS,
    sheet_name=RegexMatch(
        # 05-12-20, not currently multiple sheets per workbook
        "(\d+-\d+-\d+)|({\w{8}-\w{4}-\w{4}-\w{4}-\w{5})"),
    header_row_idx=2,
    mappings={
        Mapping(
            sheet_column_name="Donor",
            obj_column_name="donor",
        ),
        Mapping(
            sheet_column_name="Notified Date",
            obj_column_name="notification_date",
            proc=utils.parse_date,
        ),
        Mapping(
            sheet_column_name="Person Of Contact",
            obj_column_name="contact_person",
        ),
        Mapping(
            sheet_column_name="Detailed Item Description",
            obj_column_name="description",
        ),
        Mapping(
            sheet_column_name="Critical Asset",
            obj_column_name="item",
            proc=utils.asset_name_to_item,
        ),
        Mapping(
            sheet_column_name="Total Notified Quantity",
            obj_column_name="total_pledged_quantity",
            proc=utils.parse_int,
        ),
        Mapping(
            sheet_column_name="Total Distributed Quantity",
            obj_column_name="total_distributed_quantity",
            proc=utils.parse_int_or_zero,
        ),
        Mapping(
            sheet_column_name="Distribution Status",
            obj_column_name="distribution_status",
        ),
        Mapping(sheet_column_name="Distributed To",
                obj_column_name="distributed_to")
    },
    include_raw=True,
    obj_constructor=DonationRow,
)
Exemple #6
0

SUPPLIERS_AND_PARTNERS = SheetMapping(
    data_file=DataFile.SUPPLIERS_PARTNERS_XLSX,
    sheet_name="Wkly Delivery Tracker - CH",
    mappings={
        Mapping(
            sheet_column_name="Supply / Service",
            obj_column_name="item",
            proc=asset_name_to_item,
        ),
        Mapping(
            sheet_column_name="Number of Units",
            obj_column_name="quantity",
            proc=parse_int,
        ),
        Mapping(
            sheet_column_name="Delivery Date",
            obj_column_name="delivery_date",
            proc=parse_date,
        ),
        Mapping(sheet_column_name="Delivery Date", obj_column_name="raw_date"),
        Mapping(
            sheet_column_name="Counterparty Name (for procurement)",
            obj_column_name="vendor",
        ),
    },
    include_raw=True,
    obj_constructor=MakeRow,
)
Exemple #7
0
    "Eyewear",
    "Gloves",
    "Gowns",
    "Ponchos",
    "Coveralls",
    "Vents",
    "BiPaps",
    "Multipurpose PPE",
    "Post Mortem Bags",
    "Scrubs",
]
item_mappings = [
    Mapping(
        sheet_column_name=column,
        obj_column_name=column.lower().replace(" ", "_"),
        proc=parse_int_or_zero,
    ) for column in sheet_columns
]
INVENTORY = SheetMapping(
    sheet_name="Inventory Levels",
    data_file=DataFile.FACILITY_DELIVERIES,
    mappings={
        *item_mappings,
        Mapping(sheet_column_name="Date",
                obj_column_name="date",
                proc=parse_date),
    },
    include_raw=True,
    obj_constructor=InventoryRow,
)
DCAS_DAILY_SOURCING = SheetMapping(
    sheet_name=RegexMatch("DCAS (\d+-\d+) \d+[AP]M",
                          take_latest=True),  #'DCAS 4-12 3PM',
    data_file=DataFile.PPE_ORDERINGCHARTS_DATE_XLSX,
    mappings={
        Mapping(
            sheet_column_name="Critical Asset",
            obj_column_name="item",
            proc=asset_name_to_item,
        ),
        Mapping(
            sheet_column_name="Description",
            obj_column_name="description",
        ),
        Mapping(
            sheet_column_name="Total Qty Ordered",
            obj_column_name="quantity",
            proc=parse_int,
        ),
        Mapping(
            sheet_column_name="Received Qty",
            obj_column_name="received_quantity",
            proc=parse_int,
        ),
        Mapping(
            sheet_column_name="Delivery 1 Week Of",
            obj_column_name="delivery_day_1",
            proc=parse_date,
        ),
        Mapping(
            sheet_column_name="Delivery 1 Qty",
            obj_column_name="delivery_day_1_quantity",
            proc=parse_int,
        ),
        Mapping(
            sheet_column_name="Deliver 2 Week Of",
            obj_column_name="delivery_day_2",
            proc=parse_date,
        ),
        Mapping(
            sheet_column_name="Delivery 2 Qty",
            obj_column_name="delivery_day_2_quantity",
            proc=parse_int,
        ),
        Mapping(sheet_column_name="Vendor", obj_column_name="vendor"),
        Mapping(sheet_column_name="Status", obj_column_name="status"),
    },
    include_raw=True,
    obj_constructor=SourcingRow,
    header_row_idx=2,
)
Exemple #9
0
    def to_objects(self, error_collector):
        return [
            models.Inventory(
                item=self.item,
                raw_data=self.raw_data,
                quantity=self.quantity,
            )
        ]

    def __repr__(self):
        return repr_no_raw(self)


INVENTORY = SheetMapping(
    sheet_name="InventoryHand",
    data_file=DataFile.INVENTORY,
    mappings={
        Mapping(
            sheet_column_name="Item",
            obj_column_name="item",
            proc=asset_name_to_item,
        ),
        Mapping(sheet_column_name="CITY",
                obj_column_name="quantity",
                proc=parse_int),
    },
    include_raw=True,
    obj_constructor=InventoryRow,
)

sheet_columns = ["Item", "Demand", "Week Start", "Week End"]

WEEKLY_DEMANDS = SheetMapping(
    sheet_name=None,
    data_file=DataFile.HOSPITAL_DEMANDS,
    mappings={
        Mapping(
            sheet_column_name="Item",
            obj_column_name="item",
            proc=asset_name_to_item,
        ),
        Mapping(sheet_column_name="Demand",
                obj_column_name="demand",
                proc=parse_int_or_zero),
        Mapping(
            sheet_column_name="Week Start",
            obj_column_name="week_start_date",
            proc=parse_date,
        ),
        Mapping(
            sheet_column_name="Week End",
            obj_column_name="week_end_date",
            proc=parse_date,
        ),
    },
    obj_constructor=DemandRow,
    include_raw=True,
)