Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1377,9 +1377,9 @@ HTML_STYLESHEET =
# documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_EXTRA_STYLESHEET = docs/doxygen-awesome-css/doxygen-awesome.css \
docs/doxygen-awesome-css/doxygen-awesome-sidebar-only.css \
docs/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css \
HTML_EXTRA_STYLESHEET = @AWESOME_CSS_DIR@/doxygen-awesome.css \
@AWESOME_CSS_DIR@/doxygen-awesome-sidebar-only.css \
@AWESOME_CSS_DIR@/doxygen-awesome-sidebar-only-darkmode-toggle.css \
docs/src/custom.css

# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
Expand Down
50 changes: 50 additions & 0 deletions docs/images/mermaid/pregnancy.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
%%{init: {
"theme": "base",
"themeVariables": {
"background": "#000000",
"primaryColor": "#4299e1",
"primaryTextColor": "#ffffff",
"primaryBorderColor": "#1a365d",
"lineColor": "#4299e1",
"secondaryColor": "#4299e1",
"tertiaryColor": "#4299e1",
"edgeLabelBackground": "#000000",
"edgeLabelColor": "#4299e1"
}
}}%%
flowchart TD
%% linkStyle default stroke:#4299e1,stroke-width:3px
start([Pregnancy::Execute]) ==> alive{"Is person alive, female, and older than 180 months?"}
alive == "No" ==> return([Return])
alive == "Yes" ==> old_age{"Is person older than 540 months and not pregnant/postpartum?"}
old_age == "Yes" ==> return_old_age([Return])
old_age == "No" ==> restricted_window{"Is person in a restricted postpartum (e.g. < 3 months since birth)?"}
restricted_window == "Yes" ==> return_restricted([Return])
restricted_window == "No" ==> pregnant{"Is person pregnant?"}
pregnant == "Yes" ==> gestation{"At least 9 months since conception?"}
gestation == "No" ==> return_gestation([Return])
gestation == "Yes" ==> stillbirth{"Is pregnancy a stillbirth?"}

stillbirth == "Yes" ==> stillbirth_action["Stillbirth: increment stillbirths; set restricted postpartum"]
stillbirth_action ==> return_stillbirth([Return])
stillbirth == "No" ==> delivery["Sample number of births: one or two"]
delivery ==> child_loop["For each child"]
child_loop ==> chronic_hcv{"Mother has chronic HCV?"}
chronic_hcv == "No" ==> make_child["Make child: no HCV, not tested"]
chronic_hcv == "Yes" ==> exposure["Add infant HCV exposure"]
exposure ==> tested{"Infant is tested?"}
tested == "Yes" ==> infection["Sample vertical HCV infection; make tested child"]
tested == "No" ==> no_test_infection["Sample vertical HCV infection; make untested child"]
make_child ==> birth["Birth: record child; state becomes restricted postpartum"]
infection ==> birth
no_test_infection ==> birth
birth ==> another_child{"More children?"}
another_child == "Yes" ==> child_loop
another_child == "No" ==> return_birth([Return])

pregnant == "No" ==> age_limit{"Age > 540 months?"}
age_limit == "Yes" ==> return_age([Return])
age_limit == "No" ==> conception{"Is person impregnated?"}
conception == "No" ==> return_no_conception([Return])
conception == "Yes" ==> impregnate["Impregnate: increment pregnancy count; set pregnant"]
impregnate ==> return_conception([Return])
Binary file added docs/images/png/pregnancy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/src/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ HCV treatment focuses on actually treating patients for HCV. As such, it deals w
src="hcv-treatment.png"
/>

## Pregnancy

Pregnancy is a new state to the original HEP-CE model. It accounts for confounding pregnancy details including pregnancy, post-partum, and infant HCV diagnoses.

<img
class="flowchart"
src="pregnancy.png"
/>

## Overdose

