pharmaship.inventory.search¶
Pharmaship inventory module.
-
pharmaship.inventory.search.
get_equipments
(text, params)¶ Return a list of parsed equipments related to searched text.
-
pharmaship.inventory.search.
get_molecules
(text, params)¶ Return a list of parsed molecules related to searched text.
-
pharmaship.inventory.search.
get_quantity
(transactions)¶ Get current quantity from a set of transactions.
Caution: This method does not check that the transactions correspond all to the same
content_object
.- Parameters
transactions (django.db.models.query.QuerySet) – Set of
pharmaship.inventory.models.QtyTransaction
.- Returns
Quantity
- Return type
-
pharmaship.inventory.search.
location_display
(location_id_list, locations)¶ Return list of human-readable locations.
The format of
locations
is the same asparams.locations
.
-
pharmaship.inventory.search.
parse_items
(items)¶ Return the list of instances ID and dictionary of encountered locations.
- Parameters
items (django.db.models.query.QuerySet) –
Set of items:
- Returns
Tuple of ID list and locations dictionary
- Return type
-
pharmaship.inventory.search.
search
(text, params)¶ Return the search results from a long enough text.
To avoid unnecessary search, text length must be at least 2 chars.
The method searches into medicines, equipment, laboratory and telemedical sets.
The results are sorted by “parent” (Molecule/Equipment) and contains required quantities for each set if any, current quantity, group (MoleculeGroup or EquipmentGroup) and other names previously encountered (in Medicine and Article records).