Commit 36cadc8
Add equipment to copd, epilepsy and cancer modules (#1706)
* Add comprehensive equipment to disease modules with facility-level dependencies
- Cancer modules (breast, prostate, bladder, oesophageal, other adult cancers):
* Added facility-level dependent equipment based on column H specifications
* Equipment includes imaging (X-ray, ultrasound), laboratory analysis, and cancer-specific tools
* Probabilities vary by facility level (1a=community, 1b+=hospitals)
- COPD module:
* Added moderate exacerbation treatment HSI with respiratory equipment
* Incentive spirometers (100% availability) and blood gas analyzers (facility-dependent)
* Enhanced severe exacerbation equipment with respiratory support tools
- Epilepsy module:
* Added comprehensive rehabilitation equipment for severe epilepsy cases
* Pediatric-specific equipment for children with epilepsy
* Assessment tools, mobility aids, and physiotherapy equipment
- Fixed equipment codes:
* 454 202 (X-ray machine)
* 453 161 (Ultrasound scanning machine)
All equipment codes validated against ResourceFile_EquipmentCatalogue.csv
* Simplify equipment allocation across cancer treatment modules
- Remove probability-based equipment allocation conditions
- Convert equipment codes to descriptive names
- Consolidate multiple add_equipment() calls into single calls
- Focus on 'ever use' approach for facility planning
- Applies to: bladder_cancer, breast_cancer, copd, epilepsy, oesophagealcancer, other_adult_cancers, prostate_cancer
Addresses PR feedback to eliminate hard-coded probability parameters.
* Remove unnecessary random number generation and magic number probabilities
- Remove all instances of 'if self.module.rng.random() < 1.0:' (100% probability)
- Combine multiple equipment additions into single calls for efficiency
- Simplify equipment allocation by removing always-true conditional checks
- Addresses PR reviewer feedback about magic numbers and random generation
Files updated:
- prostate_cancer.py: Fixed 4 instances of unnecessary random checks
- oesophagealcancer.py: Fixed 1 instance for safety equipment
- other_adult_cancers.py: Fixed 1 instance for safety equipment
* Address reviewer feedback: use equipment names, combine add_equipment calls, remove random probabilities
- Replace numeric equipment codes with descriptive names (e.g., {50} -> 'Safety Goggles')
- Combine multiple add_equipment() calls into single statements for better readability
- Remove all random number generation and magic number probabilities from HSI equipment allocation
- Maintain 'if equipment is ever used, it should be available' philosophy per reviewer guidance
Fixes issues in:
- other_adult_cancers.py: Combined equipment calls in palliative care HSI
- prostate_cancer.py: Removed random probabilities, combined equipment statements, used names
- oesophagealcancer.py: Removed all random equipment allocation, used equipment names
---------
Co-authored-by: Tim Hallett <[email protected]>1 parent 6198ef2 commit 36cadc8
File tree
7 files changed
+416
-17
lines changed- src/tlo/methods
7 files changed
+416
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
737 | 746 | | |
738 | 747 | | |
739 | 748 | | |
| |||
806 | 815 | | |
807 | 816 | | |
808 | 817 | | |
809 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
810 | 828 | | |
811 | 829 | | |
812 | 830 | | |
| |||
899 | 917 | | |
900 | 918 | | |
901 | 919 | | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
902 | 933 | | |
903 | 934 | | |
904 | 935 | | |
| |||
942 | 973 | | |
943 | 974 | | |
944 | 975 | | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
945 | 987 | | |
946 | 988 | | |
947 | 989 | | |
| |||
1002 | 1044 | | |
1003 | 1045 | | |
1004 | 1046 | | |
1005 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1006 | 1057 | | |
1007 | 1058 | | |
1008 | 1059 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
708 | 727 | | |
709 | 728 | | |
710 | 729 | | |
| |||
802 | 821 | | |
803 | 822 | | |
804 | 823 | | |
| 824 | + | |
805 | 825 | | |
806 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
807 | 850 | | |
808 | 851 | | |
809 | 852 | | |
| |||
852 | 895 | | |
853 | 896 | | |
854 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
855 | 917 | | |
856 | 918 | | |
857 | 919 | | |
| |||
913 | 975 | | |
914 | 976 | | |
915 | 977 | | |
916 | | - | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
917 | 998 | | |
918 | 999 | | |
919 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
232 | 242 | | |
233 | 243 | | |
234 | 244 | | |
| |||
541 | 551 | | |
542 | 552 | | |
543 | 553 | | |
544 | | - | |
545 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
546 | 557 | | |
547 | 558 | | |
548 | 559 | | |
| |||
552 | 563 | | |
553 | 564 | | |
554 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
555 | 590 | | |
556 | 591 | | |
557 | 592 | | |
| |||
590 | 625 | | |
591 | 626 | | |
592 | 627 | | |
593 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
594 | 641 | | |
595 | 642 | | |
596 | 643 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
640 | 655 | | |
641 | 656 | | |
642 | 657 | | |
| |||
703 | 718 | | |
704 | 719 | | |
705 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
706 | 766 | | |
707 | 767 | | |
708 | 768 | | |
| |||
0 commit comments