Overdose focuses on all type overdoses for patients. We delegate the fatality functionality to the Death event, but instead focus exclusively on the impacts of all overdoses in this event. The primary function of this event loads data from the `overdose` table and then samples a decision based on the provided probability. If overdose occurs, then cost and utility is updated, if not nothing occurs.
Expand Down
52 changes: 28 additions & 24 deletions extras/examples/inputs.db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ CREATE TABLE "population" (
FOREIGN KEY("death_reasons") REFERENCES "death_reasons"("id"),
FOREIGN KEY("drug_behavior") REFERENCES "drug_behaviors"("id"),
FOREIGN KEY("hcv") REFERENCES "hcv_states"("id"),
FOREIGN KEY("fibrosis_state") REFERENCES "fibrosis_diagnosis_states"("id"),
FOREIGN KEY("fibrosis_state") REFERENCES "fibrosis_states"("id"),
FOREIGN KEY("moud_state") REFERENCES "moud"("id"),
FOREIGN KEY("pregnancy_state") REFERENCES "pregnancy_states"("id"),
FOREIGN KEY("measured_fibrosis_state") REFERENCES "fibrosis_diagnosis_states"("id"),
Expand Down Expand Up @@ -200,16 +200,16 @@ CREATE TABLE "fibrosis" (
"fib4" REAL NOT NULL,
PRIMARY KEY("fibrosis_state","diagnosed_fibrosis"),
FOREIGN KEY("diagnosed_fibrosis") REFERENCES "fibrosis_diagnosis_states"("id"),
FOREIGN KEY("fibrosis_state") REFERENCES "fibrosis_real_states"("id")
FOREIGN KEY("fibrosis_state") REFERENCES "fibrosis_states"("id")
);
DROP TABLE IF EXISTS "fibrosis_diagnosis_states";
CREATE TABLE "fibrosis_diagnosis_states" (
"id" INTEGER NOT NULL UNIQUE,
"state" TEXT NOT NULL,
PRIMARY KEY("id")
);
DROP TABLE IF EXISTS "fibrosis_real_states";
CREATE TABLE "fibrosis_real_states" (
DROP TABLE IF EXISTS "fibrosis_states";
CREATE TABLE "fibrosis_states" (
"id" INTEGER NOT NULL UNIQUE,
"state" TEXT NOT NULL,
PRIMARY KEY("id")
Expand All @@ -221,7 +221,7 @@ CREATE TABLE "hcv_impacts" (
"cost" REAL NOT NULL DEFAULT 0.0,
"utility" REAL NOT NULL,
PRIMARY KEY("hcv_status","fibrosis_state"),
FOREIGN KEY("fibrosis_state") REFERENCES "fibrosis_real_states"("id"),
FOREIGN KEY("fibrosis_state") REFERENCES "fibrosis_states"("id"),
FOREIGN KEY("hcv_status") REFERENCES "bool_lookup"("id")
);
DROP TABLE IF EXISTS "hcv_states";
Expand Down Expand Up @@ -252,7 +252,8 @@ CREATE TABLE "init_cohort" (
"fibrosis_state" INT,
"identified_as_hcv_positive" INT,
"link_state" INT,
"hcv_status" INT
"hcv_status" INT,
"pregnancy_state" INT
);
DROP TABLE IF EXISTS "link_states";
CREATE TABLE "link_states" (
Expand Down Expand Up @@ -288,14 +289,18 @@ CREATE TABLE "pregnancy_states" (
);
DROP TABLE IF EXISTS "screening_and_linkage";
CREATE TABLE "screening_and_linkage" (
"age_years" INT,
"gender" INT,
"drug_behavior" INT,
"pregnancy" INT,
"background_screen_probability" REAL,
"background_link_probability" REAL,
"intervention_screen_probability" REAL,
"intervention_link_probability" REAL
"age_years" INT NOT NULL,
"gender" INT NOT NULL,
"drug_behavior" INT NOT NULL,
"pregnancy" INT NOT NULL,
"background_screen_probability" REAL NOT NULL,
"background_link_probability" REAL NOT NULL,
"intervention_screen_probability" REAL NOT NULL,
"intervention_link_probability" REAL NOT NULL,
PRIMARY KEY("age_years", "gender", "drug_behavior", "pregnancy")
FOREIGN KEY("drug_behavior") REFERENCES "drug_behaviors"("id"),
FOREIGN KEY("gender") REFERENCES "sex"("id"),
FOREIGN KEY("pregnancy") REFERENCES "pregnancy_states"("id")
);
DROP TABLE IF EXISTS "sex";
CREATE TABLE "sex" (
Expand All @@ -321,16 +326,15 @@ CREATE TABLE "treatment_initiations" (
);
DROP TABLE IF EXISTS "treatments";
CREATE TABLE "treatments" (
"salvage" INT,
"genotype_three" INT,
"cirrhotic" INT,
"course" NUMERIC,
"duration" INT,
"cost" REAL,
"svr_prob_if_completed" REAL,
"toxicity_prob_if_withdrawal" REAL,
"withdrawal" REAL,
"toxicity_prob" REAL
"salvage" INT NOT NULL,
"genotype_three" INT NOT NULL,
"cirrhotic" INT NOT NULL,
"course" NUMERIC NOT NULL,
"duration" INT NOT NULL,
"cost" REAL NOT NULL,
"svr_prob_if_completed" REAL NOT NULL,
"toxicity_prob_if_withdrawal" REAL NOT NULL,
"withdrawal" REAL NOT NULL
);
CREATE TABLE IF NOT EXISTS "moud_transitions" (
"age_years" INTEGER NOT NULL,
Expand Down
13 changes: 9 additions & 4 deletions extras/examples/sim.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ use_population_table = true

# A list of the discrete events to be used - order matters
# Type: comma-separated strings
# Default: Aging, BehaviorChanges, Clearance, FibrosisProgression, HCVInfection,
# HCVScreening, HCVLinking, VoluntaryRelinking, FibrosisStaging, HCVTreatment,
# Death
events = Aging, BehaviorChanges, Clearance, FibrosisProgression, HCVInfection, HCVScreening, HCVLinking, FibrosisStaging, HCVTreatment, Death
# Default: Aging, Pregnancy, BehaviorChanges, Clearance, FibrosisProgression,
# HCVInfection, HCVScreening, HCVLinking, VoluntaryRelinking, FibrosisStaging,
# HCVTreatment, Death
events = Aging, Pregnancy, BehaviorChanges, Clearance, FibrosisProgression, HCVInfection, HCVScreening, HCVLinking, FibrosisStaging, HCVTreatment, Death

# The number of months for the simulation to run
# Due to age restrictions, anything >=1200 is equivalent
Expand Down Expand Up @@ -345,6 +345,11 @@ tox_cost = 147.66
# Type: float
tox_utility = 0.21

[pregnancy]
multiple_delivery_probability = 0.03283
infant_hcv_tested_probability = 0.4
vertical_hcv_transition_probability = 0.08

# This section governs general costing information throughout the simulation
[cost]
# The amount that costs are discounted in the model; scales such that earlier
Expand Down
Loading