pharmaship.inventory.parsers.medicines¶
-
pharmaship.inventory.parsers.medicines.
parser
(params)¶ Parse the database to render a dict of MoleculeGroup/Molecule/Medicine.
Process database data and set flags on medicines missing, expired or reaching near expiry.
Only molecules with
pharmaship.inventory.models.MoleculeReqQty
are listed.Data is sorted by
pharmaship.inventory.models.MoleculeGroup
.See
pharmaship/schemas/parsers/medicines.json
for details.
-
pharmaship.inventory.parsers.medicines.
parser_element
(molecule, data, warning_delay, today)¶ Parse the database to render a list of Molecule > Medicine.
- Parameters
molecule (models.Molecule) – Molecule to parse
data (dict) –
Common data for parsing. Following keys must be present:
qty_transactions
: QuerySet ofpharmaship.inventory.models.QtyTransaction
locations
: 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 medicines.
- Return type