Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equipment: Integration into modules #1341

Merged
merged 461 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
461 commits
Select commit Hold shift + click to select a range
3a8fd28
cardio metabolic disorders equipment added
joehcollins Nov 3, 2023
38f07b3
cardio metabolic disorders equipment added
joehcollins Nov 3, 2023
72b6a2a
cardio metabolic disorders equipment added
joehcollins Nov 3, 2023
29f9fc9
diarrhoea equipment added
joehcollins Nov 3, 2023
30d760e
initial RTI equipment added. updated confusing naming of consumables …
joehcollins Nov 10, 2023
0f16f59
diarr: empty equip declaration
EvaJanouskova Nov 13, 2023
5354899
ac: finish update of confusing naming of consumables as equipment
EvaJanouskova Nov 13, 2023
7adde5f
nb: rm finished TODO
EvaJanouskova Nov 13, 2023
b7ad900
add equipment declaration for EPI module HsiBaseVaccine class
tdm32 Nov 6, 2023
7295d1a
stunting: empty equipment declaration
EvaJanouskova Nov 13, 2023
ae05be9
brc & co: add TODOs to replace dummy examples by real equip items
EvaJanouskova Nov 14, 2023
f9cca95
fix mistakes from the rebase
EvaJanouskova Nov 15, 2023
287a80b
Merge remote-tracking branch 'origin/equipment/integration_in_modules…
joehcollins Dec 6, 2023
312aaa3
COPD equipment added. missing equipment declarations added
joehcollins Dec 6, 2023
f1d4ee0
updates to MNH modules, ALRI and CKD following review comments
joehcollins Dec 6, 2023
4325c78
equip_catalogue: (1) detailed - equip set as string in one row, modul…
EvaJanouskova Dec 6, 2023
b42c15b
co: equipment updated
EvaJanouskova Dec 6, 2023
6ff025c
equip_catalogue: (1) detailed - equip set as string in one row, modul…
EvaJanouskova Dec 6, 2023
bf83c61
equip_catalogue: suffix (as input) added for output file names
EvaJanouskova Dec 6, 2023
0216daa
Merge branch 'EvaJ/equipment/structure_ToRunSim' into equipment/integ…
EvaJanouskova Dec 6, 2023
0a5d8e7
co: equip udpated, PEP 8
EvaJanouskova Dec 6, 2023
8fb6496
equip_catalogue: typo
EvaJanouskova Dec 6, 2023
51595fa
updates to MNH modules and ALRI following comments
joehcollins Dec 11, 2023
77a0926
RTI equipment first pass
joehcollins Dec 11, 2023
7cd4fc3
start adding consumables to cancer
joehcollins Jan 2, 2024
bc726c2
adding consumables for the cancer modules. consumables are defined in…
joehcollins Jan 12, 2024
9889da9
adding equipment (first pass) to cancer modules. In addition have upd…
joehcollins Jan 12, 2024
a057c40
formatting
joehcollins Jan 12, 2024
bfaef67
adding equipment declarations to depression - none needed
joehcollins Jan 12, 2024
7b4e331
adding equipment declarations to epilepsy - none needed
joehcollins Jan 12, 2024
7cb9f2a
formatting
joehcollins Jan 12, 2024
9b173d7
fix error in cancer_consumables.py
joehcollins Jan 12, 2024
c53dc8c
fix error in cancer_consumables.py
joehcollins Jan 12, 2024
ab105e8
fix error in cancer_consumables.py
joehcollins Jan 12, 2024
451f262
TODO: some modules use equipment when talking about consumables
EvaJanouskova Sep 1, 2023
b8da673
breast_cancer: dummy used_equipment added where Andrew requested
EvaJanouskova Sep 4, 2023
d685c69
co: dummy used_equipment added for methods where Emi listed some
EvaJanouskova Sep 4, 2023
a00d25a
healthsystem: annual equipment summary log by fac. level
EvaJanouskova Sep 4, 2023
b7cc852
breast_cancer: mastectomy dummy equipment fixed
EvaJanouskova Sep 5, 2023
7f5c575
equipment_catalogue & utils: new script + a change in utils.py - to c…
EvaJanouskova Sep 6, 2023
c4b316b
equipment_catalogue: PEP8
EvaJanouskova Sep 7, 2023
79ba1c1
healthsystem: sort equipment for log
EvaJanouskova Sep 12, 2023
328bb78
equipment_catalogue: comment updated
EvaJanouskova Sep 12, 2023
8fae9b3
rti: unified use of consumables/equipment terms
EvaJanouskova Sep 12, 2023
c4615da
hs, brc, co: used_equipment renamed to EQUIPMENT; if equip always sam…
EvaJanouskova Sep 12, 2023
0d9e216
brc: comment updated
EvaJanouskova Sep 18, 2023
ecc5981
brc & co: rm the dummy examples of equipment from modules
EvaJanouskova Sep 20, 2023
a3d726e
RF_Equipment: equipment catalogue - first draft (from Sakshi)
EvaJanouskova Sep 24, 2023
d8a53b2
RF_Equipment: equipment catalogue - merge duplicates (round 1)
EvaJanouskova Sep 24, 2023
e7a8e56
RF_Equipment: equipment catalogue - merge duplicates (round 2)
EvaJanouskova Sep 27, 2023
bd55b0d
hs: debugging Equipment log - rm sorted
EvaJanouskova Sep 27, 2023
ed50338
hs: fix sorting of _equip_by_level
EvaJanouskova Sep 27, 2023
5576de9
RF_Equipment: equipment catalogue - merge duplicates (round 3)
EvaJanouskova Sep 27, 2023
ba97098
RF_Equipment: equipment catalogue - merge duplicates (round 4)
EvaJanouskova Sep 27, 2023
d114b2d
RF_Equipment: equipment catalogue - merge duplicates (round 5)
EvaJanouskova Sep 29, 2023
e88babe
RF_Equipment: equipment catalogue - merge duplicates (round 6) + col …
EvaJanouskova Nov 15, 2023
13af328
RF_Equip: equip item codes added
EvaJanouskova Nov 15, 2023
ac22da6
codes_to_items_list: new script created
EvaJanouskova Nov 15, 2023
178e996
codes_to_items_list: script generalised + PEP 8
EvaJanouskova Nov 15, 2023
b7c4e86
hs: equipment added to HSIEventDetails
EvaJanouskova Nov 16, 2023
c9f9da7
equip_catalogue: make catalogues from new logging (equip included in …
EvaJanouskova Nov 17, 2023
c311825
hs: sort equipment for logging
EvaJanouskova Nov 19, 2023
811da1f
test_hs: assert equipment logging within detailed_hsi_event
EvaJanouskova Nov 19, 2023
5c90ad4
[no ci] hs: typo; Equipment logging removed
EvaJanouskova Nov 23, 2023
e970814
equip_catalogue: fix the keys mapping to be done for each run
EvaJanouskova Dec 1, 2023
f4a91fb
equip_catalogue: input hsi event details by which to catalog equipment
EvaJanouskova Dec 2, 2023
81a6eff
equip_catalogue: input time period by which to catalog equipment
EvaJanouskova Dec 2, 2023
d6fa91d
equip_catalogue: list of requested details can be empty
EvaJanouskova Dec 2, 2023
903adcc
equip_catalogue: verify inputs as expected & set output file names in…
EvaJanouskova Dec 2, 2023
1d9c594
equip_catalogue: (1) detailed - equip set as string in one row, modul…
EvaJanouskova Dec 6, 2023
df7479e
equip_catalogue: suffix (as input) added for output file names
EvaJanouskova Dec 6, 2023
c67618c
hs: structure v2; alri+co: examples to test new structure
EvaJanouskova Jan 13, 2024
422bfbf
equip_catalogue: TODO added
EvaJanouskova Jan 13, 2024
0eaacc3
equip_catalogue: typo
EvaJanouskova Dec 6, 2023
d99310a
equip_catalogue: TODO added
EvaJanouskova Jan 13, 2024
9d31842
equip_catalogue: bug fixed
EvaJanouskova Jan 13, 2024
2c5a436
brc: TODO added
EvaJanouskova Jan 13, 2024
14f426a
hs: rm prints
EvaJanouskova Jan 13, 2024
e9c09ec
hs: rm old code
EvaJanouskova Jan 13, 2024
b88f251
hs: rm/add accidentally added/rmd commas
EvaJanouskova Jan 13, 2024
507eb4e
fixes in bladder_cancer.pyr
joehcollins Jan 15, 2024
68ae9b0
equip_catalogue: TODO added
EvaJanouskova Jan 13, 2024
7fb9ee8
equip_catalogue: bug fixed
EvaJanouskova Jan 13, 2024
c49dce0
[no ci] cancers: TODOs-surgical pkg
EvaJanouskova Jan 13, 2024
a82704e
bc: typos fixed
EvaJanouskova Jan 15, 2024
3d9a2c3
add equipment for measles HSI if treatment for pneumonia is given
tdm32 Nov 14, 2023
92d11cb
add in equipment use for schisto diagnosis
tdm32 Nov 14, 2023
de2a7c3
me: within HSI_Me_Treatment equip for me. with pneumonia updated only…
EvaJanouskova Dec 12, 2023
0111625
hs & alri+co: rename and correct return of fncs related to equipment
EvaJanouskova Jan 15, 2024
dc21979
hs: log equip item codes instead of names
EvaJanouskova Jan 16, 2024
cdaa44a
equip_catalogue: updated for logged equip item codes
EvaJanouskova Jan 17, 2024
287ee67
brc: change Andrew suggested
EvaJanouskova Jan 19, 2024
812a9e2
hs: updates for better readability; rm unused code
EvaJanouskova Jan 19, 2024
b70b2e4
hs: PEP8
EvaJanouskova Jan 19, 2024
8cd81d0
hs: get_equip_item_code_from_item_name fnc updated; ESS.EQUIP as codes
EvaJanouskova Jan 19, 2024
a7426b1
equip_catalogue: add item codes to catalogue by requested details (1 …
EvaJanouskova Jan 21, 2024
fc6bea2
hs: allow adding equip by pkg name(s)
EvaJanouskova Jan 21, 2024
1c987c3
co & RF_Equip: an example of usage of equipment pkg
EvaJanouskova Jan 21, 2024
38ff44c
utils: use pandas fnc (instead of make one)
EvaJanouskova Jan 24, 2024
e0132f8
hs: ESS_EQUIP as HSI_Event's attribute; if settings of ESS_EQUIP forg…
EvaJanouskova Jan 24, 2024
2859530
hs: fixed saving _hsi_event_names_missing_ess_equip
EvaJanouskova Jan 24, 2024
e5df950
hs: fixed updating _hsi_event_names_missing_ess_equip
EvaJanouskova Jan 29, 2024
5c66328
hs: TODO smt odd going on with hsi_event_names_missing_ess_equip warning
EvaJanouskova Jan 29, 2024
8daa621
hs: sort hsi_event_names_missing_ess_equip warning
EvaJanouskova Jan 29, 2024
1a69dca
hs: equip_item_and_package_code_lookups renamed to equip_item_and_pac…
EvaJanouskova Jan 29, 2024
42492fa
hs: ignore_unknown_equip_names
EvaJanouskova Jan 29, 2024
d0d2828
hs: warning messages shortened
EvaJanouskova Jan 30, 2024
d1c7523
tox: pytest-version-hotfix / TODO: revert once #1264 resolved
EvaJanouskova Jan 30, 2024
c317540
removed urine dipstick equipment (only consumable)
joehcollins Feb 1, 2024
e8bb6b7
removed comments. updated indication for equipment with antibiotic pr…
joehcollins Feb 1, 2024
32bb66b
update comments in rti
joehcollins Feb 1, 2024
6ace152
added endoscope and ECG to equipment resource file
joehcollins Feb 1, 2024
14ab62f
added endoscope equipment call to oesophageal_cancer.py
joehcollins Feb 1, 2024
41646c8
added ECG equipment to NCDs
joehcollins Feb 1, 2024
eac9f36
Merge remote-tracking branch 'origin/EvaJ/equipment/structure_ToRunSi…
EvaJanouskova Feb 5, 2024
5806bde
hs: update comment
EvaJanouskova Feb 5, 2024
f1f759e
modules: use v2 of equip structure
EvaJanouskova Feb 5, 2024
3093082
[no ci] modules: comments updated
EvaJanouskova Feb 5, 2024
caa3545
la & ri: comments updated
EvaJanouskova Feb 14, 2024
09b97cf
cmd: TODO surgical pkg
EvaJanouskova Feb 15, 2024
8993a5a
hsi_gen_1st_appts: empty equip declarations added
EvaJanouskova Feb 15, 2024
0b32685
RF_Equip: added Source_Equip_Item for Endoscope
EvaJanouskova Feb 15, 2024
3b1f8e5
rti fixes
joehcollins Feb 22, 2024
ff4d072
Add cystoscope, endoscope and prostate specific antigen test to consu…
Mar 5, 2024
4d8712f
Update the availability of Prostate specific antigen test
Mar 5, 2024
5209b33
TODO: some modules use equipment when talking about consumables
EvaJanouskova Sep 1, 2023
5158aa2
breast_cancer: dummy used_equipment added where Andrew requested
EvaJanouskova Sep 4, 2023
e554dd7
co: dummy used_equipment added for methods where Emi listed some
EvaJanouskova Sep 4, 2023
e4935e3
healthsystem: annual equipment summary log by fac. level
EvaJanouskova Sep 4, 2023
8b455bd
breast_cancer: mastectomy dummy equipment fixed
EvaJanouskova Sep 5, 2023
9f44e85
equipment_catalogue & utils: new script + a change in utils.py - to c…
EvaJanouskova Sep 6, 2023
0ff003b
equipment_catalogue: PEP8
EvaJanouskova Sep 7, 2023
f736939
healthsystem: sort equipment for log
EvaJanouskova Sep 12, 2023
745d4ab
equipment_catalogue: comment updated
EvaJanouskova Sep 12, 2023
e7c52d8
rti: unified use of consumables/equipment terms
EvaJanouskova Sep 12, 2023
b523d58
hs, brc, co: used_equipment renamed to EQUIPMENT; if equip always sam…
EvaJanouskova Sep 12, 2023
5396269
brc: comment updated
EvaJanouskova Sep 18, 2023
2791c18
brc & co: rm the dummy examples of equipment from modules
EvaJanouskova Sep 20, 2023
07e1ae9
RF_Equipment: equipment catalogue - first draft (from Sakshi)
EvaJanouskova Sep 24, 2023
00270c1
RF_Equipment: equipment catalogue - merge duplicates (round 1)
EvaJanouskova Sep 24, 2023
d486c4d
RF_Equipment: equipment catalogue - merge duplicates (round 2)
EvaJanouskova Sep 27, 2023
860d952
hs: debugging Equipment log - rm sorted
EvaJanouskova Sep 27, 2023
c573fc8
hs: fix sorting of _equip_by_level
EvaJanouskova Sep 27, 2023
373018c
RF_Equipment: equipment catalogue - merge duplicates (round 3)
EvaJanouskova Sep 27, 2023
307efab
RF_Equipment: equipment catalogue - merge duplicates (round 4)
EvaJanouskova Sep 27, 2023
4f2ce6c
RF_Equipment: equipment catalogue - merge duplicates (round 5)
EvaJanouskova Sep 29, 2023
10b9dde
RF_Equipment: equipment catalogue - merge duplicates (round 6) + col …
EvaJanouskova Nov 15, 2023
1f2ff79
RF_Equip: equip item codes added
EvaJanouskova Nov 15, 2023
adde374
codes_to_items_list: new script created
EvaJanouskova Nov 15, 2023
e6013d9
codes_to_items_list: script generalised + PEP 8
EvaJanouskova Nov 15, 2023
a214a88
hs: equipment added to HSIEventDetails
EvaJanouskova Nov 16, 2023
32145b6
equip_catalogue: make catalogues from new logging (equip included in …
EvaJanouskova Nov 17, 2023
d8e299f
hs: sort equipment for logging
EvaJanouskova Nov 19, 2023
598368d
test_hs: assert equipment logging within detailed_hsi_event
EvaJanouskova Nov 19, 2023
e2fdafb
[no ci] hs: typo; Equipment logging removed
EvaJanouskova Nov 23, 2023
acf3a63
equip_catalogue: fix the keys mapping to be done for each run
EvaJanouskova Dec 1, 2023
97f0f3f
equip_catalogue: input hsi event details by which to catalog equipment
EvaJanouskova Dec 2, 2023
1435d22
equip_catalogue: input time period by which to catalog equipment
EvaJanouskova Dec 2, 2023
14a11a7
equip_catalogue: list of requested details can be empty
EvaJanouskova Dec 2, 2023
6d85fe1
equip_catalogue: verify inputs as expected & set output file names in…
EvaJanouskova Dec 2, 2023
934e52d
equip_catalogue: (1) detailed - equip set as string in one row, modul…
EvaJanouskova Dec 6, 2023
bdbd8f7
equip_catalogue: suffix (as input) added for output file names
EvaJanouskova Dec 6, 2023
070454c
hs: structure v2; alri+co: examples to test new structure
EvaJanouskova Jan 13, 2024
99be34a
equip_catalogue: TODO added
EvaJanouskova Jan 13, 2024
5076e3b
equip_catalogue: typo
EvaJanouskova Dec 6, 2023
d47b53e
equip_catalogue: TODO added
EvaJanouskova Jan 13, 2024
057fb44
equip_catalogue: bug fixed
EvaJanouskova Jan 13, 2024
2bf3e8a
brc: TODO added
EvaJanouskova Jan 13, 2024
fa3380f
hs: rm prints
EvaJanouskova Jan 13, 2024
4b7904a
hs: rm old code
EvaJanouskova Jan 13, 2024
8c8bcc5
hs: rm/add accidentally added/rmd commas
EvaJanouskova Jan 13, 2024
6b03edd
hs & alri+co: rename and correct return of fncs related to equipment
EvaJanouskova Jan 15, 2024
c37e1de
hs: log equip item codes instead of names
EvaJanouskova Jan 16, 2024
99ad138
equip_catalogue: updated for logged equip item codes
EvaJanouskova Jan 17, 2024
a281e56
brc: change Andrew suggested
EvaJanouskova Jan 19, 2024
1787ffe
hs: updates for better readability; rm unused code
EvaJanouskova Jan 19, 2024
f961640
hs: PEP8
EvaJanouskova Jan 19, 2024
12142b0
hs: get_equip_item_code_from_item_name fnc updated; ESS.EQUIP as codes
EvaJanouskova Jan 19, 2024
36f0523
equip_catalogue: add item codes to catalogue by requested details (1 …
EvaJanouskova Jan 21, 2024
b40f955
hs: allow adding equip by pkg name(s)
EvaJanouskova Jan 21, 2024
9c8b6ad
co & RF_Equip: an example of usage of equipment pkg
EvaJanouskova Jan 21, 2024
0552e48
utils: use pandas fnc (instead of make one)
EvaJanouskova Jan 24, 2024
0106e20
hs: ESS_EQUIP as HSI_Event's attribute; if settings of ESS_EQUIP forg…
EvaJanouskova Jan 24, 2024
455f4e0
hs: fixed saving _hsi_event_names_missing_ess_equip
EvaJanouskova Jan 24, 2024
503036d
hs: fixed updating _hsi_event_names_missing_ess_equip
EvaJanouskova Jan 29, 2024
8ea0b27
hs: TODO smt odd going on with hsi_event_names_missing_ess_equip warning
EvaJanouskova Jan 29, 2024
7ad13cc
hs: sort hsi_event_names_missing_ess_equip warning
EvaJanouskova Jan 29, 2024
39a5d21
hs: equip_item_and_package_code_lookups renamed to equip_item_and_pac…
EvaJanouskova Jan 29, 2024
9dcf46b
hs: ignore_unknown_equip_names
EvaJanouskova Jan 29, 2024
0bda4d0
hs: warning messages shortened
EvaJanouskova Jan 30, 2024
fc273a0
RF_Equip: added Source_Equip_Item for Electrocardiogram
EvaJanouskova Mar 1, 2024
0289af3
RF_Cons_Items_and_Pkgs: reverted changes from script; Cystoscope, End…
EvaJanouskova Mar 5, 2024
f844535
Merge branch 'EvaJ/equipment/structure_ToRunSim' into equipment/integ…
EvaJanouskova Mar 6, 2024
bdb755c
modules: tidy up
EvaJanouskova Mar 6, 2024
bed404d
fix merge error in care_of_women_during_pregnancy.py
joehcollins Mar 7, 2024
7c69972
ac & hs: finish merge fix
EvaJanouskova Mar 7, 2024
0d387a4
co: example of setting ess. equip based on condition
EvaJanouskova Mar 21, 2024
b87781e
co: comment updated; TODO added
EvaJanouskova Mar 21, 2024
88632f6
co, hs, RF_Equip, RF_HS_params, test_alri, test_co, test_hs: checking…
EvaJanouskova Mar 21, 2024
d71107a
Merge branch 'master' into EvaJ/equipment/structure_ToRunSim
EvaJanouskova Mar 21, 2024
2518c49
Merge branch 'master' into EvaJ/equipment/structure_ToRunSim
tbhallett Mar 25, 2024
a6fffc9
example test suite
tbhallett Mar 25, 2024
8428d8a
typo and add todo
tbhallett Mar 25, 2024
2a3c8f8
further tests
tbhallett Mar 25, 2024
b1aa9ae
[no_ci] RF_Equip: availabilities changed from probs to True/False val…
EvaJanouskova Mar 25, 2024
ffd5178
ac: rm comments
EvaJanouskova Mar 26, 2024
7c8ea54
hs: rm equip_availability before sim default
EvaJanouskova Mar 26, 2024
6ddd11e
labour: rm comments
EvaJanouskova Mar 26, 2024
4f4d858
hs: rm extra line
EvaJanouskova Mar 26, 2024
f8b0ac1
hs: raise error if 1) ess equip not a set of ints, 2) invalid equip_a…
EvaJanouskova Mar 26, 2024
55772ed
Merge branch 'refs/heads/master' into EvaJ/equipment/structure_ToRunSim
tbhallett May 9, 2024
16752ae
roll back incidental changes
tbhallett May 9, 2024
cd2774e
move `codes_to_items_list` to scripts/data-file-processing
tbhallett May 9, 2024
7a5d991
roll back parsing script
tbhallett May 9, 2024
4781555
squash - basic outline of Equipment class
tbhallett May 9, 2024
27779e6
squash - basic outline of Equipment class
tbhallett May 10, 2024
1988ae2
linting
tbhallett May 10, 2024
13d5a3c
update call in bed-days
tbhallett May 10, 2024
3d4b80d
use hashable type in HSIEventDetails
tbhallett May 12, 2024
3bb2581
update logic and add docstring
tbhallett May 12, 2024
3c16898
linting
tbhallett May 13, 2024
5bcdb38
linting
tbhallett May 13, 2024
3bea20f
Merge branch 'master' into EvaJ/equipment/structure_ToRunSim
tbhallett May 13, 2024
3a8d3da
linting
tbhallett May 13, 2024
dc9d9b9
linting
tbhallett May 13, 2024
ea4027b
provide default for 'equip_availability' in test_alri:get_sim()
tbhallett May 13, 2024
b31b93f
Merge branch 'refs/heads/master' into equipment/integration_in_modules
tbhallett May 13, 2024
2dd360a
roll back incidental changes
tbhallett May 13, 2024
a306e24
remove calls to `self.set_equipment_essential_to_run_event({''})``
tbhallett May 13, 2024
faf2fa8
tidy-up and tag todos
tbhallett May 13, 2024
3be6e70
tidy-up cancer_consumables.py
tbhallett May 13, 2024
68c4da2
Merge branch 'refs/heads/EvaJ/equipment/structure_ToRunSim' into hall…
tbhallett May 13, 2024
8bcda48
temporarily make simulation shorter, smaller and with fewer draws to …
tbhallett May 13, 2024
0dd00c4
Revert "temporarily make simulation shorter, smaller and with fewer d…
tbhallett May 13, 2024
ce6a2d8
Merge branch 'refs/heads/master' into hallett/equipment_changes_and_s…
tbhallett May 16, 2024
d1c8699
roll back `codes_to_item_list.py`
tbhallett May 16, 2024
f566709
todo updates and minor fixes
joehcollins May 24, 2024
3bf93ac
Merge branch 'master' into hallett/equipment_changes_and_structure
EvaJanouskova May 28, 2024
56056d2
Merge branch 'refs/heads/master' into hallett/equipment_changes_and_s…
tbhallett May 31, 2024
135fc2e
equipment pkgs (#1378)
EvaJanouskova May 31, 2024
0d6fd8d
Merge branch 'refs/heads/master' into hallett/equipment_changes_and_s…
tbhallett Jun 6, 2024
b7c27c8
cancer_cons: joined screening cons for biopsy, cystoscopy and endosco…
EvaJanouskova Jun 6, 2024
1f1d94b
la: fix calling equipment from outside HSI_event
EvaJanouskova Jun 6, 2024
6c8c33d
pc: rm outdated todos
EvaJanouskova Jun 6, 2024
694da75
rti: both todo @joe moved to a comment in PR
EvaJanouskova Jun 6, 2024
7a27a1f
add surgical pkg to postnatal_supervisor.py
joehcollins Jun 10, 2024
310f6b4
Merge branch 'master' into hallett/equipment_changes_and_structure
tbhallett Jun 20, 2024
3bd3487
simplify parsing of package name
tbhallett Jun 20, 2024
f4aabca
put tests for using package name next to other tests to do with parsing
tbhallett Jun 20, 2024
88b6f59
allow spaces in Pkg_Names (don't remove all spaces, but instead strip…
tbhallett Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Git LFS file not shown
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@
.drop_duplicates() \
.pipe(lambda x: x.set_index(x['Item_code'].astype(int)))['Category'] \
.to_dict()
# Manually declare the price category for equipment items added manually
# 402: Endoscope: 'Cost >= $1000'
equipment_price_category_mapper[402] = 'Cost >= $1000'
# 403: Electrocardiogram: 'Cost >= $1000'
equipment_price_category_mapper[403] = 'Cost >= $1000'

tbhallett marked this conversation as resolved.
Show resolved Hide resolved
equipment_price_category = final_equipment_availability_export_full.index.get_level_values('Item_Code') \
.map(equipment_price_category_mapper)
final_equipment_availability_export_full = final_equipment_availability_export_full.groupby(
Expand Down
19 changes: 17 additions & 2 deletions src/tlo/methods/alri.py
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,8 @@ def _get_disease_classification_for_treatment_decision(self,
'chest_indrawing_pneumonia', (symptoms-based assessment)
'cough_or_cold' (symptoms-based assessment)
}."""
if use_oximeter:
self.add_equipment({'Pulse oximeter'})

child_is_younger_than_2_months = age_exact_years < (2.0 / 12.0)

Expand Down Expand Up @@ -2606,6 +2608,15 @@ def _try_treatment(antibiotic_indicated: Tuple[str], oxygen_indicated: bool) ->
oxygen_available = self._get_cons('Oxygen_Therapy')
oxygen_provided = (oxygen_available and oxygen_indicated)

# If individual is provided with oxygen, add used equipment
if oxygen_provided:
self.add_equipment({'Oxygen cylinder, with regulator', 'Nasal Prongs'})

# If individual is provided with intravenous antibiotics, add used equipment
if antibiotic_provided in ('1st_line_IV_antibiotics',
'Benzylpenicillin_gentamicin_therapy_for_severe_pneumonia'):
self.add_equipment({'Infusion pump', 'Drip stand'})

all_things_needed_available = antibiotic_available and (
(oxygen_available and oxygen_indicated) or (not oxygen_indicated)
)
Expand Down Expand Up @@ -2687,16 +2698,20 @@ def _provide_bronchodilator_if_wheeze(self, facility_level, symptoms):
if facility_level == '1a':
_ = self._get_cons('Inhaled_Brochodilator')
else:
# n.b. this is never called, see issue 1172
_ = self._get_cons('Brochodilator_and_Steroids')

def do_on_follow_up_following_treatment_failure(self):
"""Things to do for a patient who is having this HSI following a failure of an earlier treatment.
A further drug will be used but this will have no effect on the chance of the person dying."""

if self._has_staph_aureus():
_ = self._get_cons('2nd_line_Antibiotic_therapy_for_severe_staph_pneumonia')
cons_avail = self._get_cons('2nd_line_Antibiotic_therapy_for_severe_staph_pneumonia')
else:
_ = self._get_cons('Ceftriaxone_therapy_for_severe_pneumonia')
cons_avail = self._get_cons('Ceftriaxone_therapy_for_severe_pneumonia')

if cons_avail:
self.add_equipment({'Infusion pump', 'Drip stand'})

def apply(self, person_id, squeeze_factor):
"""Assess and attempt to treat the person."""
Expand Down
24 changes: 13 additions & 11 deletions src/tlo/methods/bladder_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,14 +725,14 @@ def apply(self, person_id, squeeze_factor):
return hs.get_blank_appt_footprint()

# Check consumables are available
# TODO: replace with cystoscope
cons_avail = self.get_consumables(item_codes=self.module.item_codes_bladder_can['screening_biopsy_core'],
optional_item_codes=
self.module.item_codes_bladder_can['screening_biopsy_optional'])
cons_avail = self.get_consumables(item_codes=self.module.item_codes_bladder_can['screening_cystoscopy_core'],
optional_item_codes=self.module.item_codes_bladder_can[
'screening_biopsy_endoscopy_cystoscopy_optional'])

if cons_avail:
# Use a biopsy to diagnose whether the person has bladder Cancer
# If consumables are available, run the dx_test representing the biopsy
# If consumables are available update the use of equipment and run the dx_test representing the biopsy
self.add_equipment({'Cystoscope', 'Ordinary Microscope', 'Ultrasound scanning machine'})

# Use a cystoscope to diagnose whether the person has bladder Cancer:
dx_result = hs.dx_manager.run_dx_test(
Expand Down Expand Up @@ -798,14 +798,14 @@ def apply(self, person_id, squeeze_factor):
return hs.get_blank_appt_footprint()

# Check consumables are available
# TODO: replace with cystoscope
cons_avail = self.get_consumables(item_codes=self.module.item_codes_bladder_can['screening_biopsy_core'],
cons_avail = self.get_consumables(item_codes=self.module.item_codes_bladder_can['screening_cystoscopy_core'],
optional_item_codes=self.module.item_codes_bladder_can[
'screening_biopsy_optional'])
'screening_biopsy_endoscopy_cystoscopy_optional'])

if cons_avail:
# Use a biopsy to diagnose whether the person has bladder Cancer
# If consumables are available, run the dx_test representing the biopsy
# If consumables are available log the use of equipment and run the dx_test representing the biopsy
self.add_equipment({'Cystoscope', 'Ordinary Microscope', 'Ultrasound scanning machine'})

# Use a cystoscope to diagnose whether the person has bladder Cancer:
dx_result = hs.dx_manager.run_dx_test(
Expand Down Expand Up @@ -894,7 +894,8 @@ def apply(self, person_id, squeeze_factor):
self.module.item_codes_bladder_can['treatment_surgery_optional'])

if cons_avail:
# If consumables are available and the treatment will go ahead
# If consumables are available and the treatment will go ahead - update the equipment
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# Record date and stage of starting treatment
df.at[person_id, "bc_date_treatment"] = self.sim.date
Expand Down Expand Up @@ -998,7 +999,8 @@ def apply(self, person_id, squeeze_factor):
item_codes=self.module.item_codes_bladder_can['palliation'])

if cons_available:
# If consumables are available and the treatment will go ahead
# If consumables are available and the treatment will go ahead - update the equipment
self.add_equipment({'Infusion pump', 'Drip stand'})

# Record the start of palliative care if this is first appointment
if pd.isnull(df.at[person_id, "bc_date_palliative_care"]):
Expand Down
15 changes: 9 additions & 6 deletions src/tlo/methods/breast_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,13 @@ def apply(self, person_id, squeeze_factor):
# Check consumables to undertake biopsy are available
cons_avail = self.get_consumables(item_codes=self.module.item_codes_breast_can['screening_biopsy_core'],
optional_item_codes=
self.module.item_codes_breast_can['screening_biopsy_optional'])
self.module.item_codes_breast_can[
'screening_biopsy_endoscopy_cystoscopy_optional'])

if cons_avail:
# Use a biopsy to diagnose whether the person has breast Cancer
# If consumables are available, run the dx_test representing the biopsy
# If consumables are available, add the used equipment and run the dx_test representing the biopsy
self.add_equipment({'Ultrasound scanning machine', 'Ordinary Microscope'})

dx_result = hs.dx_manager.run_dx_test(
dx_tests_to_run='biopsy_for_breast_cancer_given_breast_lump_discernible',
Expand Down Expand Up @@ -764,8 +766,6 @@ def apply(self, person_id, squeeze_factor):
df = self.sim.population.props
hs = self.sim.modules["HealthSystem"]

# todo: request consumables needed for this

if not df.at[person_id, 'is_alive']:
return hs.get_blank_appt_footprint()

Expand Down Expand Up @@ -798,7 +798,9 @@ def apply(self, person_id, squeeze_factor):
)

if cons_available:
# If consumables, treatment will go ahead
# If consumables are available and the treatment will go ahead - add the used equipment
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# Log the use of adjuvant chemotherapy
self.get_consumables(
item_codes=self.module.item_codes_breast_can['treatment_chemotherapy'],
Expand Down Expand Up @@ -906,7 +908,8 @@ def apply(self, person_id, squeeze_factor):
item_codes=self.module.item_codes_breast_can['palliation'])

if cons_available:
# If consumables are available and the treatment will go ahead
# If consumables are available and the treatment will go ahead - add the used equipment
self.add_equipment({'Infusion pump', 'Drip stand'})

# Record the start of palliative care if this is first appointment
if pd.isnull(df.at[person_id, "brc_date_palliative_care"]):
Expand Down
24 changes: 5 additions & 19 deletions src/tlo/methods/cancer_consumables.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ def get_consumable_item_codes_cancers(self) -> Dict[str, int]:
cons_dict = dict()

# Add items that are needed for all cancer modules
cons_dict['screening_biopsy_core'] = \
{get_item_code("Biopsy needle"): 1}

cons_dict['screening_biopsy_optional'] = \
cons_dict['screening_biopsy_endoscopy_cystoscopy_optional'] = \
{get_item_code("Specimen container"): 1,
get_item_code("Lidocaine HCl (in dextrose 7.5%), ampoule 2 ml"): 1,
get_item_code("Gauze, absorbent 90cm x 40m_each_CMST"): 30,
get_item_code("Disposables gloves, powder free, 100 pieces per box"): 1,
get_item_code("Syringe, needle + swab"): 1}

cons_dict['screening_biopsy_core'] = \
{get_item_code("Biopsy needle"): 1}

cons_dict['treatment_surgery_core'] = \
{get_item_code("Halothane (fluothane)_250ml_CMST"): 100,
get_item_code("Scalpel blade size 22 (individually wrapped)_100_CMST"): 1}
Expand Down Expand Up @@ -69,23 +69,9 @@ def get_consumable_item_codes_cancers(self) -> Dict[str, int]:
cons_dict['screening_cystoscopy_core'] = \
{get_item_code("Cystoscope"): 1}

cons_dict['screening_cystoscope_optional'] = \
{get_item_code("Specimen container"): 1,
get_item_code("Lidocaine HCl (in dextrose 7.5%), ampoule 2 ml"): 1,
get_item_code("Gauze, absorbent 90cm x 40m_each_CMST"): 30,
get_item_code("Disposables gloves, powder free, 100 pieces per box"): 1,
get_item_code("Syringe, needle + swab"): 1}

elif 'OesophagealCancer' == self.name:

cons_dict['screening_endoscope_core'] = \
cons_dict['screening_endoscopy_core'] = \
{get_item_code("Endoscope"): 1}

cons_dict['screening_endoscope_optional'] = \
{get_item_code("Specimen container"): 1,
get_item_code("Gauze, absorbent 90cm x 40m_each_CMST"): 30,
get_item_code("Lidocaine HCl (in dextrose 7.5%), ampoule 2 ml"): 1,
get_item_code("Disposables gloves, powder free, 100 pieces per box"): 1,
get_item_code("Syringe, needle + swab"): 1}

return cons_dict
19 changes: 19 additions & 0 deletions src/tlo/methods/cardio_metabolic_disorders.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,7 @@ def apply(self, person_id, squeeze_factor):
return hs.get_blank_appt_footprint()

# Run a test to diagnose whether the person has condition:
self.add_equipment({'Blood pressure machine'})
dx_result = hs.dx_manager.run_dx_test(
dx_tests_to_run='assess_hypertension',
hsi_event=self
Expand Down Expand Up @@ -1487,6 +1488,9 @@ def do_for_each_condition(self, _c) -> bool:
if df.at[person_id, f'nc_{_c}_ever_diagnosed']:
return

if _c == 'chronic_ischemic_heart_disease':
self.add_equipment({'Electrocardiogram', 'Stethoscope'})

# Run a test to diagnose whether the person has condition:
dx_result = hs.dx_manager.run_dx_test(
dx_tests_to_run=f'assess_{_c}',
Expand Down Expand Up @@ -1519,6 +1523,11 @@ def apply(self, person_id, squeeze_factor):
return hs.get_blank_appt_footprint()

# Do test and trigger treatment (if necessary) for each condition:
if set(self.conditions_to_investigate).intersection(
['diabetes', 'chronic_kidney_disease', 'chronic_ischemic_hd']
):
self.add_equipment({'Analyser, Haematology', 'Analyser, Combined Chemistry and Electrolytes'})

hsi_scheduled = [self.do_for_each_condition(_c) for _c in self.conditions_to_investigate]

# If no follow-up treatment scheduled but the person has at least 2 risk factors, start weight loss treatment
Expand All @@ -1542,6 +1551,7 @@ def apply(self, person_id, squeeze_factor):
and (self.module.rng.rand() < self.module.parameters['hypertension_hsi']['pr_assessed_other_symptoms'])
):
# Run a test to diagnose whether the person has condition:
self.add_equipment({'Blood pressure machine'})
dx_result = hs.dx_manager.run_dx_test(
dx_tests_to_run='assess_hypertension',
hsi_event=self
Expand Down Expand Up @@ -1589,6 +1599,8 @@ def apply(self, person_id, squeeze_factor):

# Don't advise those with CKD to lose weight, but do so for all other conditions if BMI is higher than normal
if self.condition != 'chronic_kidney_disease' and (df.at[person_id, 'li_bmi'] > 2):
self.add_equipment({'Weighing scale'})

self.sim.population.props.at[person_id, 'nc_ever_weight_loss_treatment'] = True
# Schedule a post-weight loss event for individual to potentially lose weight in next 6-12 months:
self.sim.schedule_event(CardioMetabolicDisordersWeightLossEvent(m, person_id),
Expand Down Expand Up @@ -1749,6 +1761,12 @@ def do_for_each_event_to_be_investigated(self, _ev):
df = self.sim.population.props

# Run a test to diagnose whether the person has condition:
if _ev == 'ever_stroke':
self.add_equipment({'Computed Tomography (CT machine)', 'CT scanner accessories'})

if _ev == 'ever_heart_attack':
self.add_equipment({'Electrocardiogram'})

dx_result = self.sim.modules['HealthSystem'].dx_manager.run_dx_test(
dx_tests_to_run=f'assess_{_ev}',
hsi_event=self
Expand Down Expand Up @@ -1808,6 +1826,7 @@ def apply(self, person_id, squeeze_factor):
data=('This is HSI_CardioMetabolicDisorders_SeeksEmergencyCareAndGetsTreatment: '
f'The squeeze-factor is {squeeze_factor}.'),
)
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('ICU'))

for _ev in self.events_to_investigate:
self.do_for_each_event_to_be_investigated(_ev)
Expand Down
Loading