pharmaship.inventory.parsers.equipment¶
Parser for Equipment data.
-
pharmaship.inventory.parsers.equipment.parser(params)¶ Parse the database to render a dict of EquipmentGroup/Equipment/Article.
Process database data and set flags on articles missing, expired or reaching near expiry.
Only equipements with
pharmaship.inventory.models.EquipmentReqQtyare listed.Data is sorted by
pharmaship.inventory.models.EquipmentGroup.See
pharmaship/schemas/parsers/equipment.jsonfor details.
-
pharmaship.inventory.parsers.equipment.parser_element(equipment, data, warning_delay, today=datetime.date(2021, 4, 23))¶ Parse the database to render a list of Equipment > Article.
- Parameters
equipment (models.Equipment) – Equipment to parse
data (dict) –
Common data for parsing. Following keys must be present:
qty_transactions: QuerySet ofpharmaship.inventory.models.QtyTransactionlocations: formatted list ofpharmaship.inventory.models.Location
warning_delay (datetime.date) – Date from which warning flag must be set
today (datetime.date) – Date from which expired flag must be set.
- Returns
Formatted information with articles.
- Return type