-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSimContext.h
More file actions
2529 lines (2261 loc) · 96 KB
/
Copy pathSimContext.h
File metadata and controls
2529 lines (2261 loc) · 96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
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
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
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
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include "include.h"
/**
SimContext class contains all the natural history information needed for running
simulations. Contains functions to read all the necessary information from an input file.
Data is read into subclasses that correspond to the tabs on the input sheet. Read only
access to this is information is provided through public accessor functions that return const
pointers to these classes.
*/
class SimContext
{
public:
/* Constructors and Destructor */
SimContext(string runName);
~SimContext(void);
int counter;
/* Misc cohort and simulation constants */
/** The maximum number of years that could be lived by a patient */
static const int AGE_YRS = 101;
/** The youngest patient age possible (for life tables) */
static const int AGE_STARTING = 0;
/** The oldest patient age possible (for life tables) */
static const int AGE_MAXIMUM = 100;
/** The number of age categories */
static const int AGE_CATEGORIES = 20;
/** The number of age strata for custom age dist */
static const int INIT_AGE_NUM_STRATA = 30;
/** The size of SimContext::GENDER_TYPE */
static const int GENDER_NUM = 2;
/** The specific genders available */
enum GENDER_TYPE {GENDER_MALE, GENDER_FEMALE};
/** Strings correlated with SimContext::GENDER_TYPE */
static const char *GENDER_STRS[];
/** The size of SimContext::BOUNDS_TYPE */
static const int NUM_BOUNDS = 2;
/** The number of discount rates */
static const int NUM_DISCOUNT_RATES = 4;
/**The number of age categories for for art start policy in peds*/
static const int NUM_ART_START_CD4PERC_PEDS=4;
/** The bounds calculated */
enum BOUNDS_TYPE {LOWER_BOUND, UPPER_BOUND};
/**Conditionals */
enum CONDITIONS_TYPE {AND,OR};
/**Directions */
enum DIRECTIONS_TYPE {LEFT,RIGHT};
/** The number of generic risk factors used by the model */
static const int RISK_FACT_NUM = 5;
/** string labels for the generic risk factors */
static char RISK_FACT_STRS[RISK_FACT_NUM][32];
/** The type of longitudinal summary recording available: none, detailed monthly, brief monthly, detailed yearly */
enum LONGIT_SUMM_TYPE {LONGIT_SUMM_NONE, LONGIT_SUMM_MTH_DET, LONGIT_SUMM_MTH_BRF, LONGIT_SUMM_YR_DET};
/** A constant used for null values */
static const int NOT_APPL = -1;
/** The maximum number of patients allowed to be traced - may be temporarily increased for specific projects if deemed necessary */
static const int MAX_NUM_TRACES = 100;
/** The number of patients to be traced in the trace file (max 100 -- may be modified by GUI or input file input) */
static int numPatientsToTrace;
/** The maximum number of subcohorts allowed*/
static const int MAX_NUM_SUBCOHORTS = 25;
/** The number of transmission risk groups */
static const int TRANSM_RISK_NUM = 3;
/** The transmission risk groups */
enum TRANSM_RISK {TRANSM_RISK_MSM, TRANSM_RISK_IDU, TRANSM_RISK_OTHER};
/** Strings correlated with SimContext::TRANSM_RISK */
static const char *TRANSM_RISK_STRS[];
/** The number of transmission risk age categories */
static const int TRANSM_RISK_AGE_NUM = 7;
/** The number of output age categories */
static const int OUTPUT_AGE_CAT_NUM = 14;
static const char *OUTPUT_AGE_CAT_STRS[];
/* CD4 and HVL strata constants */
/** The size of SimContext::CD4_STRATA */
static const int CD4_NUM_STRATA = 6;
/** The CD4 strata */
enum CD4_STRATA {CD4_VLO, CD4__LO, CD4_MLO, CD4_MHI, CD4__HI, CD4_VHI};
/** Strings corresponding to SimContext::CD4_STRATA */
static const char *CD4_STRATA_STRS[];
/** The size of SimContext::PEDS_CD4_AGE_CAT */
static const int PEDS_CD4_AGE_CAT_NUM = 2;
/** The CD4 metric age categories */
enum PEDS_CD4_AGE_CAT {CD4_PERC, CD4_ABSOLUTE};
/** The size of SimContext::HVL_STRATA */
static const int HVL_NUM_STRATA = 7;
/** The viral load strata */
enum HVL_STRATA {HVL_VLO, HVL__LO, HVL_MLO, HVL_MED, HVL_MHI, HVL__HI, HVL_VHI};
/** Strings corresponding to SimContext::HVL_STRATA */
static const char *HVL_STRATA_STRS[];
/** The midpoints of the HVL strata corresponding to SimContext::HVL_STRATA */
static const double HVL_STRATA_MIDPTS[];
/** A constant fixing suppressed viral load to HVL__LO */
static const int HVL_SUPPRESSION = HVL__LO;
/* OI and cause of death constants */
/** The number of OIs */
static const int OI_NUM = 15;
/** All availabled OIs */
enum OI_TYPE {OI_1, OI_2, OI_3, OI_4, OI_5, OI_6, OI_7, OI_8,
OI_9, OI_10, OI_11, OI_12, OI_13, OI_14, OI_15, OI_NONE};
/** Strings corresponding to SimContext::OI_TYPE from RunSpecs input tab, RunSpecs E20-E34 */
static char OI_STRS[OI_NUM][32]; // from RunSpecs input tab, RunSpecs E20-E34
/** The size of SimContext::DTH_CAUSES */
static const int DTH_NUM_CAUSES = 38;
/** Number of basic death causes (OIs, background mortality and HIV only) */
static const int DTH_NUM_CAUSES_BASIC = 17;
/** Enum of the death causes */
enum DTH_CAUSES {DTH_OI_1, DTH_OI_2, DTH_OI_3, DTH_OI_4, DTH_OI_5, DTH_OI_6,
DTH_OI_7, DTH_OI_8, DTH_OI_9, DTH_OI_10, DTH_OI_11, DTH_OI_12, DTH_OI_13,
DTH_OI_14, DTH_OI_15, DTH_HIV, DTH_BKGD_MORT, DTH_ACTIVE_TB,
DTH_TOX_ART, DTH_TOX_PROPH, DTH_TOX_TB_PROPH, DTH_TOX_TB_TREATM, DTH_TOX_INFANT_HIV_PROPH,
DTH_CHRM_1, DTH_CHRM_2, DTH_CHRM_3, DTH_CHRM_4, DTH_CHRM_5, DTH_CHRM_6, DTH_CHRM_7, DTH_CHRM_8, DTH_CHRM_9, DTH_CHRM_10,
DTH_RISK_1, DTH_RISK_2, DTH_RISK_3, DTH_RISK_4, DTH_RISK_5};
/** Strings corresponding to SimContext::DTH_CAUSES filled in with OIs and CHRMs */
static char DTH_CAUSES_STRS[DTH_NUM_CAUSES][32]; // filled in with OIs and CHRMs
/** Enum of the PSA background mortality modifier types */
enum BACKGROUND_MORT_MOD_TYPES {MORT_MOD_INCREMENTAL, MORT_MOD_MULT};
/** Size of SimContext::HIST_TYPE */
static const int HIST_NUM = 2;
/** The number of types of OI history (yes or no) */
enum HIST_TYPE {HIST_N, HIST_Y};
/** The size of SimContext::HIST_EXT_NUM */
static const int HIST_EXT_NUM = 3;
/** Enum of the extent of OI histories: no history of OIs in history, patient has a history of mild OIs and no severe OIs, patient has a history of at least one severe OI */
enum HIST_EXT {
HIST_EXT_N, // no history of OI's in history
HIST_EXT_MILD, // patient has a history of mild OIs, and no severe OIs
HIST_EXT_SEVR // patient has a history of at least one severe OI
};
/** Strings corresponding to SimContext::HIST_EXT */
static const char *HIST_OI_CATS_STRS[];
/** This class keeps track of an individual mortality risk */
class MortalityRisk {
public:
/** The cause of death for this risk */
DTH_CAUSES causeOfDeath;
/** The death rate ratio for this risk */
double deathRateRatio;
/** The cost accrued if this death occurs */
double costDeath;
};
/* CHRMs constants */
static const int CHRM_NUM = 10;
enum CHRM_TYPE {CHRM_1, CHRM_2, CHRM_3, CHRM_4, CHRM_5, CHRM_6, CHRM_7, CHRM_8, CHRM_9, CHRM_10};
static char CHRM_STRS[CHRM_NUM][32]; // from CHRMs input tab, CHRMs B4-B7
static const int CHRM_AGE_CAT_NUM = 7;
static const char *CHRM_AGE_CAT_STRS[];
static const int CHRM_TIME_PER_NUM = 3;
static const int CHRM_ORPHANS_AGE_CAT_NUM = 15;
static const int CHRM_ORPHANS_OUTPUT_AGE_CAT_NUM = 19;
/* Cost tab constants */
static const int COST_AGE_CAT_NUM = 7;
/* Cost Stats constants */
static const int LINKAGE_STATS_AGE_CAT_NUM = 9;
static const char *LINKAGE_STATS_AGE_CAT_STRS[];
static const int COST_REPORT_DISCOUNT_NUM = 2;
enum COST_REPORT_DISCOUNT{COST_REPORT_DISCOUNTED, COST_REPORT_UNDISCOUNTED};
//Subgroups of population for reporting cost statistics
static const int COST_SUBGROUPS_NUM = 13;
enum COST_SUBGROUPS{COST_SUBGROUP_ALL, COST_SUBGROUP_HIV_NEGATIVE, COST_SUBGROUP_HIV_POSITIVE,
COST_SUBGROUP_PRE_LINKAGE,COST_SUBGROUP_INCARE_NOT_ON_ART, COST_SUBGROUP_ON_ART, COST_SUBGROUP_LTFU_AFTER_ART,
COST_SUBGROUP_LTFU_NEVER_ON_ART, COST_SUBGROUP_RTC_AFTER_ART,COST_SUBGROUP_ON_ART_NEVER_LOST, COST_SUBGROUP_ON_ART_FIRST_SIX_MONTHS,
COST_SUBGROUP_FIRST_LINE_ART, COST_SUBGROUP_SECOND_LINE_OR_HIGHER};
static const char *COST_SUBGROUPS_STRS[];
//Strata of CD4 for reporting in cost statistics
static const int COST_CD4_STRATA_NUM = 8;
enum COST_CD4_STRATA {COST_CD4_VLO, COST_CD4__LO, COST_CD4_MLO, COST_CD4_MHI, COST_CD4__HI, COST_CD4_VHI, COST_CD4_NONE, COST_CD4_ALL};
static const char *COST_CD4_STRATA_STRS[];
/*Peds Cost constants */
static const int PEDS_COST_AGE_CAT_NUM = 4;
enum PEDS_COST_AGE{PEDS_COST_AGE_1,PEDS_COST_AGE_2,PEDS_COST_AGE_3,PEDS_COST_AGE_4,PEDS_COST_AGE_ADULT};
/*Peds ART cost categories*/
static const int PEDS_ART_COST_AGE_CAT_NUM=6;
enum PEDS_ART_COST_AGE{PEDS_ART_COST_AGE_5MTH, PEDS_ART_COST_AGE_11MTH, PEDS_ART_COST_AGE_2YR, PEDS_ART_COST_AGE_4YR, PEDS_ART_COST_AGE_7YR, PEDS_ART_COST_AGE_12YR, PEDS_ART_COST_AGE_ADULT};
/* Treatment and therapy constants */
/** The size of SimContext::CLINIC_VISITS */
static const int CLINIC_VISITS_NUM = 3;
/** The different types of clinic visits */
enum CLINIC_VISITS {
/** attend clinic only if initial visit or if on ART or OI proph */
CLINIC_INITIAL,
/** attend clinic if acute OI, or if initial visit, or if on ART or OI proph */
CLINIC_INIT_ACUTE,
/** always attend clinic visits if scheduled, or if acute OI, or if on ART or OI proph */
CLINIC_SCHED
};
/** Strings corresponding to SimContext::CLINIC_VISITS */
static const char* CLINIC_VISITS_STRS[];
/** The size of SimContext::THERAPY_IMPL */
static const int THERAPY_IMPL_NUM = 3;
/** An enum of therapy implementation types: patient type never implementing ART or OI prophylaxis,
* patient type implementing OI proph but not ART, and patient type implementing OI proph and ART
*/
enum THERAPY_IMPL {
THERAPY_IMPL_NONE, // patient type never implementing ART or OI prophylaxis
THERAPY_IMPL_PROPH, // patient type implementing OI proph but not ART
THERAPY_IMPL_PROPH_ART // patient type implementing OI proph and ART
};
/** The different types of emergencies that can trigger clinic visits - if no emergency then it is a regular visit **/
enum EMERGENCY_TYPE {
EMERGENCY_OI, // emergency clinic visit triggered by an acute OI
EMERGENCY_TEST, // emergency clinic visit triggered by a CD4 or HVL test
EMERGENCY_ART, // emergency clinic visit related to ART (failure, stop, etc.)
EMERGENCY_PROPH, // emergency clinic visit related to OI prophylaxis
EMERGENCY_NONE // non-emergency ("regular") clinic visit
};
/** Strings corresponding to the emergencies in SimContext::EMERGENCY_TYPE (for trace output; non-emergencies not currently included) */
static const char* EMERGENCY_TYPE_STRS[];
/** The size of SimContext::RTC_COEFF */
static const int RTC_NUM_COEFF = 5;
/** An enum of the return-to-care regression coefficients */
enum RTC_COEFF {RTC_BACKGROUND, RTC_CD4, RTC_ACUTESEVEREOI, RTC_ACUTEMILDOI, RTC_TBPOS};
/** The lost-to-follow up states: never lost, currently lost, returned from lost */
enum LTFU_STATE {LTFU_STATE_NONE, LTFU_STATE_LOST, LTFU_STATE_RETURNED};
/* Heterogeneity constants */
/** The size of SimContext::RESP_TYPE */
static const int RESP_NUM_TYPES = 3;
/** An enum of heterogeneity response types */
enum RESP_TYPE {RESP_TYPE_FULL, RESP_TYPE_PARTIAL, RESP_TYPE_NON};
/** Strings corresponding to SimContext::RESP_TYPE */
static const char *RESP_TYPE_STRS[];
/**size of SimContext::HET_OUTCOME */
static const int HET_NUM_OUTCOMES = 10;
/** An enum of heterogeneity outcome types*/
enum HET_OUTCOME{HET_OUTCOME_SUPP,HET_OUTCOME_LATEFAIL,HET_OUTCOME_ARTEFFECT_OI,HET_OUTCOME_ARTEFFECT_CHRMS,HET_OUTCOME_ARTEFFECT_MORT,HET_OUTCOME_RESIST,HET_OUTCOME_TOX,HET_OUTCOME_COST,HET_OUTCOME_RESTART,HET_OUTCOME_RESUPP};
/** Strings corresponding to SimContexxt::HET_OUTCOME*/
static const char *HET_OUTCOME_STRS[];
/** The number of heterogeneity age categories */
static const int RESP_AGE_CAT_NUM = 7;
/** An enum of the possible distributions for ART specific heterogeneity regression coefficients */
enum HET_ART_LOGIT_DISTRIBUTION{HET_ART_LOGIT_DISTRIBUTION_NORMAL, HET_ART_LOGIT_DISTRIBUTION_TRUNC_NORMAL, HET_ART_LOGIT_DISTRIBUTION_SQROOT};
/** The number of Intervention periods */
static const int HET_INTV_NUM_PERIODS = 5;
/* ART and Prophylaxis constants */
/** The number of ART lines */
static const int ART_NUM_LINES = 10;
/** The size of SimContext::ART_STATES */
static const int ART_NUM_STATES = 2;
/** An enum representing the ART states (on or off ART) */
enum ART_STATES {ART_OFF_STATE, ART_ON_STATE};
/** The size of SimContext::ART_EFF_TYPE */
static const int ART_EFF_NUM_TYPES = 2;
/** An enum of the ART efficacy types (suppressed and failed) */
enum ART_EFF_TYPE {ART_EFF_SUCCESS, ART_EFF_FAILURE};
/** Strings corresponding to SimContext::ART_EFF_TYPE */
static const char *ART_EFF_STRS[];
/** The size of SimContext::CD4_RESPONSE_TYPE */
static const int CD4_RESPONSE_NUM_TYPES = 4;
/** An enum of the possible CD4 response types */
enum CD4_RESPONSE_TYPE {CD4_RESPONSE_1, CD4_RESPONSE_2, CD4_RESPONSE_3, CD4_RESPONSE_4};
/** Strings corresponding to SimContext::CD4_RESPONSE_TYPE */
static const char *CD4_RESPONSE_STRS[];
/** The number of ART subregimens (per regimen) */
static const int ART_NUM_SUBREGIMENS = 4;
/** The size of SimContext::ART_TOX_SEVERITY */
static const int ART_NUM_TOX_SEVERITY = 3;
static const int ART_NUM_TOX_PER_SEVERITY = 6;
enum ART_TOX_SEVERITY {ART_TOX_MINOR, ART_TOX_CHRONIC, ART_TOX_MAJOR};
/** Strings corresponding to SimContext::ART_TOX_SEVERITY */
static const char *ART_TOX_SEVERITY_STRS[];
/** An enum of the duration of ART toxicity */
enum ART_TOX_DUR {ART_TOX_DUR_MONTH, ART_TOX_DUR_SUBREG, ART_TOX_DUR_REG, ART_TOX_DUR_DEATH};
/** The size of SimContext::ART_FAIL_TYPE */
static const int ART_NUM_FAIL_TYPES = 3;
/** An enum of the ART failure types */
enum ART_FAIL_TYPE {ART_FAIL_VIROLOGIC, ART_FAIL_IMMUNOLOGIC, ART_FAIL_CLINICAL, ART_FAIL_NOT_FAILED};
/** Strings corresponding to SimContext::ART_FAIL_TYPE */
static const char *ART_FAIL_TYPE_STRS[];
/** The size of SimContext::ART_FAIL_BY_OI */
static const int ART_FAIL_BY_OI_NUM = 4;
/** An enum of the ART failure by OI types */
enum ART_FAIL_BY_OI {ART_FAIL_BY_OI_NONE, ART_FAIL_BY_OI_PRIMARY,
ART_FAIL_BY_OI_SECONDARY, ART_FAIL_BY_OI_ANY};
/** The size of SimContext::ART_STOP_TYPE less two */
static const int ART_NUM_STOP_TYPES = 8;
/** An enum of the ART stopping types */
enum ART_STOP_TYPE {ART_STOP_MAX_MTHS, ART_STOP_MAJ_TOX, ART_STOP_CHRN_TOX, ART_STOP_FAIL, ART_STOP_CD4, ART_STOP_SEV_OI,
ART_STOP_FAIL_MTHS, ART_STOP_LTFU, ART_STOP_NOT_STOPPED, ART_STOP_STI};
/** Strings corresponding to SimContext::ART_STOP_TYPE */
static const char *ART_STOP_TYPE_STRS[];
/** The number of months to record ART stats */
static const int ART_NUM_MTHS_RECORD = 3;
/** The number of STI cycles */
static const int STI_NUM_CYCLES = 5;
/** The number of STI periods */
static const int STI_NUM_PERIODS = 2;
/** The number of STIs to track */
static const int STI_NUM_TRACKED = 30;
/** An enum of STI states */
enum STI_STATE {STI_STATE_NONE, STI_STATE_INTERRUPT, STI_STATE_RESTART, STI_STATE_ENDPOINT};
/** One more than the number of prophylaxis types for iterating */
static const int PROPH_NUM = 3;
/** The size of SimContext::PROPH_TYPE */
static const int PROPH_NUM_TYPES = 2;
/** An enum of the types of prophylaxis (primary and secondary) */
enum PROPH_TYPE {PROPH_PRIMARY, PROPH_SECONDARY};
/** Strings corresponding to SimContext::PROPH_TYPE */
static const char *PROPH_TYPE_STRS[];
/** An enum of prophylaxis toxicity types */
enum PROPH_TOX_TYPE {PROPH_TOX_NONE, PROPH_TOX_MINOR, PROPH_TOX_MAJOR};
/** A class representing a single ART Toxicity Effect */
class ARTToxicityEffect {
public:
/** The month of the toxicity start */
int monthOfToxStart;
/** The SimContext::ART_TOX_SEVERITY corresponding to this toxicity */
ART_TOX_SEVERITY toxSeverityType;
/** The toxicity number */
int toxNum;
/** The corresponding ART regimen number */
int ARTRegimenNum;
/** The corresponding ART subregimen number */
int ARTSubRegimenNum;
};
/** An enum of CD4 envelope types */
enum ENVL_CD4_TYPE {ENVL_CD4_OVERALL, ENVL_CD4_INDIV, ENVL_CD4_PERC_OVERALL, ENVL_CD4_PERC_INDIV};
/** A class representing a single CD4 envelope */
class CD4Envelope {
public:
/** True if this is an active envelope */
bool isActive;
/** The regimen number corresponding to this envelope */
int regimenNum;
/** The month this envelope started */
int monthOfStart;
/** The slope of this envelope */
double slope;
/** The current value of this envelope */
double value;
};
/* Cost and QOL constants */
/** The size of SimContext::COST_TYPES */
static const int COST_NUM_TYPES = 4;
/** An enum of the different cost types */
enum COST_TYPES {
/** direct medical costs */
COST_DIR_MED, // direct medical costs
/** direct non-medical costs */
COST_DIR_NONMED, // direct non-medical costs
/** time costs */
COST_TIME, // time costs
/** indirect costs */
COST_INDIR, // indirect costs
/** sum of costs, only used in special cases */
COST_SUM // sum of costs, only used in special cases
};
/** Strings corresponding to SimContext::Cost_Types */
static const char *COST_TYPES_STRS[];
/** An enum of the possible methods for accumulating QOL */
enum QOL_CALC_TYPE{MULT, ADD, MIN, MARGINAL };
/* TB specific constants */
/** Size of SimContext::TB_STRAIN */
static const int TB_NUM_STRAINS = 3;
/** An enum of the different TB strains: Drug Sensitive (DS), Multi-Drug Resistant (MDR), eXtensive Drug Resistant (XDR) */
enum TB_STRAIN {TB_STRAIN_DS, TB_STRAIN_MDR, TB_STRAIN_XDR};
/** Strings corresponding to SimContext::TB_STRAIN */
static const char *TB_STRAIN_STRS[];
/** Number of TB states */
static const int TB_NUM_STATES = 6;
/** An enum of the possible TB states */
enum TB_STATE {TB_STATE_UNINFECTED, TB_STATE_LATENT, TB_STATE_ACTIVE_PULM, TB_STATE_ACTIVE_EXTRAPULM, TB_STATE_PREV_TREATED, TB_STATE_TREAT_DEFAULT};
/** Strings corresponding to SimContext::TB_STATE */
static const char *TB_STATE_STRS[];
/** Number of TB tracker variables */
static const int TB_NUM_TRACKER = 3;
/** An enum of the possible TB tracker variables */
enum TB_TRACKER {TB_TRACKER_SPUTUM_HI, TB_TRACKER_IMMUNE_REACTIVE, TB_TRACKER_SYMPTOMS};
/** Strings corresponding to SimContext::TB_TRACKER */
static const char *TB_TRACKER_STRS[];
/** An enum of the types of TB infection */
enum TB_INFECT {TB_INFECT_PREVALENT, TB_INFECT_INITIAL, TB_INFECT_REINFECT, TB_INFECT_REACTIVATE, TB_INFECT_RELAPSE};
/** An enum of the different types of calendar-based TB natural history rate multipliers **/
enum TB_MULT_TYPE {TB_MULT_NONE, TB_MULT_ACTIVATION, TB_MULT_MORTALITY};
/** The number of TB infection age categories */
static const int TB_INFECT_NUM_AGE_CAT = 7;
/** The number of stages used in TB treatment */
static const int TB_TREATM_STAGE_NUM = 2;
/** Size of TB_DIAG_INIT_POLICY*/
static const int TB_DIAG_INIT_POLICY_NUM = 6;
static const int TB_DIAG_INIT_POLICY_INTV_NUM = 4;
/** An enum of the types of TB diagnostics initiation policies */
enum TB_DIAG_INIT_POLICY {TB_DIAG_INIT_HIV, TB_DIAG_INIT_SYMPTOMS, TB_DIAG_INIT_OI, TB_DIAG_INIT_CD4, TB_DIAG_INIT_MONTH, TB_DIAG_INIT_INTERVAL};
/** Size of TB_DIAG_TEST_ORDER_NUM */
static const int TB_DIAG_TEST_ORDER_NUM = 4;
/** Size of TB_DIAG_STATUS */
static const int TB_DIAG_STATUS_NUM = 2;
/** An enum of tb diagnostic test results */
enum TB_DIAG_STATUS {TB_DIAG_STATUS_POS, TB_DIAG_STATUS_NEG};
/** Strings corresponding to SimContext::TB_DIAG_STATUS */
static const char *TB_DIAG_STATUS_STRS[];
/** Size of SimContext::TB_CARE */
static const int TB_CARE_NUM = 3;
/** An enum of the different states of TB care */
enum TB_CARE {TB_CARE_UNLINKED, TB_CARE_IN_CARE, TB_CARE_LTFU};
/** unfavorable outcomes for TB treatment (first regimen only)*/
static const int TB_NUM_UNFAVORABLE = 4;
enum TB_UNFAVORABLE{TB_UNFAVORABLE_FAILURE,TB_UNFAVORABLE_RELAPSE, TB_UNFAVORABLE_LTFU,TB_UNFAVORABLE_DEATH};
static const char *TB_UNFAVORABLE_STRS[];
static const int TB_NUM_TESTS = 4;
static const int TB_NUM_TREATMENTS = 10;
static const int TB_NUM_PROPHS = 5;
/**Number of categories for time spent TB LTFU, used for TB RTC */
static const int TB_RTC_TIME_CAT_NUM = 5;
/* Testing specific constants */
/** Size of SimContext::HIV_ID */
static const int HIV_ID_NUM = 3;
/** An enum of HIV testing status: HIV negative, unidentified HIV positive, identified HIV positive */
enum HIV_ID {HIV_ID_NEG, HIV_ID_UNID, HIV_ID_IDEN};
/** Strings corresponding to SimContext::HIV_ID */
static const char *HIV_ID_STRS[];
/** Size of SimContext::HIV_INF */
static const int HIV_INF_NUM = 4;
/** An enum of the types of HIV infection: negative (no infection), asymptomatic chronic, symptomatic chronic, and acute syndrome*/
enum HIV_INF {HIV_INF_NEG, HIV_INF_ASYMP_CHR_POS, HIV_INF_SYMP_CHR_POS, HIV_INF_ACUTE_SYN};
/** Size of SimContext::HIV_POS */
static const int HIV_POS_NUM=3;
/** Strings corresponding to SimContext::HIV_POS */
static const char *HIV_POS_STRS[];
/** An enum of the types of Positive HIV Infection: asymptomatic chronic, symptomatic chronic, and acute syndrome - identical to HIV_INF, but without HIV_INF_NEG as the first element */
enum HIV_POS {HIV_POS_ASYMP_CHR_POS, HIV_POS_SYMP_CHR_POS, HIV_POS_ACUTE_SYN};
/** Size of SimContext::HIV_EXT_INF */
static const int HIV_EXT_INF_NUM = 5;
/** An extended enum of HIV status, similar to SimContext::HIV_INF but including risk type for HIV negative patients (high (HI) or low (LO)) */
enum HIV_EXT_INF {HIV_EXT_INF_NEG_HI, HIV_EXT_INF_ASYMP_CHR_POS, HIV_EXT_INF_SYMP_CHR_POS, HIV_EXT_INF_ACUTE_SYN, HIV_EXT_INF_NEG_LO};
/** Strings corresponding to SimContext::HIV_EXT_INF */
static const char *HIV_EXT_INF_STRS[];
/** Size of SimContext::HIV_BEHAV */
static const int HIV_BEHAV_NUM = 2;
/** Enums of risk levels for HIV negative patients (HI or LO) */
enum HIV_BEHAV {HIV_BEHAV_HI, HIV_BEHAV_LO};
/** Size of SimContext::HIV_DET */
static const int HIV_DET_NUM = 10;
/** An enum of the different HIV detection methods */
enum HIV_DET {HIV_DET_INITIAL, HIV_DET_SCREENING, HIV_DET_SCREENING_PREV_DET, HIV_DET_BACKGROUND, HIV_DET_BACKGROUND_PREV_DET, HIV_DET_OI, HIV_DET_OI_PREV_DET, HIV_DET_TB, HIV_DET_TB_PREV_DET, HIV_DET_UNDETECTED};
/** Strings corresponding to SimContext::HIV_DET */
static const char *HIV_DET_STRS[];
/** Size of SimContext::HIV_CARE */
static const int HIV_CARE_NUM =6;
static const char *HIV_CARE_STRS[];
/** An enum of the different states of HIV care */
enum HIV_CARE {HIV_CARE_NEG, HIV_CARE_UNDETECTED, HIV_CARE_UNLINKED, HIV_CARE_IN_CARE, HIV_CARE_LTFU, HIV_CARE_RTC};
/** Size of SimContext::HIV_POS_PREP_STATE */
static const int HIV_POS_PREP_STATES_NUM = 4;
/** An enum of the different PrEP states for HIV positive patients */
enum HIV_POS_PREP_STATE { HIV_POS_ON_PREP, HIV_POS_PREP_DROPOUT, HIV_POS_PREP_AGESTOP, HIV_POS_NEVER_PREP};
/** Size of SimContext::EVER_PREP */
static const int EVER_PREP_NUM = 2;
/** An enum of the possible states for whether a patient has ever had PrEP */
enum EVER_PREP {NEVER_PREP, EVER_PREP};
/**Number of incidence reduction multiplier periods*/
static const int INC_REDUC_PERIODS_NUM = 6;
/** Number of age categories for HIV incidence */
static const int AGE_CAT_HIV_INC = 20;
/** Number of HIV test frequencies */
static const int HIV_TEST_FREQ_NUM = 5;
/** Number of test acceptance types */
static const int TEST_ACCEPT_NUM = 3;
/** Size of SimContext::TEST_RESULT */
static const int TEST_RESULT_NUM = 4;
/** An enum of the different HIV test results */
enum TEST_RESULT {TEST_TRUE_POS, TEST_FALSE_POS, TEST_TRUE_NEG, TEST_FALSE_NEG};
/** Strings corresponding to SimContext::TEST_RESULT */
static const char *TEST_RESULT_STRS[];
/* Pediatrics specific constants */
/** Size of SimContext::PEDS_HIV_STATE */
static const int PEDS_HIV_NUM = 4;
/** Number of elements of SimContext::PEDS_HIV_STATE that don't correspond to HIV negative **/
static const int PEDS_HIV_POS_NUM = 3;
/** An enum of the different Pediatric HIV states: intra-uterine infected, intra-partum infected, post-partum infected, and uninfected */
enum PEDS_HIV_STATE {PEDS_HIV_POS_IU, PEDS_HIV_POS_IP, PEDS_HIV_POS_PP, PEDS_HIV_NEG};
/** Strings corresponding to SimContext::PEDS_HIV_STATE */
static const char *PEDS_HIV_STATE_STRS[];
/** Number of scheduled base assays allowed for EID - one per visit for 24 visits*/
static const int EID_NUM_ASSAYS = 24;
/** Number of infant HIV Proph regimens */
static const int INFANT_HIV_PROPHS_NUM = 4;
/** Number of age categories for infant Proph */
static const int INFANT_PROPH_AGES_NUM = 36;
/** Number of age categories for infant Proph costs */
static const int INFANT_PROPH_COST_AGES_NUM = 8;
/** Number of age categories for EID cost of visit */
static const int EID_COST_VISIT_NUM = 24;
/** Number of HIV tests used by EID */
static const int EID_NUM_TESTS = 10;
/** Maternal Status (uninfected, chronic HIV cd4 >350, chronic HIV cd4 < 350, acute HIV)**/
static const int PEDS_MATERNAL_STATUS_NUM = 4;
enum PEDS_MATERNAL_STATUS{PEDS_MATERNAL_STATUS_NEG, PEDS_MATERNAL_STATUS_CHR_HIGH, PEDS_MATERNAL_STATUS_CHR_LOW, PEDS_MATERNAL_STATUS_ACUTE};
/** Strings corresponding to PEDS_MATERNAL_STATUS */
static const char *PEDS_MATERNAL_STATUS_STRS[];
/** Maternal Status known positive or not known positive */
static const int PEDS_MATERNAL_KNOWLEDGE_NUM = 2;
enum PEDS_MATERNAL_KNOWLEDGE{PEDS_MATERNAL_KNOWLEDGE_NOT_KNOWN_POSITIVE, PEDS_MATERNAL_KNOWLEDGE_KNOWN_POSITIVE};
/** number of month categories for sensitivity and specificity of EID tests */
static const int EID_TEST_AGE_CATEGORY_NUM = 18;
/** Status of confirmatory tests (not a confirmatory, 1st confirmatory, second confirmatory) */
static const int EID_TEST_TYPE_NUM = 3;
enum EID_TEST_TYPE{EID_TEST_TYPE_BASE, EID_TEST_TYPE_FIRST_CONF, EID_TEST_TYPE_SECOND_CONF};
static const char *EID_TEST_TYPE_STRS[];
static const int ADOLESCENT_NUM_AGES = 18;
static const int ADOLESCENT_NUM_ART_AGES = 5;
/** Holds test state of pending Eid test result or scheduled EID tests*/
class EIDTestState{
public:
//The index of the base HIV test that starts the chain of confirmatory tests
int baseAssay;
//The index of the HIV test being used
int testAssay;
/** whether this is normal test, first confirmatory test, or second confirmatory */
SimContext::EID_TEST_TYPE testType;
/** If this test was caused by an acute OI, the OI type that triggered it (OI_NONE if not triggered by OI)*/
OI_TYPE triggeredByOI;
/** result of the test */
//If this is for a scheduled EID test, result will not be used
bool result;
int monthToReturn;
//whether the result will be returned to the patient
bool returnToPatient;
};
/** Size of PEDS_EXPOSED_CONDITIONS */
static const int PEDS_EXPOSED_CONDITIONS_NUM = 4;
/** Enum of user-defined pediatric HIV exposure conditions, used for mortality and aggregate HIV exposure outputs*/
enum PEDS_EXPOSED_CONDITIONS {MOM_CHRONIC_PREGNANCY, MOM_ACUTE_PREGNANCY, MOM_ACUTE_BREASTFEEDING, MOM_ON_ART_UNEXPOSED};
/** Size of PEDS_EXPOSED_BREASTFEEDING*/
static const int PEDS_EXPOSED_BREASTFEEDING_NUM = 2;
/** Enum of additional categories used for monthly HIV exposed uninfected outputs, independent of the user-defined exposure conditions for mortality */
enum PEDS_EXPOSED_BREASTFEEDING {EXPOSED_BF_MOM_CHRONIC, EXPOSED_BF_MOM_ACUTE};
/** The number of month a pediatric patient's mother stays in the acute state */
static const int PEDS_MOM_MTHS_ACUTE = 3;
/** Size of SimContext::PEDS_BF_TYPE */
static const int PEDS_BF_NUM = 4;
/** An enum of the breast feeding types: exclusive breast feeding, mixed, complementary, and replacement feeding */
enum PEDS_BF_TYPE {PEDS_BF_EXCL, PEDS_BF_MIXED, PEDS_BF_COMP, PEDS_BF_REPL};
/** Strings corresponding to SimContext::PEDS_BF_TYPE */
static const char *PEDS_BF_TYPE_STRS[];
/** Age at which a patient should transition from exclusive or mixed to complementary breast feeding */
static const int PEDS_BF_STOP_EXCL_MIXED = 6;
/** Minimum age at which to stop breastfeeding safely; if they stop at a safe age the replacement feeding death rate ratio will not be applied */
static const int PEDS_SAFE_BF_STOP_AGE = 36;
/** Number of age categories for pp maternal ART status */
static const int PEDS_PP_MATERNAL_ART_STATUS_NUM = 24;
/** Number of age categories that just correspond to infancy (from SimContext::PEDS_AGE_CAT) */
static const int PEDS_AGE_INFANT_NUM = 7;
/** Number of age categories that just correspond to infancy and early childhood (from SimContext::PEDS_AGE_CAT) */
static const int PEDS_AGE_EARLY_NUM = 10;
/** Number of age categories that just correspond to infancy and all of childhood (from SimContext::PEDS_AGE_CAT) */
static const int PEDS_AGE_CHILD_NUM = 11;
/** An enum of the pediatric age categories */
enum PEDS_AGE_CAT {PEDS_AGE_2MTH, PEDS_AGE_5MTH, PEDS_AGE_8MTH, PEDS_AGE_11MTH, PEDS_AGE_14MTH,
PEDS_AGE_17MTH, PEDS_AGE_23MTH, PEDS_AGE_2YR, PEDS_AGE_3YR, PEDS_AGE_4YR, PEDS_AGE_LATE, PEDS_AGE_ADULT};
/** Strings corresponding to SimContext::PEDS_AGE_CAT */
static const char *PEDS_AGE_CAT_STRS[];
/** Age cut off in years for "early childhood" */
static const int PEDS_YEAR_EARLY = 5;
/** Final age cut off in years for "late childhood */
static const int PEDS_YEAR_LATE = 13;
/** Size of SimContext::PEDS_CD4_PERC */
static const int PEDS_CD4_PERC_NUM = 8;
/** An enum of the pediatric CD4 percentage categories */
enum PEDS_CD4_PERC {PEDS_CD4_PERC_L5, PEDS_CD4_PERC_L10, PEDS_CD4_PERC_L15, PEDS_CD4_PERC_L20,
PEDS_CD4_PERC_L25, PEDS_CD4_PERC_L30, PEDS_CD4_PERC_L35, PEDS_CD4_PERC_HIGHER};
/** Strings corresponding to SimContext:: PEDS_CD4_PERC */
static const char *PEDS_CD4_PERC_STRS[];
/** RunSpecsInputs class contains inputs from the RunSpecs tab,
one per simulation context */
class RunSpecsInputs {
public:
/* Shortcuts and Miscellaneous inputs */
/** RunSpecs D3 */
string runSetName;
string runName;
/** RunSpecs D6 */
int numCohorts;
/** RunSpecs D7 */
double discountFactor;
double originalDiscRate;
/** RunSpecs E9 */
double maxPatientCD4;
/** RunSpecs F36-F38 */
int monthRecordARTEfficacy[ART_NUM_MTHS_RECORD];
/** RunSpecs E12 */
bool randomSeedByTime;
/** RunSpecs E37 */
string userProgramLocale;
/** RunSpecs E40-G40 */
string inputVersion;
string modelVersion;
/** RunSpecs B22 */
bool OIsIncludeTB;
/** RunSpecs C46-C60 */
double OIsFractionOfBenefit[OI_NUM];
/** RunSpecs C67-E81 **/
bool severeOIs[OI_NUM];
/** RunSpecs C87-E91 **/
double CD4StrataUpperBounds[CD4_NUM_STRATA-1];
/* Logging inputs */
/** RunSpecs E14 **/
LONGIT_SUMM_TYPE longitLoggingLevel;
/** RunSpecs H20-H34 **/
int firstOIsLongitLogging[OI_NUM];
/** RunSpecs N8 **/
bool enableOIHistoryLogging;
/** RunSpecs N9 **/
int numARTFailuresForOIHistoryLogging;
/** RunSpecs N12-O12 **/
double CD4BoundsForOIHistoryLogging[NUM_BOUNDS];
/** RunSpecs N14-O14 **/
int HVLBoundsForOIHistoryLogging[NUM_BOUNDS];
/** RunSpecs N17-N31 **/
bool OIsToExcludeOIHistoryLogging[OI_NUM];
/* Output inputs */
/** RunSpecs AA3 **/
bool enableMultipleDiscountRates;
/** RunSpecs X8-Y10 */
double multDiscountRatesCost[NUM_DISCOUNT_RATES];
double multDiscountRatesBenefit[NUM_DISCOUNT_RATES];
}; /* end RunSpecsInputs */
/** OutputInputs class contains inputs from the Output tab,
one per simulation context */
class OutputInputs {
public:
int traceNumSelection;
/* Subcohort Inputs*/
/** Output C5 **/
bool enableSubCohorts;
/** Output H5 **/
bool enableDetailedCostOutputs;
/** Output A12-A36 **/
int subCohorts[MAX_NUM_SUBCOHORTS];
}; /* end OutputInputs */
/** CohortInputs class contains inputs from the Cohort tab,
one per simulation context */
class CohortInputs {
public:
/* Initial characteristics and history inputs */
/** Cohort C5 **/
double initialCD4Mean;
/** Cohort C6 **/
double initialCD4StdDev;
/** Cohort G6 **/
bool enableSquareRootTransform;
/** Cohort C10-H16 **/
double initialHVLDistribution[CD4_NUM_STRATA][HVL_NUM_STRATA];
/**Cohort C20 **/
double initialAgeMean;
/**Cohort C21 **/
double initialAgeStdDev;
/**Cohort G20 **/
bool useCustomAgeDist;
/**Cohort M21-M50 + N21-N50 **/
double ageStrata[2 * INIT_AGE_NUM_STRATA];
/**Cohort O21-O50 **/
double ageProbs[INIT_AGE_NUM_STRATA];
/**Cohort C23-C24 **/
double maleGenderDistribution;
/**Cohort C26 **/
double OIProphNonComplianceRisk;
/**Cohort C27 **/
double OIProphNonComplianceDegree;
/**Cohort G46-G48 **/
double clinicVisitTypeDistribution[CLINIC_VISITS_NUM];
/**Cohort G51-G53 **/
double therapyImplementationDistribution[THERAPY_IMPL_NUM];
/**Cohort C57-C60 **/
double CD4ResponseTypeOnARTDistribution[CD4_RESPONSE_NUM_TYPES];
/**Cohort C67-H185 **/
double probOIHistoryAtEntry[CD4_NUM_STRATA][HVL_NUM_STRATA][OI_NUM];
/**Cohort M6-Q6 **/
double probRiskFactorPrev[RISK_FACT_NUM];
/**Cohort M7-Q7 **/
double probRiskFactorIncid[RISK_FACT_NUM];
/**Cohort W3 **/
bool showTransmissionOutput;
/** Cohort V8-AI15 **/
double transmRateOnART[CD4_NUM_STRATA][HVL_NUM_STRATA];
double transmRateOnARTAcute[CD4_NUM_STRATA];
double transmRateOffART[CD4_NUM_STRATA][HVL_NUM_STRATA];
double transmRateOffARTAcute[CD4_NUM_STRATA];
/** Cohort W17-W18 **/
bool transmUseHIVTestAcuteDefinition;
int transmAcuteDuration;
/** Cohort AF17-AH19 **/
int transmRateMultInterval[2];
double transmRateMult[3];
/** Cohort V22-AI24 **/
double transmRiskDistrib[GENDER_NUM][TRANSM_RISK_AGE_NUM][TRANSM_RISK_NUM];
/** Cohort X26-Z26 **/
int transmRiskMultBounds[2];
/** Cohort V28-X30 **/
double transmRiskMult[TRANSM_RISK_NUM][3];
/** Cohort X35 **/
bool useDynamicTransm;
bool updateDynamicTransmInc;
/** Cohort AH40 **/
double dynamicTransmHRGTransmissions;
/** Cohort Z42-Z47**/
double dynamicTransmPropHRGAttributable;
double dynamicTransmNumHIVPosHRG;
double dynamicTransmNumHIVNegHRG;
int dynamicTransmWarmupSize;
bool keepPrEPAfterWarmup;
bool usePrEPDuringWarmup;
/** Cohort X51-X53**/
bool useTransmEndLifeHVLAdjustment;
double transmEndLifeHVLAdjustmentCD4Threshold;
int transmEndLifeHVLAdjustmentARTLineThreshold;
}; /* end CohortInputs */
/** TreatmentInputs class contains inputs from the Treatment tab,
one per simulation context */
class TreatmentInputs {
public:
/* ART start policy class */
class ARTStartPolicy {
public:
double CD4BoundsOnly[NUM_BOUNDS];
int HVLBoundsOnly[NUM_BOUNDS];
double CD4BoundsWithHVL[NUM_BOUNDS];
int HVLBoundsWithCD4[NUM_BOUNDS];
bool OIHistory[OI_NUM];
int numOIs;
double CD4BoundsWithOIs[NUM_BOUNDS];
bool OIHistoryWithCD4[OI_NUM];
bool ensureSuppFalsePositiveFailure;
int minMonthNum;
int maxMonthNum;
int monthsSincePrevRegimen;
};
/* ART failure policy class */
class ARTFailPolicy {
public:
int HVLNumIncrease;
int HVLBounds[NUM_BOUNDS];
bool HVLFailAtSetpoint;
int HVLMonthsFromInit;
double CD4PercentageDrop;
bool CD4BelowPreARTNadir;
double CD4BoundsOR[NUM_BOUNDS];
double CD4BoundsAND[NUM_BOUNDS];
int CD4MonthsFromInit;
ART_FAIL_BY_OI OIsEvent[OI_NUM];
int OIsMinNum;
int OIsMonthsFromInit;
int diagnoseNumTestsFail;
bool diagnoseUseHVLTestsConfirm;
bool diagnoseUseCD4TestsConfirm;
int diagnoseNumTestsConfirm;
};
/* ART stopping policy class */
class ARTStopPolicy {
public:
int maxMonthsOnART;
bool withMajorToxicty;
bool afterFailImmediate;
double afterFailCD4LowerBound;
bool afterFailWithSevereOI;
int afterFailMonthsFromObserved;
int afterFailMinMonthNum;
int afterFailMonthsFromInit;
int nextLineAfterMajorTox;
};
/* Prophylaxis policy classes */
class ProphStartPolicy {
public:
bool useOrEvaluation;
double currCD4Bounds[NUM_BOUNDS];
double minCD4Bounds[NUM_BOUNDS];
int OIHistory[OI_NUM];
int minMonthNum;
};
class ProphStopPolicy {
public:
bool useOrEvaluation;
double currCD4Bounds[NUM_BOUNDS];
double minCD4Bounds[NUM_BOUNDS];
int OIHistory[OI_NUM];
int minMonthNum;
int monthsOnProph;
};
/* Clinical visit and testing inputs */
//Treatment AO18 **/
int clinicVisitInterval;
//Treatment AM22-BA23 **/
double probDetectOIAtEntry[OI_NUM];
double probDetectOISinceLastVisit[OI_NUM];
//Treatment AM26-BA26 **/
double probSwitchSecondaryProph[OI_NUM];
//Treatment AO4-AV4 **/
double testingIntervalCD4Threshold;
int testingIntervalARTMonthsThreshold;
int testingIntervalLastARTMonthsThreshold;
//Treatment AN7-AX8 **/
int CD4TestingIntervalPreARTHighCD4;
int CD4TestingIntervalPreARTLowCD4;
int CD4TestingIntervalOnART[2];
int CD4TestingIntervalOnLastART[2];
int CD4TestingIntervalPostART;
int HVLTestingIntervalPreARTHighCD4;
int HVLTestingIntervalPreARTLowCD4;
int HVLTestingIntervalOnART[2];
int HVLTestingIntervalOnLastART[2];
int HVLTestingIntervalPostART;
//Treatment AN12-AN15 **/
double probHVLTestErrorHigher;
double probHVLTestErrorLower;
double CD4TestStdDevPercentage;
double CD4TestBiasMean;
double CD4TestBiasStdDevPercentage;
//Treatment AQ29-AQ34 **/
bool ARTFailureOnlyAtRegularVisit;
int numARTInitialHVLTests;
int numARTInitialCD4Tests;
bool emergencyVisitIsNotRegularVisit;
//Treatment AQ36-AQ37
int CD4TestingLag;
int HVLTestingLag;
//Treatment AQ39-AQ41
bool cd4MonitoringStopEnable;
double cd4MonitoringStopThreshold;
int cd4MonitoringStopMthsPostARTInit;
/* ART policy and failure inputs */
//Treatment D5-M48 **/
ARTStartPolicy startART[ART_NUM_LINES];
//Treatment K52-K61 **/
bool enableSTIForART[ART_NUM_LINES];
//Treatment D67-M101 **/
ARTFailPolicy failART[ART_NUM_LINES];
//Treatment D105-M109 **/
ARTStopPolicy stopART[ART_NUM_LINES];
//Treatment D114-M129 **/
double ARTResistancePriorRegimen[ART_NUM_LINES][ART_NUM_LINES];
double ARTResistanceHVL[HVL_NUM_STRATA];
/* Proph policy inputs */
//Treatment S5-AG114
ProphStartPolicy startProph[PROPH_NUM_TYPES][OI_NUM];
ProphStopPolicy stopProph[PROPH_NUM_TYPES][OI_NUM];
}; /* end TreatmentInputs */
/** LTFUInputs class contains inputs from the LTFU tab, one per simulation context */
class LTFUInputs {
public:
//LTFU E4 **/
bool useLTFU;
//LTFU B8-C8 **/
double propRespondLTFUPreARTLogitMean;
double propRespondLTFUPreARTLogitStdDev;
//LTFU G11
bool useInterventionLTFU;
//LTFU B13-E13 **/
double responseThresholdLTFU[RESP_NUM_TYPES-1];
double responseValueLTFU[RESP_NUM_TYPES-1];
//LTFU H13-K18 **/
double responseThresholdPeriodLTFU[HET_INTV_NUM_PERIODS][RESP_NUM_TYPES-1];
double responseValuePeriodLTFU[HET_INTV_NUM_PERIODS][RESP_NUM_TYPES-1];
double responseThresholdLTFUOffIntervention[RESP_NUM_TYPES-1];
double responseValueLTFUOffIntervention[RESP_NUM_TYPES-1];
//LTFU B17-E17 **/
double propGeneralMedicineCost[HIV_CARE_NUM];
//LTFU B22-E22 **/
double propInterventionCost[HIV_CARE_NUM];
//LTFU F33-F37 **/
double probRemainOnOIProph;
double probRemainOnOITreatment;
//LTFU Q4-Q13 **/
int minMonthsRemainLost;
double regressionCoefficientsRTC[RTC_NUM_COEFF];
double CD4ThresholdRTC;
//LTFU W8-W22 **/
bool severeOIsRTC[OI_NUM];
//LTFU U30-U32 **/
int maxMonthsAfterObservedFailureToRestartRegimen;
double probRestartRegimenWithoutObservedFailure;
bool recheckARTStartPoliciesAtRTC;
//LTFU Q37-Z44 **/
bool useProbSuppByPrevOutcome;
double probSuppressionWhenReturnToFailed[ART_NUM_LINES];
double probSuppressionWhenReturnToSuppressed[ART_NUM_LINES];
//LTFU T48-T49 **/
double probResumeInterventionRTC;
double costResumeInterventionRTC;
};
/* HeterogeneityInputs class contains inputs from the Heterogeneity tab,
* one per simulation context */
class HeterogeneityInputs {
public:
//Hetero D10-E10
double propRespondBaselineLogitMean;
double propRespondBaselineLogitStdDev;
//Hetero D13-J13
double propRespondAge[RESP_AGE_CAT_NUM];
//Hetero H19-I19
double propRespondAgeEarly;
double propRespondAgeLate;
//Hetero D16-I16
double propRespondCD4[CD4_NUM_STRATA];
//Hetero D19-D26
double propRespondFemale;
double propRespondHistoryOIs;
double propRespondPriorARTToxicity;
double propRespondRiskFactor[RISK_FACT_NUM];
//Hetero C34-K38
bool useIntervention[HET_INTV_NUM_PERIODS];
double interventionDurationMean[HET_INTV_NUM_PERIODS];
double interventionDurationSD[HET_INTV_NUM_PERIODS];
double interventionAdjustmentMean[HET_INTV_NUM_PERIODS];
double interventionAdjustmentSD[HET_INTV_NUM_PERIODS];
SimContext::HET_ART_LOGIT_DISTRIBUTION interventionAdjustmentDistribution[HET_INTV_NUM_PERIODS];
double interventionCostInit[HET_INTV_NUM_PERIODS];
double interventionCostMonthly[HET_INTV_NUM_PERIODS];
};
/* STIInputs class contains inputs from the STI tab,
one per simulation context */
class STIInputs {
public:
/* STI initiation policy class, same inputs as ART start policy plus months since init ART */
class InitiationPolicy : public TreatmentInputs::ARTStartPolicy {
public:
int monthsSinceARTStart;
};
/* STI endpoint policy class, same inputs as ART start policy plus months since init STI */
class EndpointPolicy : public TreatmentInputs::ARTStartPolicy {
public:
int monthsSinceSTIStart;
};
/* STI initiation, restart, and subsequent stopping policy inputs */
//STI D5-M50
InitiationPolicy firstInterruption[ART_NUM_LINES];
//STI D56-M59
double ARTRestartCD4Bounds[ART_NUM_LINES][NUM_BOUNDS];
int ARTRestartHVLBounds[ART_NUM_LINES][NUM_BOUNDS];
//STI D62-F62
int ARTRestartFirstTestMonth;
int ARTRestartSecondTestMonth;
int ARTRestartTestInterval;
//STI D67-M70
double ARTRestopCD4Bounds[ART_NUM_LINES][NUM_BOUNDS];
int ARTRestopHVLBounds[ART_NUM_LINES][NUM_BOUNDS];
//STI D73-F73
int ARTRestopFirstTestMonth;
int ARTRestopSecondTestMonth;
int ARTRestopTestInterval;
/* STI endpoint policy inputs */
//STI S5-AB45
EndpointPolicy endpoint[ART_NUM_LINES];
}; /* end STIInputs */
/* ProphInputs class contains inputs from the Prophs tab,
one for each proph type x OI x proph line in the simulation context */
class ProphInputs {
public:
//Prophs E5-S24
double primaryOIEfficacy[OI_NUM];