-
Notifications
You must be signed in to change notification settings - Fork 7
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
Cervical cancer #1287
Open
andrew-phillips-1
wants to merge
256
commits into
master
Choose a base branch
from
cervical_cancer_
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,943
−24
Open
Cervical cancer #1287
Changes from 1 commit
Commits
Show all changes
256 commits
Select commit
Hold shift + click to select a range
0393e17
.
andrew-phillips-1 bc1ac59
.
andrew-phillips-1 5a66e5d
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 b24c6bd
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 cc488bd
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 144644a
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 f1015b5
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 f2b44b0
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 0d06e44
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 c964058
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 1b0226b
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 fdcea86
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 7f13653
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 356973c
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 91efced
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 443401b
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 9e60e5c
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 8f5e8f0
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 5464169
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 86a503f
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 242de2c
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 77a2808
first pass at cervical cancer module based on editing breast cancer m…
andrew-phillips-1 41b9743
HSIs
andrew-phillips-1 0fe0ee1
HSIs
andrew-phillips-1 b3d77af
HSIs
andrew-phillips-1 b242de7
HSIs
andrew-phillips-1 9ed44ac
HSIs
andrew-phillips-1 41d1152
HSIs
andrew-phillips-1 fdbd1ac
HSIs
andrew-phillips-1 38e34e3
HSIs
andrew-phillips-1 c665214
HSIs
andrew-phillips-1 4470892
HSIs
andrew-phillips-1 e6008cf
Merge branch 'master' into cervical_cancer_
andrew-phillips-1 90bbbb9
HSIs
andrew-phillips-1 7beb619
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 b42dea3
.
andrew-phillips-1 0a3f2d6
.
andrew-phillips-1 ee6e3c1
.
andrew-phillips-1 12f312f
.
andrew-phillips-1 a4cfcc8
.
andrew-phillips-1 e30fa14
.
andrew-phillips-1 28ffe64
.
andrew-phillips-1 416027c
Merge remote-tracking branch 'origin/master'
andrew-phillips-1 cae6c2c
.
andrew-phillips-1 6007b2a
.
andrew-phillips-1 5b67b62
.
andrew-phillips-1 68f14cc
.
andrew-phillips-1 de34cc5
.
andrew-phillips-1 6a27f52
.
andrew-phillips-1 ca8a1f5
.
andrew-phillips-1 01398e9
.
andrew-phillips-1 3e4508b
Merge branch 'refs/heads/master' into cervical_cancer_
tbhallett e30044f
refactor to use `do_at_generic_first_appt` on the module
tbhallett 2c53eb2
roll back changes to healthsystem.py
tbhallett 9138a01
roll back changes to hiv.py
tbhallett 73682ea
cleaning up files
tbhallett 445b6b3
cleaning up files
tbhallett d727856
.
andrew-phillips-1 8dcc0e6
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
andrew-phillips-1 6f25468
Merge remote-tracking branch 'origin/master' into cervical_cancer_
andrew-phillips-1 910a080
HSIs restructured with Screening HSI
thewati e81857e
HSIs restructured with Screening HSI
thewati 890b245
.
andrew-phillips-1 eef200f
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 00b5944
.
andrew-phillips-1 381a307
Merge branch 'master' into cervical_cancer_
thewati 23724e8
restructured HSIs again within module
thewati 5373f3a
.
andrew-phillips-1 2d96458
.
andrew-phillips-1 7673ed0
Accessing consumables and analyses using logger
thewati 1501739
.
andrew-phillips-1 680be51
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
andrew-phillips-1 0e60aa3
Accessing consumables from cancer_consumables.py
thewati 519ca33
Rollback to using csv file in analyses
thewati 5e648e9
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
andrew-phillips-1 b3a4202
.
andrew-phillips-1 e574a13
.
andrew-phillips-1 4ecf108
.
andrew-phillips-1 e8bcffe
.
andrew-phillips-1 ed8602d
.
andrew-phillips-1 91475a4
.
andrew-phillips-1 15e2df9
.
andrew-phillips-1 ffe10d8
.
andrew-phillips-1 c357295
.
andrew-phillips-1 66ad5f5
.
andrew-phillips-1 f3a9d24
.
andrew-phillips-1 5284d9e
.
andrew-phillips-1 3a58fa4
.
andrew-phillips-1 563cff7
.
andrew-phillips-1 ea1e540
.
andrew-phillips-1 7ba6797
.
andrew-phillips-1 f92de78
temporary rollback to using xpert and via as symptoms
thewati fa8ee61
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 4fad45a
.
andrew-phillips-1 8e605b8
.
andrew-phillips-1 1d1a19d
.
andrew-phillips-1 2743ade
create function for plotting
mmsuarezcosta 402e5a1
adjust proportion plotting
mmsuarezcosta 2299c8f
ensure original and new logging capabilities coexist in same file
mmsuarezcosta f7971d6
add year variation for screening and testing
mmsuarezcosta 7bfb2ba
edit parameters
mmsuarezcosta 7706c01
edit sign direction, should be VIA if before '24'
mmsuarezcosta 1d8e786
remove hard coding
mmsuarezcosta dcd9270
add hash documentation
mmsuarezcosta d35718f
delete import of random
mmsuarezcosta 0349109
delete import of random
mmsuarezcosta e8821b9
ensure all random instances associated with self
mmsuarezcosta a2dddc0
set seed non-hardcoded
mmsuarezcosta f244070
hash for testing
mmsuarezcosta c814528
merge in changes from updated cervical_cancer branch
mmsuarezcosta 63c22e5
update variable name, improve rng
mmsuarezcosta d19e617
edit to ensure screening with dates for via and xpert
mmsuarezcosta c413fc6
Merge branch 'master' into cervical_cancer_
thewati 9c5cf13
comment out hash
mmsuarezcosta bb1ddd8
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
mmsuarezcosta 3b09512
comment out hash
mmsuarezcosta bb2642c
remove entire df broadcasting to only alive and can't override previo…
mmsuarezcosta 843e184
remove entire df broadcasting to only alive and can't override previo…
mmsuarezcosta 0eb4871
revert to 2025
mmsuarezcosta ec94bbe
comment out hash
mmsuarezcosta 1b705f4
comment out hash
mmsuarezcosta 1ce601b
Rollback _initialised Simulation object
thewati 5d69604
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
mmsuarezcosta 8263482
address new stage in one line
mmsuarezcosta 5ee1ae4
spread out death days
mmsuarezcosta 9ef7c8d
fix indexing
mmsuarezcosta a0b2b12
fix indexing
mmsuarezcosta a520791
add new fts
mmsuarezcosta 1b7016d
add variables, add prob for via
mmsuarezcosta e77278f
improve for readability
mmsuarezcosta 9a57fcb
update out statement to assess entire population
mmsuarezcosta 2a9e18c
set screening age as variable
mmsuarezcosta 1bd4268
initialize screening to F
mmsuarezcosta 130fee0
remove duplicate
mmsuarezcosta ce4fa2e
30d marker
mmsuarezcosta 4329d8a
out updates
mmsuarezcosta 4985355
force to be in stage4 for palliative care -- previously if 'None' was…
mmsuarezcosta 61e537d
change from symptoms to selection in polling
thewati 5cf3315
change to jan to avoid 2x initialization of population
mmsuarezcosta bc3ec13
delete HSI_CervicalCancer_Screening, not used
mmsuarezcosta eeefe7d
change diagnoses stages to only be stage 1 to 4
mmsuarezcosta 2a49fcc
change diagnoses stages to only be stage 1 to 4
mmsuarezcosta a81d5ec
add 'none' to ce_stage_at_diagnosis
mmsuarezcosta 201c2eb
repeated screening and cin procedure in functions
mmsuarezcosta 13e0900
adjust biopsy logic
mmsuarezcosta f181070
remove hard coding, start setting parametrs
mmsuarezcosta dc4d263
rename for clarity
mmsuarezcosta 7cc3342
adjust cerv cancer consumables
mmsuarezcosta da0ca1d
removing hard coding and adding todos
mmsuarezcosta 02c6f53
set eligible population based on hiv criteria
mmsuarezcosta b6e5a49
set eligible population based on hiv criteria
mmsuarezcosta 212bb6c
behavior based on hv diagnosis rather than inherent property
mmsuarezcosta a12fe17
palliative care fix
mmsuarezcosta ade941b
update cancer consumables
mmsuarezcosta 9625665
remove hard coding
mmsuarezcosta 63677bb
equipment and consumables
mmsuarezcosta 8ee9c70
remove hard code
mmsuarezcosta 5326af8
change screening conditions
mmsuarezcosta d419bd2
remove hard coding of params and move to ResourceFile_Cervical_Cancer…
mmsuarezcosta e7a9b9a
remove hard coding of params and move to ResourceFile_Cervical_Cancer…
mmsuarezcosta fea6310
remove hard coding of params and move to ResourceFile_Cervical_Cancer…
mmsuarezcosta 8a7cf3e
.
andrew-phillips-1 81e1daf
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 12a308b
add comments and remove completed todos
mmsuarezcosta 23b0240
replace min_age_hv with min_age_hpv
mmsuarezcosta 758fa41
replace min_age_hv with min_age_hpv
mmsuarezcosta 926633b
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 9ba2bb9
.
andrew-phillips-1 62def2b
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
mmsuarezcosta 0e3361b
set ce_date_cin_removal if thermoablation or cryotherapy successful
mmsuarezcosta 714f230
Merge branch 'master' into cervical_cancer_
thewati 1f3d2d8
replace cervical_cancer file w the original one
mmsuarezcosta 185ecde
not used
mmsuarezcosta 4802ab9
not used
mmsuarezcosta 012bdcd
not used
mmsuarezcosta b1c6db3
need to ensure treatment occurred
mmsuarezcosta 81a0b09
add consumables for biopsy
mmsuarezcosta c85db36
fix to ensure CIN treatment pursued if not in Stage cancer
mmsuarezcosta 8648c8c
do biopsy if biopsy has not been done before
mmsuarezcosta 3971e47
do biopsy if biopsy has not been done before
mmsuarezcosta 998c0f8
fix output file
mmsuarezcosta cb15ecd
additional tests
mmsuarezcosta ed32c08
revert resource file
mmsuarezcosta 10c32e2
fix indenting
mmsuarezcosta 905735e
comment out the 2024 + tests so that it runs in reasonable time
mmsuarezcosta c7124d5
merge
thewati 4d19b79
remove commented out csv
thewati 1d39d90
fix some screening logic
mmsuarezcosta 43a21c0
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
mmsuarezcosta 58f3b7c
replace with function
mmsuarezcosta d50753d
biopsy only if stage 1+
mmsuarezcosta 8a0d983
fix the tests and clean code
mmsuarezcosta baf4ede
update logic for min years between screening
mmsuarezcosta 46be8d4
improved documentation
mmsuarezcosta 2c29fa9
code clean up
mmsuarezcosta abbf7a1
.
andrew-phillips-1 9be93d2
.
andrew-phillips-1 f78733e
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 16e5cc7
Merge branch 'master' into cervical_cancer_
thewati 68e87b5
comment clarity
mmsuarezcosta 1164682
udpate cervical cancer file with parameter of minimized screening win…
mmsuarezcosta 9ad9687
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
mmsuarezcosta aea457f
test commit - remove space
mmsuarezcosta 52de860
add comments
mmsuarezcosta bc598c1
clean code and add comments for readability
mmsuarezcosta f3aa9c1
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 248b468
Remove hash DF, flag that need to only plot with log and move away fr…
mmsuarezcosta eb59e52
improve comments/readability of tests
mmsuarezcosta e20be10
fix dxtest name
mmsuarezcosta f5a4e4e
.
andrew-phillips-1 1d34917
Merge branch 'cervical_cancer_' of https://github.com/UCL/TLOmodel in…
andrew-phillips-1 e0c117c
.
andrew-phillips-1 89b48db
.
andrew-phillips-1 ac3b861
updates to consumables and equipment
joehcollins 10afb02
reverting to master .github
thewati 0e9c35e
reverting to master
thewati b33cec9
Merge branch 'master' into cervical_cancer_
thewati 2e2c483
Merge remote-tracking branch 'origin/cervical_cancer_' into cervical_…
thewati 58c3922
remove unwanted files
thewati bd3317e
update cancer cons
thewati e3a909e
remove cervical cancer from 'other' given it has its own module
mmsuarezcosta 6e24798
cervical_cancer.py linting
mmsuarezcosta 14a593b
cervical_cancer_analysis.py linting
mmsuarezcosta 7cd9e79
cervical_cancer_test.py linting
mmsuarezcosta ead5cb7
isort
mmsuarezcosta 32791bd
lint changes that pass tests
mmsuarezcosta 817d15d
link changes, also comment out out_csv
mmsuarezcosta 339c06a
add color for cervical cancer in graph
mmsuarezcosta 243d953
add cervical cancer color
mmsuarezcosta ec351f2
change cervical cancer color to mediumturquoise
mmsuarezcosta 79d7d06
add color for cervical cancer in CAUSE_OF_DEATH_OR_DALY_LABEL_TO_COLO…
mmsuarezcosta b18a74e
change readcsv
mmsuarezcosta 4ce6962
remove param definition at top of file and add to resourcefile
mmsuarezcosta c4de745
remove screen_pop function since only used 1x
mmsuarezcosta 26f5911
change cin procuedure to class that can be used throughout other clas…
mmsuarezcosta b41f0c2
added cerv cancer to bottom of each priority doc, modeled priority ba…
mmsuarezcosta 2777ff7
del unused variables
mmsuarezcosta 07f47b0
update consumables -- change some requirements to optional and change…
mmsuarezcosta 9859bed
LLETZ Machines for thermoablation and Cryotherapy Unit for cryo
mmsuarezcosta dab92b1
LLETZ Machines for thermoablation and Cryotherapy Unit for cryo
mmsuarezcosta d21b9c8
update consumable chemo alternative options
mmsuarezcosta 4fe0280
add eq. comment for future cahnge to Thermoablation Device
mmsuarezcosta 2607b63
add cerv cancer write-up
mmsuarezcosta 30e9cb1
Merge branch 'master' into cervical_cancer_
tbhallett 249ffe7
definition and type changes
mmsuarezcosta 4bdf8a8
initialize parameters related to hiv at the start
mmsuarezcosta 1061c30
add predictors
mmsuarezcosta 002547f
remove code duplication
mmsuarezcosta d073bb9
remove check_configuration_of_population because force changes for th…
mmsuarezcosta 3512612
create batch event, fix parmeters, remove ce_date_death removed and o…
mmsuarezcosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
HSIs
commit 41b9743eda2871ed318355209bc5d5ca2dc092d2
There are no files selected for viewing
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -74,14 +74,9 @@ def __init__(self, name=None, resourcefilepath=None): | |||||
Types.LIST, | ||||||
"initial proportions in hpv cancer categories in women without hiv" | ||||||
), | ||||||
# currently these two below are just added as vaccine efficacy implictly takes account of whether hpv is vaccine preventable | ||||||
"r_vp_hpv": Parameter( | ||||||
"r_hpv": Parameter( | ||||||
Types.REAL, | ||||||
"probabilty per month of incident vaccine preventable hpv infection", | ||||||
), | ||||||
"r_nvp_hpv": Parameter( | ||||||
Types.REAL, | ||||||
"probabilty per month of incident non-vaccine preventable hpv infection", | ||||||
"probabilty per month of oncogenic hpv infection", | ||||||
), | ||||||
"r_cin1_hpv": Parameter( | ||||||
Types.REAL, | ||||||
|
@@ -333,13 +328,11 @@ def initialise_simulation(self, sim): | |||||
p = self.parameters | ||||||
lm = self.linear_models_for_progression_of_hpv_cc_status | ||||||
|
||||||
rate_hpv = p['r_nvp_hpv'] + p['r_vp_hpv'] | ||||||
|
||||||
# todo: mend hiv unsuppressed effect | ||||||
|
||||||
lm['hpv'] = LinearModel( | ||||||
LinearModelType.MULTIPLICATIVE, | ||||||
rate_hpv, | ||||||
p['r_hpv'], | ||||||
Predictor('va_hpv') | ||||||
.when(1, p['rr_hpv_vaccinated']) | ||||||
.when(2, p['rr_hpv_vaccinated']), | ||||||
|
@@ -491,7 +484,7 @@ def initialise_simulation(self, sim): | |||||
) | ||||||
|
||||||
self.sim.modules['HealthSystem'].dx_manager.register_dx_test( | ||||||
screening_with_xpert_for_hpv_and_cervical_cancer=DxTest( | ||||||
screening_with_via_for_cin_and_cervical_cancer=DxTest( | ||||||
property='ce_hpv_cc_status', | ||||||
sensitivity=self.parameters['sensitivity_of_via_for_cin_cc'], | ||||||
target_categories=["hpv", "cin1", "cin2", "cin3", "stage1", "stage2a", "stage2b", "stage3", "stage4"] | ||||||
|
@@ -705,54 +698,129 @@ def apply(self, population): | |||||
# I assume similar to how we schedule vaccinations | ||||||
|
||||||
|
||||||
class HSI_CervicalCancer_Investigation_Following_vaginal_bleeding(HSI_Event, IndividualScopeEventMixin): | ||||||
class HSI_CervicalCancer_AceticAcidScreening(HSI_Event, IndividualScopeEventMixin): | ||||||
|
||||||
# todo: make this event scheduled by contraception module | ||||||
""" | ||||||
This event is scheduled by HSI_GenericFirstApptAtFacilityLevel1 following presentation for care with the symptom | ||||||
vaginal bleeding. | ||||||
This event begins the investigation that may result in diagnosis of cervical Cancer and the scheduling of | ||||||
treatment or palliative care. | ||||||
It is for people with the symptom vaginal_bleeding. | ||||||
This event will be scheduled by family planning HSI - for now we determine at random a screening event | ||||||
and we determine at random whether this is AceticAcidScreening or HPVXpertScreening | ||||||
""" | ||||||
|
||||||
def __init__(self, module, person_id): | ||||||
super().__init__(module, person_id=person_id) | ||||||
|
||||||
# print(person_id, self.sim.date, 'vaginal_bleeding_hsi_called -1') | ||||||
self.TREATMENT_ID = "CervicalCancer_AceticAcidScreening" | ||||||
self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Over5OPD": 1}) | ||||||
self.ACCEPTED_FACILITY_LEVEL = '1a' | ||||||
|
||||||
def apply(self, person_id, squeeze_factor): | ||||||
df = self.sim.population.props | ||||||
person = df.loc[person_id] | ||||||
hs = self.sim.modules["HealthSystem"] | ||||||
|
||||||
# Ignore this event if the person is no longer alive: | ||||||
if not person.is_alive: | ||||||
return hs.get_blank_appt_footprint() | ||||||
|
||||||
# Run a test to diagnose whether the person has condition: | ||||||
dx_result = hs.dx_manager.run_dx_test( | ||||||
dx_tests_to_run='screening_with_via_for_cin_and_cervical_cancer', | ||||||
hsi_event=self | ||||||
) | ||||||
|
||||||
self.TREATMENT_ID = "CervicalCancer_Investigation" | ||||||
df.at[person_id, 'ce_date_last_via_screen'] = self.sim.date | ||||||
|
||||||
if dx_result: | ||||||
hs.schedule_hsi_event( | ||||||
hsi_event=HSI_CervicalCancer_Biopsy( | ||||||
module=self.module, | ||||||
person_id=person_id | ||||||
), | ||||||
priority=0, | ||||||
topen=self.sim.date, | ||||||
tclose=None | ||||||
) | ||||||
|
||||||
|
||||||
class HSI_CervicalCancer_XpertHPVcreening(HSI_Event, IndividualScopeEventMixin): | ||||||
|
||||||
# todo: make this event scheduled by contraception module | ||||||
""" | ||||||
This event will be scheduled by family planning HSI - for now we determine at random a screening event | ||||||
and we determine at random whether this is AceticAcidScreening or HPVXpertScreening | ||||||
""" | ||||||
|
||||||
def __init__(self, module, person_id): | ||||||
super().__init__(module, person_id=person_id) | ||||||
|
||||||
self.TREATMENT_ID = "CervicalCancer_XpertHPVScreening" | ||||||
self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Over5OPD": 1}) | ||||||
self.ACCEPTED_FACILITY_LEVEL = '3' | ||||||
self.ACCEPTED_FACILITY_LEVEL = '1a' | ||||||
|
||||||
def apply(self, person_id, squeeze_factor): | ||||||
df = self.sim.population.props | ||||||
person = df.loc[person_id] | ||||||
hs = self.sim.modules["HealthSystem"] | ||||||
|
||||||
# Ignore this event if the person is no longer alive: | ||||||
if not df.at[person_id, 'is_alive']: | ||||||
if not person.is_alive: | ||||||
return hs.get_blank_appt_footprint() | ||||||
|
||||||
# print(person_id, self.sim.date, 'vaginal_bleeding_hsi_called -2') | ||||||
# todo add to diagnostic tests | ||||||
# Run a test to diagnose whether the person has condition: | ||||||
dx_result = hs.dx_manager.run_dx_test( | ||||||
dx_tests_to_run='screening_with_xpert_for_hpv', | ||||||
hsi_event=self | ||||||
) | ||||||
|
||||||
# Check that this event has been called for someone with the symptom vaginal_bleeding | ||||||
assert 'vaginal_bleeding' in self.sim.modules['SymptomManager'].has_what(person_id) | ||||||
df.at[person_id, 'ce_date_last_xpert_screen'] = self.sim.date | ||||||
|
||||||
# If the person is already diagnosed, then take no action: | ||||||
# if not pd.isnull(df.at[person_id, "ce_date_diagnosis"]): | ||||||
# return hs.get_blank_appt_footprint() | ||||||
if dx_result: | ||||||
hs.schedule_hsi_event( | ||||||
hsi_event=HSI_CervicalCancer_Biopsy( | ||||||
module=self.module, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
you have initialised this already |
||||||
person_id=person_id | ||||||
), | ||||||
priority=0, | ||||||
topen=self.sim.date, | ||||||
tclose=None | ||||||
) | ||||||
|
||||||
|
||||||
class HSI_CervicalCancer_Biopsy(HSI_Event, IndividualScopeEventMixin): | ||||||
|
||||||
def __init__(self, module, person_id): | ||||||
super().__init__(module, person_id=person_id) | ||||||
|
||||||
# print(person_id, self.sim.date, 'vaginal_bleeding_hsi_called -1') | ||||||
|
||||||
# df.loc[person_id, 'ce_vaginal_bleeding_investigated'] = True | ||||||
self.TREATMENT_ID = "CervicalCancer_Biopsy" | ||||||
|
||||||
self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Over5OPD": 1}) | ||||||
self.ACCEPTED_FACILITY_LEVEL = '3' | ||||||
|
||||||
def apply(self, person_id, squeeze_factor): | ||||||
df = self.sim.population.props | ||||||
hs = self.sim.modules["HealthSystem"] | ||||||
|
||||||
# Ignore this event if the person is no longer alive: | ||||||
if not df.at[person_id, 'is_alive']: | ||||||
return hs.get_blank_appt_footprint() | ||||||
andrew-phillips-1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
# Use a biopsy to diagnose whether the person has cervical cancer | ||||||
# todo: request consumables needed for this | ||||||
|
||||||
dx_result = hs.dx_manager.run_dx_test( | ||||||
dx_tests_to_run='biopsy_for_cervical_cancer_given_vaginal_bleeding', | ||||||
dx_tests_to_run='biopsy_for_cervical_cancer', | ||||||
hsi_event=self | ||||||
) | ||||||
|
||||||
if dx_result: | ||||||
# record date of diagnosis: | ||||||
if dx_result and (df.at[person_id, 'ce_hpv_cc_status'] == 'stage1' | ||||||
or df.at[person_id, 'ce_hpv_cc_status'] == 'stage2a' | ||||||
or df.at[person_id, 'ce_hpv_cc_status'] == 'stage2b' | ||||||
or df.at[person_id, 'ce_hpv_cc_status'] == 'stage3' | ||||||
or df.at[person_id, 'ce_hpv_cc_status'] == 'stage4'): | ||||||
# Record date of diagnosis: | ||||||
df.at[person_id, 'ce_date_diagnosis'] = self.sim.date | ||||||
df.at[person_id, 'ce_stage_at_diagnosis'] = df.at[person_id, 'ce_hpv_cc_status'] | ||||||
|
||||||
|
@@ -784,6 +852,40 @@ def apply(self, person_id, squeeze_factor): | |||||
tclose=None | ||||||
) | ||||||
|
||||||
# person has cin detected with via | ||||||
if dx_result and (df.at[person_id, 'ce_hpv_cc_status'] == 'cin1' | ||||||
or df.at[person_id, 'ce_hpv_cc_status'] == 'cin2' | ||||||
or df.at[person_id, 'ce_hpv_cc_status'] == 'cin3' | ||||||
): | ||||||
# start treatment: | ||||||
hs.schedule_hsi_event( | ||||||
hsi_event=HSI_CervicalCancer_Cryotherapy_CIN( | ||||||
module=self.module, | ||||||
person_id=person_id | ||||||
), | ||||||
priority=0, | ||||||
topen=self.sim.date, | ||||||
tclose=None | ||||||
) | ||||||
|
||||||
# todo: add condition that they are Xpert positive | ||||||
if ~dx_result and (df.at[person_id, 'ce_hpv_cc_status'] == 'hpv' | ||||||
): | ||||||
# start treatment: | ||||||
hs.schedule_hsi_event( | ||||||
hsi_event=HSI_CervicalCancer_Cryotherapy_CIN( | ||||||
module=self.module, | ||||||
person_id=person_id | ||||||
), | ||||||
priority=0, | ||||||
topen=self.sim.date, | ||||||
tclose=None | ||||||
) | ||||||
|
||||||
|
||||||
# todo: define Cryotherapy HSI | ||||||
|
||||||
|
||||||
class HSI_CervicalCancer_StartTreatment(HSI_Event, IndividualScopeEventMixin): | ||||||
""" | ||||||
This event is scheduled by HSI_CervicalCancer_Investigation_Following_vaginal_bleeding following a diagnosis of | ||||||
|
@@ -1100,8 +1202,8 @@ def apply(self, population): | |||||
|
||||||
print(out) | ||||||
|
||||||
# selected_columns = ['sy_vaginal_bleeding', 'ce_cc_ever'] | ||||||
# selected_rows = df[(df['sex'] == 'F') & (df['age_years'] > 15) & (df['sy_vaginal_bleeding'] == 2)] | ||||||
# selected_columns = ['va_hpv', 'ce_cc_ever'] | ||||||
# selected_rows = df[(df['sex'] == 'F') & (df['age_years'] > 15)] | ||||||
# print(selected_rows[selected_columns]) | ||||||
|
||||||
|
||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some equipment declaration needed for this (and others?) HSI_Events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I will be talking to Joe about that