-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRunStats.h
More file actions
2119 lines (2025 loc) · 121 KB
/
Copy pathRunStats.h
File metadata and controls
2119 lines (2025 loc) · 121 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"
/**
RunStats class contains the aggregate statistics for all cohorts run for a given
input file (simulation context). Contains all the functions to update these statistics
and generate the output files. Its statistics are updated by the StateUpdater objects
that are called every month for each patient. Read only access to the
statistics is provided through accessor functions that return const pointers to the
subclass objects.
*/
class RunStats
{
public:
/** Make the StateUpdater class a friend class so it can modify the private data */
friend class StateUpdater;
/* Constructors and Destructor */
RunStats(string runName, SimContext *simContext);
~RunStats(void);
/** Constants used for the survival stats groups, excluding top and bottom X percent */
static const int NUM_SURVIVAL_GROUPS = 4;
enum SURVIVAL_GROUPS {SURVIVAL_ALL, SURVIVAL_EXCL_LONG, SURVIVAL_EXCL_SHORT, SURVIVAL_EXCL_LONG_AND_SHORT};
static const int TRUNC_HISTOGRAM_PERC = 5;
static const int MAX_NUM_HISTOGRAM_BUCKETS = 250;
/** PatientSummary class holds information that must be stored for every cohort
even after death, needed to calculate median and other non-incremental statistics */
class PatientSummary {
public:
/** Total costs accrued by the patient */
double costs;
/** Total life months lived by the patient */
double LMs;
/** Total quality adjusted life months lived by the patient */
double QALMs;
/** A struct containing an operator that compares the costs of two summaries that returns true if the first summary had lower costs than the second summary */
struct compareLMs {
bool operator()(const PatientSummary &p1, const PatientSummary &p2) const {
return p1.LMs < p2.LMs;
}
};
}; /* end PatientSummary */
/** PopulationSummary holds summary aggregate statistics and other misc information */
class PopulationSummary {
public:
// Basic run and set information
/** The name of the run set this summary belongs to */
string runSetName;
/** The name of the run corresponding to this summary */
string runName;
/** The date of the run */
string runDate;
/** The time the run finished */
string runTime;
// Number of patient and clinic visit aggregates
/** The number of Persons in this cohort */
int numCohorts;
/** The number of HIV positive Persons in this cohort */
int numCohortsHIVPositive;
/** The total number of clinic visits in this run */
int totalClinicVisits;
// Overall costs, life months, and quality adjusted life month statistics
/** The total cost accrued in this run*/
double costsSum;
/** The average costs per Person */
double costsAverage;
/** The sum of the squares of the costs per person (for calculating the standard deviation) */
double costsSumSquares;
/** The standard deviation of the costs per person */
double costsStdDev;
/** The lowest cost per person */
double costsLowerBound;
/** The highest cost per person */
double costsUpperBound;
/** The total number of life months lived in this run */
double LMsSum;
/** The average life months lived per Person */
double LMsAverage;
/** The sum of the squares of the life months lived per person (for calculating the standard deviation) */
double LMsSumSquares;
/** The standard deviation of the life months lived per person */
double LMsStdDev;
/** The lowest life months lived per person */
double LMsLowerBound;
/** The highest life months lived per person */
double LMsUpperBound;
/** The total number of quality adjusted life months lived in this run */
double QALMsSum;
/** The average quality adjusted life months lived per Person */
double QALMsAverage;
/** The sum of the squares of the quality adjusted life months lived per person (for calculating the standard deviation) */
double QALMsSumSquares;
/** The standard deviation of the quality adjusted life months lived per person */
double QALMsStdDev;
/** The lowest quality adjusted life months lived per person */
double QALMsLowerBound;
/** The highest quality adjusted life months lived per person */
double QALMsUpperBound;
// Overall costs, life months, and quality adjusted life month statistics for use if cohort parsing is turned on
/** The total cost accrued in this run*/
double costsSumCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The average costs per Person */
double costsAverageCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The sum of the squares of the costs per person (for calculating the standard deviation) */
double costsSumSquaresCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The standard deviation of the costs per person */
double costsStdDevCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The total number of life months lived in this run */
double LMsSumCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The average life months lived per Person */
double LMsAverageCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The sum of the squares of the life months lived per person (for calculating the standard deviation) */
double LMsSumSquaresCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The standard deviation of the life months lived per person */
double LMsStdDevCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The total number of quality adjusted life months lived in this run */
double QALMsSumCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The average quality adjusted life months lived per Person */
double QALMsAverageCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The sum of the squares of the quality adjusted life months lived per person (for calculating the standard deviation) */
double QALMsSumSquaresCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The standard deviation of the quality adjusted life months lived per person */
double QALMsStdDevCohortParsing[SimContext::MAX_NUM_SUBCOHORTS];
/** The average costs per Person using multiple discount rates*/
double multDiscCostsAverage[SimContext::NUM_DISCOUNT_RATES];
/** The total costs using multiple discount rates*/
double multDiscCostsSum[SimContext::NUM_DISCOUNT_RATES];
/** The sum square costs per Person using multiple discount rates*/
double multDiscCostsSumSquares[SimContext::NUM_DISCOUNT_RATES];
/** The standard deviation of the costs per person using multiple discount rates*/
double multDiscCostsStdDev[SimContext::NUM_DISCOUNT_RATES];
/** The average LMs per Person using multiple discount rates*/
double multDiscLMsAverage[SimContext::NUM_DISCOUNT_RATES];
/** The total LMs per Person using multiple discount rates*/
double multDiscLMsSum[SimContext::NUM_DISCOUNT_RATES];
/** The sum square LMs per Person using multiple discount rates*/
double multDiscLMsSumSquares[SimContext::NUM_DISCOUNT_RATES];
/** The standard deviation of the LMs per person using multiple discount rates*/
double multDiscLMsStdDev[SimContext::NUM_DISCOUNT_RATES];
/** The average QALMs per Person using multiple discount rates*/
double multDiscQALMsAverage[SimContext::NUM_DISCOUNT_RATES];
/** The total QALMs per Person using multiple discount rates*/
double multDiscQALMsSum[SimContext::NUM_DISCOUNT_RATES];
/** The sum square QALMs per Person using multiple discount rates*/
double multDiscQALMsSumSquares[SimContext::NUM_DISCOUNT_RATES];
/** The standard deviation of the QALMs per person using multiple discount rates*/
double multDiscQALMsStdDev[SimContext::NUM_DISCOUNT_RATES];
// Aggregate statistics after X number of ART failures
/** The number of ART failures stratified by ART line */
int numFailART[SimContext::ART_NUM_LINES+1];
/** The total costs stratified by most recent ART line failed */
double costsFailARTSum[SimContext::ART_NUM_LINES+1];
/** The average cost per person stratified by most recent ART line failed */
double costsFailARTAverage[SimContext::ART_NUM_LINES+1];
/** The total life months lived stratified by most recent ART line failed */
double LMsFailARTSum[SimContext::ART_NUM_LINES+1];
/** The average life months lived per person stratified by most recent ART line failed */
double LMsFailARTAverage[SimContext::ART_NUM_LINES+1];
/** The total quality adjusted life months lived stratified by most recent ART line failed */
double QALMsFailARTSum[SimContext::ART_NUM_LINES+1];
/** The average quality adjusted life months lived per person stratified by most recent ART line failed */
double QALMsFailARTAverage[SimContext::ART_NUM_LINES+1];
// Overall statistics for HIV positive only
/** The total costs accrued for HIV positive persons */
double costsHIVPositiveSum;
/** The average costs per person accrued for HIV positive persons */
double costsHIVPositiveAverage;
/** The total life months lived by HIV positive Persons*/
double LMsHIVPositiveSum;
/** The average life months per person lived by HIV positive Persons*/
double LMsHIVPositiveAverage;
/** The total quality adjusted life months lived by HIV positive Persons */
double QALMsHIVPositiveSum;
/** The average quality adjusted life months per person lived by HIV positive Persons */
double QALMsHIVPositiveAverage;
}; /* end PopulationSummary */
/** HIVScreening holds the statistics related to HIV screening and detection (i.e. the "testing module") */
class HIVScreening {
public:
// number of HIV positive and negative cases
/** Total number of prevalent HIV cases */
int numPrevalentCases;
/** Total number of incident HIV cases */
int numIncidentCases;
/** Total number of incident HIV cases by PrEP state */
int numIncidentCasesByPrEPState[SimContext::HIV_POS_PREP_STATES_NUM];
/** Total number of HIV negative at initiation */
int numHIVNegativeAtInit;
/** Total number of HIV cases */
int numHIVPositiveTotal;
/** The number of HIV-negative patients in this cohort who are never infected with HIV, stratified by whether they ever took PrEP */
int numNeverHIVPositive[SimContext::EVER_PREP_NUM];
/** The total life months lived by HIV-negative, never infected Persons, stratified by whether they ever took PrEP*/
double LMsHIVNegativeSum[SimContext::EVER_PREP_NUM];
/** The average life months per person lived by HIV-negative, never infected Persons, stratified by whether they ever took PrEP*/
double LMsHIVNegativeAverage[SimContext::EVER_PREP_NUM];
/** The total quality adjusted life months lived by HIV-negative, never infected Persons, stratified by whether they ever took PrEP*/
double QALMsHIVNegativeSum[SimContext::EVER_PREP_NUM];
/** The average quality adjusted life months per person lived by HIV-negative, never infected Persons, stratified by whether they ever took PrEP*/
double QALMsHIVNegativeAverage[SimContext::EVER_PREP_NUM];
/** Total number of children whose mother is infected before model start but are themselves uninfected at model start, and total number of children who were ever HIV exposed uninfected after initiation (i.e. were breastfeeding and HIV negative at the time of maternal infection) */
int numHIVExposed[3];
/** Total number of children never exposed to HIV by their mother */
int numNeverHIVExposed;
/** Initial counts stratified by HIV state */
int numPatientsInitialHIVState[SimContext::HIV_EXT_INF_NUM];
/** Number initially linked to HIV care */
int numLinkedAtInit[SimContext::HIV_POS_NUM];
// num prevalent HIV positive patients at detection,
// stratified by CD4 x HIV state and HVL x HIV state
/** Number of prevalent HIV positive patients who become detected */
int numAtDetectionPrevalent;
/** Number of prevalent HIV positive patients who become detected stratified by CD4 metric */
int numAtDetectionPrevalentCD4Metric[SimContext::PEDS_CD4_AGE_CAT_NUM];
/** Number of prevalent HIV positive patients stratified by HIV state at detection */
int numAtDetectionPrevalentHIV[SimContext::HIV_POS_NUM];
/** Number of prevalent HIV positive patients stratified by HIV state at detection and CD4 metric */
int numAtDetectionPrevalentHIVCD4Metric[SimContext::HIV_POS_NUM][SimContext::PEDS_CD4_AGE_CAT_NUM];
/** Number of prevalent HIV positive patients stratified by CD4 strata */
int numAtDetectionPrevalentCD4[SimContext::CD4_NUM_STRATA];
/** Number of prevalent HIV positive patients stratified by HIV state at detection and CD4 strata */
int numAtDetectionPrevalentCD4HIV[SimContext::CD4_NUM_STRATA][SimContext::HIV_POS_NUM];
/** Number of prevalent HIV positive patients stratified by HVL strata */
int numAtDetectionPrevalentHVL[SimContext::HVL_NUM_STRATA];
/** Number of prevalent HIV positive patients stratified by HIV state at detection and HVL strata */
int numAtDetectionPrevalentHVLHIV[SimContext::HVL_NUM_STRATA][SimContext::HIV_POS_NUM];
// num incident HIV positive patients at detection,
// stratified by CD4 x HIV state and HVL x HIV state
/** Number of incident HIV positive patients who become detected */
int numAtDetectionIncident;
/** Number of incident HIV positive patients who become detected stratified by CD4 metric */
int numAtDetectionIncidentCD4Metric[SimContext::PEDS_CD4_AGE_CAT_NUM];
/** Number of incident HIV positive patients stratified by HIV state at detection */
int numAtDetectionIncidentHIV[SimContext::HIV_POS_NUM];
/** Number of incident HIV positive patients stratified by HIV state at detection and CD4 metric */
int numAtDetectionIncidentHIVCD4Metric[SimContext::HIV_POS_NUM][SimContext::PEDS_CD4_AGE_CAT_NUM];
/** Number of incident HIV positive patients stratified by CD4 strata */
int numAtDetectionIncidentCD4[SimContext::CD4_NUM_STRATA];
/** Percentage of incident HIV positive patients stratified by CD4 strata */
double percentAtDetectionIncidentCD4[SimContext::CD4_NUM_STRATA];
/** Number of incident HIV positive patients stratified by HIV state and CD4 strata at detection */
int numAtDetectionIncidentCD4HIV[SimContext::CD4_NUM_STRATA][SimContext::HIV_POS_NUM];
/** Number of incident HIV positive patients stratified by HVL strata at detection*/
int numAtDetectionIncidentHVL[SimContext::HVL_NUM_STRATA];
/** Percentage of incident HIV positive patients stratified by HVL strata at detection*/
double percentAtDetectionIncidentHVL[SimContext::HVL_NUM_STRATA];
/** Number of incident HIV positive patients stratified by HIV state and HVL strata at detection */
int numAtDetectionIncidentHVLHIV[SimContext::HVL_NUM_STRATA][SimContext::HIV_POS_NUM];
//num patients at linkage
//stratified by CD4 x HIV state and HVL x HIV state
/** Number of HIV positive patients who become linked */
int numAtLinkage;
/** Number of HIV positive patients who become linked stratified by CD4 metric*/
int numAtLinkageCD4Metric[SimContext::PEDS_CD4_AGE_CAT_NUM];
/** Number of HIV positive patients stratified by HIV state at linkage */
int numAtLinkageHIV[SimContext::HIV_POS_NUM];
/** Number of HIV positive patients stratified by HIV state at linkage and CD4 metric*/
int numAtLinkageHIVCD4Metric[SimContext::HIV_POS_NUM][SimContext::PEDS_CD4_AGE_CAT_NUM];
/** Number of HIV positive patients stratified by CD4 strata */
int numAtLinkageCD4[SimContext::CD4_NUM_STRATA];
/** Number of HIV positive patients stratified by HVL strata */
int numAtLinkageHVL[SimContext::HVL_NUM_STRATA];
/** Number of HIV positive patients stratified by HIV state at linkage and HVL strata */
int numAtLinkageHVLHIV[SimContext::HVL_NUM_STRATA][SimContext::HIV_POS_NUM];
/** Number of HIV positive patients stratified by HIV state and CD4 strata at linkage */
int numAtLinkageCD4HIV[SimContext::CD4_NUM_STRATA][SimContext::HIV_POS_NUM];
// average CD4 levels at the time of detection (incident and prevalent),
// stratified by HIV state
/** Total CD4 count (prevalent cases) at time of detection */
double CD4AtDetectionPrevalentSum;
/** Average CD4 count (prevalent cases) at time of detection */
double CD4AtDetectionPrevalentAverage;
/** Total CD4 count (prevalent cases) at time of detection stratified by HIV state at detection - absolute CD4 metric only */
double CD4AtDetectionPrevalentSumHIV[SimContext::HIV_POS_NUM];
/** Average CD4 count (prevalent cases) at time of detection stratified by HIV state at detection */
double CD4AtDetectionPrevalentAverageHIV[SimContext::HIV_POS_NUM];
/** Total CD4 count (incident cases) at time of detection */
double CD4AtDetectionIncidentSum;
/** Average CD4 count (incident cases) at time of detection */
double CD4AtDetectionIncidentAverage;
/** Total CD4 count (incident cases) at time of detection stratified by HIV state at detection - absolute CD4 metric only */
double CD4AtDetectionIncidentSumHIV[SimContext::HIV_POS_NUM];
/** Average CD4 count (incident cases) at time of detection stratified by HIV state at detection */
double CD4AtDetectionIncidentAverageHIV[SimContext::HIV_POS_NUM];
// average CD4 levels at the time of linkage,
// stratified by HIV state
/** Total CD4 count at time of linkage */
double CD4AtLinkageSum;
/** Average CD4 count at time of linkage*/
double CD4AtLinkageAverage;
/** Total CD4 count at time of linkage stratified by HIV state at linkage - absolute CD4 metric only*/
double CD4AtLinkageSumHIV[SimContext::HIV_POS_NUM];
/** Average CD4 count at time of linkage stratified by HIV state at linkage */
double CD4AtLinkageAverageHIV[SimContext::HIV_POS_NUM];
// number of months until infection for incident cases
/** Total number of months until infection for incident cases */
double monthsToInfectionSum;
/** Average number of months until infection for incident cases */
double monthsToInfectionAverage;
/** Sum of squares of the number of months until infection for incident cases (for calculating standard deviation) */
double monthsToInfectionSumSquares;
/** Standard deviation of months until infection for incident cases */
double monthsToInfectionStdDev;
// number of months after infection until detection for incident cases
/** Total number of months after infection until detection for incident cases */
double monthsAfterInfectionToDetectionSum;
/** Average number of months after infection until detection for incident cases */
double monthsAfterInfectionToDetectionAverage;
/** Sum of squares of the number of months after infection until detection for incident cases */
double monthsAfterInfectionToDetectionSumSquares;
/** Standard deviation of the number of months after infection until detection for incident cases */
double monthsAfterInfectionToDetectionStdDev;
// number of months to detection for incident and prevalent cases
/** Total number of months to detection for prevalent cases */
double monthsToDetectionPrevalentSum;
/** Average number of months to detection for prevalent cases */
double monthsToDetectionPrevalentAverage;
/** Sum of squares of the number of months to detection for prevalent cases (for calculating standard deviation) */
double monthsToDetectionPrevalentSumSquares;
/** Standard deviation of the number of months to detection for prevalent cases */
double monthsToDetectionPrevalentStdDev;
/** Total number of months to detection for incident cases from model start */
double monthsToDetectionIncidentSum;
/** Average number of months to detection for incident cases from model start */
double monthsToDetectionIncidentAverage;
/** Sum of squares of the number of months to detection for incident cases from model start (for calculating standard deviation) */
double monthsToDetectionIncidentSumSquares;
/** Standard deviation of the number of months to detection for incident cases from model start */
double monthsToDetectionIncidentStdDev;
// number of months to linkage
/** Total number of months to linkage*/
double monthsToLinkageSum;
/** Average number of months to linkage*/
double monthsToLinkageAverage;
/** Sum of squares of the number of months to linkage (for calculating standard deviation) */
double monthsToLinkageSumSquares;
/** Standard deviation of the number of months to linkage */
double monthsToLinkageStdDev;
// number of months to linkage stratified by means of detection
double monthsToLinkageSumMeans[SimContext::HIV_DET_NUM];
double monthsToLinkageAverageMeans[SimContext::HIV_DET_NUM];
double monthsToLinkageSumSquaresMeans[SimContext::HIV_DET_NUM];
double monthsToLinkageStdDevMeans[SimContext::HIV_DET_NUM];
// age months at time of detection for incident and prevalent cases
/** Total age months at time of detection for prevalent cases*/
double ageMonthsAtDetectionPrevalentSum;
/** Average age months at time of detection for prevalent cases*/
double ageMonthsAtDetectionPrevalentAverage;
/** Sum of squares of age months at time of detection for prevalent cases (for calculating standard deviation) */
double ageMonthsAtDetectionPrevalentSumSquares;
/** Standard deviation of age months at time of detection for prevalent cases*/
double ageMonthsAtDetectionPrevalentStdDev;
/** Total age months at time of detection for incident cases*/
double ageMonthsAtDetectionIncidentSum;
/** Average age months at time of detection for incident cases*/
double ageMonthsAtDetectionIncidentAverage;
/** Sum of squares of age months at time of detection for incident cases (for calculating standard deviation) */
double ageMonthsAtDetectionIncidentSumSquares;
/** Standard deviation of age months at time of detection for incident cases*/
double ageMonthsAtDetectionIncidentStdDev;
// age months at time of linkage
/** Total age months at time of linkage*/
double ageMonthsAtLinkageSum;
/** Average age months at time of linkage*/
double ageMonthsAtLinkageAverage;
/** Sum of squares of age months at time of linkage (for calculating standard deviation) */
double ageMonthsAtLinkageSumSquares;
/** Standard deviation of age months at time of linkage*/
double ageMonthsAtLinkageStdDev;
// number patients detected by gender, means of detection, and type of OI presenting
/** Number of detected patients stratified by gender */
int numDetectedGender[SimContext::GENDER_NUM];
/** Number of detected prevalent patients stratified by detection means */
int numDetectedPrevalentMeans[SimContext::HIV_DET_NUM];
/** Number of detected incident patients stratified by detection means */
int numDetectedIncidentMeans[SimContext::HIV_DET_NUM];
/** Number of linked cases startified by link means*/
int numLinkedMeans[SimContext::HIV_DET_NUM];
/** Number of OI detected patients stratified by type of OI leading to detection */
int numDetectedByOIs[SimContext::OI_NUM];
/** Number of patients detected by OI who were previously detected by one of the methods, strat by OI */
int numDetectedByOIsPrevDetected[SimContext::OI_NUM];
// patient accepting distribution, number that accept and return, and testing intervals
/** Patient test accepting distribution stratified by HIV status */
int numTestingAcceptProb[SimContext::TEST_ACCEPT_NUM][SimContext::HIV_EXT_INF_NUM];
/** Distribution of HIV testing intervals */
int numTestingInterval[SimContext::HIV_TEST_FREQ_NUM];
/** Total number of test acceptances */
int numAcceptTest;
/** Total number of test refusals */
int numRefuseTest;
/** Total number of returns for results */
int numReturnForResults;
/** Total number tests where the patient did not return for results*/
int numNoReturnForResults;
/** Total number of Lab Staging Accepts */
int numAcceptLabStaging;
/** Total number of Lab Staging refusals */
int numRefuseLabStaging;
/** Total number of returns for results for Lab Staging*/
int numReturnForResultsLabStaging;
/** Total number tests where the patient did not return for results of Lab Staging*/
int numNoReturnForResultsLabStaging;
/** Total number of people who link to care through Lab Staging */
int numLinkLabStaging;
/** Total number of people who do not link to care through Lab Staging */
int numNoLinkLabStaging;
/** Number Accepting Lab Staging stratified by HIV state*/
int numAcceptLabStagingHIVState[SimContext::HIV_POS_NUM];
/** Number Returning for results of Lab Staging stratified by HIV state*/
int numReturnLabStagingHIVState[SimContext::HIV_POS_NUM];
/** Number of people returning to care through lab staging stratified by Obsv CD4*/
int numReturnLabStagingObsvCD4[SimContext::CD4_NUM_STRATA];
/** Number of people returning to care through lab staging stratified by True CD4*/
int numReturnLabStagingTrueCD4[SimContext::CD4_NUM_STRATA];
/** Number of people returning through lab staging stratified by Observed and True CD4*/
int numReturnLabStagingObsvTrueCD4[SimContext::CD4_NUM_STRATA][SimContext::CD4_NUM_STRATA];
/** Number of people linking to care through lab staging stratified by Obsv CD4*/
int numLinkLabStagingObsvCD4[SimContext::CD4_NUM_STRATA];
/** Number of people linking to care through lab staging stratified by True CD4*/
int numLinkLabStagingTrueCD4[SimContext::CD4_NUM_STRATA];
/** Number of people linking through lab staging stratified by Observed and True CD4*/
int numLinkLabStagingObsvTrueCD4[SimContext::CD4_NUM_STRATA][SimContext::CD4_NUM_STRATA];
// number of tests performed and number of each result
/** Number of HIV tests given stratified by HIV state */
int numTestsHIVState[SimContext::HIV_EXT_INF_NUM];
/** Number of Test results given to prevalent patients */
int numTestResultsPrevalent;
/** Number of Test results given to prevalent patients stratified by test result */
int numTestResultsPrevalentType[SimContext::TEST_RESULT_NUM];
/** Number of Test results given to incident patients */
int numTestResultsIncident;
/** Number of Test results given to incident patients stratified by test result */
int numTestResultsIncidentType[SimContext::TEST_RESULT_NUM];
/** Number of Test results given to HIV negative patients */
int numTestResultsHIVNegative;
/** Number of Test results given to HIV negative patients stratified by test result */
int numTestResultsHIVNegativeType[SimContext::TEST_RESULT_NUM];
// Number of patients who ever take PrEP
int numEverPrEP;
// Number of patients who drop out of PrEP
int numDropoutPrEP;
// Number of patients who stop PrEP due to screening age limit
int numStopPrEPMaxAge;
//EID
/** number of EID test results stratified by type of test*/
int numEIDTestsGivenType[SimContext::EID_TEST_TYPE_NUM];
int numTruePositiveEIDTestResultsType[SimContext::EID_TEST_TYPE_NUM];
int numTrueNegativeEIDTestResultsType[SimContext::EID_TEST_TYPE_NUM];
int numFalsePositiveEIDTestResultsType[SimContext::EID_TEST_TYPE_NUM];
int numFalseNegativeEIDTestResultsType[SimContext::EID_TEST_TYPE_NUM];
/** Total number of EID test results stratified by test num*/
int numEIDTestsGivenTest[SimContext::EID_NUM_TESTS];
/** Total number of true positive EID test results by test num */
int numTruePositiveEIDTestResultsTest[SimContext::EID_NUM_TESTS];
/** Total number of true negative EID test results by test num */
int numTrueNegativeEIDTestResultsTest[SimContext::EID_NUM_TESTS];
/** Total number of false positive EID test results by test num */
int numFalsePositiveEIDTestResultsTest[SimContext::EID_NUM_TESTS];
/** Total number of false negative EID test results by test num */
int numFalseNegativeEIDTestResultsTest[SimContext::EID_NUM_TESTS];
/** Number of months spent false positive*/
double LMsFalsePositive;
double LMsFalsePositiveLinked;
};
/** SurvivalStats holds total survival statistics, used with different survival
group types that exclude X percent bottom and top survival numbers */
class SurvivalStats {
public:
/** Histogram of life months survival */
map<int,int> LMsHistogram;
// Aggregate life months statistics
/** Minimum number of life months lived */
double LMsMin;
/** Maximum number of life months lived */
double LMsMax;
/** Median number of life months lived */
double LMsMedian;
/** Sum deviation from median number of life months lived */
double LMsSumDeviationMedian;
/** Average deviation from median number of life months lived */
double LMsAverageDeviationMedian;
/** Total number of life months lived */
double LMsSum;
/** Average number of life months lived */
double LMsMean;
/** Sum Deviation of the number of life months lived */
double LMsSumDeviation;
/** Average Deviation of the number of life months lived */
double LMsAverageDeviation;
/** Sum Deviation Squares of the number of life months lived */
double LMsSumDeviationSquares;
/** Standard Deviation of the number of life months lived */
double LMsStdDev;
/** Variance of the number of life months lived */
double LMsVariance;
/** Sum Deviation Cubes of the number of life months lived */
double LMsSumDeviationCubes;
/** Skew of the number of life months lived */
double LMsSkew;
/** Sum Deviation Quads of the number of life months lived */
double LMsSumDeviationQuads;
/** Kurtosis of the number of life months lived */
double LMsKurtosis;
// Costs and quality adjusted life months statistics
/** Total costs accrued */
double costsSum;
/** Total costs accrued per person */
double costsMean;
/** Sum of squares of costs accrued */
double costsSumSquares;
/** Standard deviation of costs accrued */
double costsStdDev;
/** Total quality adjusted life months lived */
double QALMsSum;
/** Average quality adjusted life months lived */
double QALMsMean;
/** Sum of squares of quality adjusted life months lived */
double QALMsSumSquares;
/** Standard deviation of quality adjusted life months lived */
double QALMsStdDev;
}; /* end SurvivalStats */
/** InitialDistributions class contains statistics about the initial patient state */
class InitialDistributions {
public:
// CD4 and HVL histograms
/** Histogram of initial CD4 stratas */
int numPatientsCD4Level[SimContext::CD4_NUM_STRATA];
/** Histogram of initial HVL stratas */
int numPatientsHVLLevel[SimContext::HVL_NUM_STRATA];
/** Histogram of initial setpoint levels */
int numPatientsHVLSetpointLevel[SimContext::HVL_NUM_STRATA];
// Age and gender statistics
/** Total initial age (in months) - HIV+ only; if a patient starts HIV-negative their age at time of infection is added */
double sumInitialAgeMonths;
/** Average initial age in months - HIV+ only; if they start the model HIV-negative this is their age at the time of infection */
double averageInitialAgeMonths;
/** Total number of male patients */
int numMalePatients;
/** Total number of female patients */
int numFemalePatients;
/** Prior OI history statistics */
int numPriorOIHistories[SimContext::OI_NUM];
/** ART response type for CD4 effects */
int numARTResposneTypes[SimContext::CD4_RESPONSE_NUM_TYPES];
/** Prevalent generic risk factors */
int numRiskFactors[SimContext::RISK_FACT_NUM];
/** Pediatrics HIV and maternal state */
int numInitialPediatrics[SimContext::PEDS_HIV_NUM][SimContext::PEDS_MATERNAL_STATUS_NUM];
}; /* end InitialDistributions */
/** CHRMsStats class contains aggregates and distributions of CHRMs occurrences (CHRM = chronic-hepatic-renal-malignancies) */
class CHRMsStats {
public:
/** The number of people that had a CHRM stratified by CHRM */
int numPatientsWithCHRM[SimContext::CHRM_NUM];
/** The number of HIV+ people that had a CHRM stratified by CHRM */
int numPatientsWithCHRMHIVPos[SimContext::CHRM_NUM];
/** The number of HIV- people that had a CHRM stratified by CHRM */
int numPatientsWithCHRMHIVNeg[SimContext::CHRM_NUM];
/** The number of HIV+ patients with prevalent CHRMs stratified by CHRM */
int numPrevalentCHRM[SimContext::CHRM_NUM];
/** The number of HIV- patients with prevalent CHRMs stratified by CHRM */
int numPrevalentCHRMHIVNeg[SimContext::CHRM_NUM];
/** The total number of HIV-negative people that had a prevalent CHRM */
int numHIVNegWithPrevalentCHRMs;
/** The number of prevalent CHRMs stratified by CD4 */
int numPrevalentCD4[SimContext::CD4_NUM_STRATA];
/** The number of prevalent CHRMs stratified by both CHRM and CD4 */
int numPrevalentCHRMCD4[SimContext::CHRM_NUM][SimContext::CD4_NUM_STRATA];
/** The number of incident CHRMs in HIV+ patients stratified by CHRM */
int numIncidentCHRM[SimContext::CHRM_NUM];
/** The number of incident CHRMs in HIV- patients stratified by CHRM */
int numIncidentCHRMHIVneg[SimContext::CHRM_NUM];
/** The total number of HIV-negative people that had an incident CHRM */
int numHIVNegWithIncidentCHRMs;
/** The number of incident CHRMs stratified by CD4 */
int numIncidentCD4[SimContext::CD4_NUM_STRATA];
/** The number of incident CHRMs stratified by both CHRM and CD4 */
int numIncidentCHRMCD4[SimContext::CHRM_NUM][SimContext::CD4_NUM_STRATA];
/** The number of CHRM related deaths in HIV+ patients stratified by CHRM */
int numDeathsCHRM[SimContext::CHRM_NUM];
/** The number of CHRM related deaths stratified by CD4 */
int numDeathsCD4[SimContext::CD4_NUM_STRATA];
/** The number of CHRM related deaths stratified by both CHRM and CD4 */
int numDeathsCHRMCD4[SimContext::CHRM_NUM][SimContext::CD4_NUM_STRATA];
};
/** OIStats class contains aggregates and distributions of OI occurrences */
class OIStats {
public:
// Primary, secondary and detected OI counts,
// stratified by OI type, CD4 level, and OI type x CD4 level
/** Primary OI count stratified by OI type */
int numPrimaryOIsOI[SimContext::OI_NUM];
/** Primary OI count stratified by CD4 strata */
int numPrimaryOIsCD4[SimContext::CD4_NUM_STRATA];
/** Primary OI count stratified by OI type and CD4 strata */
int numPrimaryOIsCD4OI[SimContext::CD4_NUM_STRATA][SimContext::OI_NUM];
/** Secondary OI count stratified by OI type */
int numSecondaryOIsOI[SimContext::OI_NUM];
/** Secondary OI count stratified by CD4 strata */
int numSecondaryOIsCD4[SimContext::CD4_NUM_STRATA];
/** Secondary OI count stratified by OI type and CD4 strata */
int numSecondaryOIsCD4OI[SimContext::CD4_NUM_STRATA][SimContext::OI_NUM];
/** Detected OI count stratified by OI type */
int numDetectedOIsOI[SimContext::OI_NUM];
/** Detected OI count stratified by CD4 strata */
int numDetectedOIsCD4[SimContext::CD4_NUM_STRATA];
/** Detected OI count stratified by OI type and CD4 strata */
int numDetectedOIsCD4OI[SimContext::CD4_NUM_STRATA][SimContext::OI_NUM];
/** Total OI events across the whole run */
int numOIEventsTotal;
// OI history logging - number of patients and calculated probabilities of having OI history
// stratified by OI x HVL, OI x CD4, and OI x HVL x CD4
/** Total number of patients stratified by viral load (used for calculating averages) */
int numPatientsHVL[SimContext::HVL_NUM_STRATA];
/** Total number of patients stratified by CD4 strata (used for calculating averages) */
int numPatientsCD4[SimContext::CD4_NUM_STRATA];
/** Total number of patients stratified by viral load and CD4 strata (used for calculating averages) */
int numPatientsHVLCD4[SimContext::HVL_NUM_STRATA][SimContext::CD4_NUM_STRATA];
/** Total number of patients with a history of each OI type stratified by viral load (used for calculating averages) */
int numPatientsOIHistoryHVL[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA];
/** Total number of patients with a history of each OI type stratified by CD4 count (used for calculating averages) */
int numPatientsOIHistoryCD4[SimContext::OI_NUM][SimContext::CD4_NUM_STRATA];
/** Total number of patients with a history of each OI type stratified by viral load and CD4 count (used for calculating averages) */
int numPatientsOIHistoryHVLCD4[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA][SimContext::CD4_NUM_STRATA];
/** Proportion of patients with a history of each OI stratified by viral load */
double probPatientsOIHistoryHVL[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA];
/** Proportion of patients with a history of each OI stratified by CD4 strata */
double probPatientsOIHistoryCD4[SimContext::OI_NUM][SimContext::CD4_NUM_STRATA];
/** Proportion of patients with a history of each OI stratified by viral load and CD4 strata */
double probPatientsOIHistoryHVLCD4[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA][SimContext::CD4_NUM_STRATA];
/** Number of months spent at each viral load strata (used for calculating averages) */
int numMonthsHVL[SimContext::HVL_NUM_STRATA];
/** Number of months spent at each CD4 strata (used for calculating averages) */
int numMonthsCD4[SimContext::CD4_NUM_STRATA];
/** Number of months spent at each viral load and CD4 strata combination (used for calculating averages) */
int numMonthsHVLCD4[SimContext::HVL_NUM_STRATA][SimContext::CD4_NUM_STRATA];
/** Number of months spent at each viral load strata with a history of each OI */
int numMonthsOIHistoryHVL[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA];
/** Number of months spent at each CD4 strata with a history of each OI */
int numMonthsOIHistoryCD4[SimContext::OI_NUM][SimContext::CD4_NUM_STRATA];
/** Number of months spent at each viral load strata and CD4 strata combination with a history of each OI */
int numMonthsOIHistoryHVLCD4[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA][SimContext::CD4_NUM_STRATA];
/** Calculated proportion of months spent with a history of OI in each viral load strata*/
double probMonthsOIHistoryHVL[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA];
/** Calculated proportion of months spent with a history of OI in each CD4 strata*/
double probMonthsOIHistoryCD4[SimContext::OI_NUM][SimContext::CD4_NUM_STRATA];
/** Calculated proportion of months spent with a history of OI in each viral load and CD4 strata combination */
double probMonthsOIHistoryHVLCD4[SimContext::OI_NUM][SimContext::HVL_NUM_STRATA][SimContext::CD4_NUM_STRATA];
}; /* end OIStats */
/** DeathStats contains the statistics and distributions of causes of deaths */
class DeathStats {
public:
// Number of deaths stratified by Cause, CD4, and Cause x CD4
/** Number of deaths in HIV+ patients stratified by death cause */
int numDeathsHIVPosType[SimContext::DTH_NUM_CAUSES];
/** Number of deaths in all patients stratified by death cause */
int numDeathsType[SimContext::DTH_NUM_CAUSES];
/** Number of deaths stratified by type and age */
int numDeathsTypeAge[SimContext::DTH_NUM_CAUSES][SimContext::OUTPUT_AGE_CAT_NUM];
/** Number of deaths stratified by CD4 strata */
int numDeathsCD4[SimContext::CD4_NUM_STRATA];
/** Number of deaths stratified by death cause and CD4 strata */
int numDeathsCD4Type[SimContext::CD4_NUM_STRATA][SimContext::DTH_NUM_CAUSES];
/** Number of deaths stratified by care status */
int numDeathsCare[SimContext::HIV_CARE_NUM];
/** Number of deaths stratified by death cause and care status */
int numDeathsCareType[SimContext::HIV_CARE_NUM][SimContext::DTH_NUM_CAUSES];
/** Total Number of deaths due to ART Tox*/
int numARTToxDeaths;
/** Number of deaths due to ART Tox stratified by age category for cd4 metric*/
int numARTToxDeathsCD4Metric[SimContext::PEDS_CD4_AGE_CAT_NUM];
/** Number of deaths due to ART Tox stratified by cd4*/
int numARTToxDeathsCD4[SimContext::CD4_NUM_STRATA];
/** Number of deaths due to ART Tox stratified by cd4 and hvl*/
int numARTToxDeathsCD4HVL[SimContext::CD4_NUM_STRATA][SimContext::HVL_NUM_STRATA];
/** Number of deaths due to ART Tox stratified by CD4 HVL and OI Hist*/
int numARTToxDeathsCD4HVLOIHist[SimContext::CD4_NUM_STRATA][SimContext::HVL_NUM_STRATA][SimContext::OI_NUM];
/** probability of having oi history for those who died from ART tox stratified by cd4 and hvl and OI */
double probOIHistARTToxDeathsCD4HVL[SimContext::CD4_NUM_STRATA][SimContext::HVL_NUM_STRATA][SimContext::OI_NUM];
/** distribution of people who died from tox based on cd4 and hvl*/
double hvlDistribToxDeathCD4HVL[SimContext::CD4_NUM_STRATA][SimContext::HVL_NUM_STRATA];
/** Number of HIV negative deaths */
int numDeathsUninfected;
/** Number of deaths stratified by HVL and CD4 combination */
int numDeathsHVLCD4[SimContext::HVL_NUM_STRATA][SimContext::CD4_NUM_STRATA];
/** Number of deaths stratified by HVL */
int numDeathsHVL[SimContext::HVL_NUM_STRATA];
// Number of HIV and background mortality deaths stratified by CD4 and OI history
/** Number of HIV deaths with no OI history */
int numHIVDeathsNoOIHistory;
/** Number of HIV deaths with no OI history stratified by CD4 strata */
int numHIVDeathsNoOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Number of HIV deaths with OI history */
int numHIVDeathsOIHistory;
/** Number of HIV deaths with OI history stratified by CD4 strata */
int numHIVDeathsOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Number of background mortality deaths with no OI history */
int numBackgroundMortDeathsNoOIHistory;
/** Number of background mortality deaths with no OI history stratified by CD4 strata */
int numBackgroundMortDeathsNoOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Number of background mortality deaths with OI history */
int numBackgroundMortDeathsOIHistory;
/** Number of background mortality deaths with OI history stratified by CD4 strata */
int numBackgroundMortDeathsOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Sum of CD4's of all patients who died from art Tox*/
double ARTToxDeathsCD4Sum;
/** Sum of Squares of CD4's of all patients who died from Tox*/
double ARTToxDeathsCD4SumSquares;
/** mean CD4 of all patients who died from art Tox*/
double ARTToxDeathsCD4Mean;
/** std dev CD4 of all patients who died from art Tox*/
double ARTToxDeathsCD4StdDev;
}; /* end DeathStats */
/** OverallSurvival stats contains aggregate survival statistics, separate from
SurvivalSummary since these will only be calculated for all cohorts and not subset groups */
class OverallSurvival {
public:
// life months without OI history, with OI history, and both
// stratified by totals and CD4
/** Total life months lived without OI history by HIV+ patients*/
double LMsNoOIHistory;
/** Total life months lived without OI history by HIV+ patients stratified by CD4 strata */
double LMsNoOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Total life months lived with OI history */
double LMsOIHistory;
/** Total life months lived with OI history stratified by CD4 strata */
double LMsOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Total life months lived by HIV+ patients*/
double LMsTotal;
/** Total life months lived stratified by CD4 strata */
double LMsTotalCD4[SimContext::CD4_NUM_STRATA];
// life months stratified by HVL and HVL setpoint
/** Total life months lived stratified by HVL strata */
double LMsHVL[SimContext::HVL_NUM_STRATA];
/** Total life months lived stratified by setpoint HVL strata */
double LMsHVLSetpoint[SimContext::HVL_NUM_STRATA];
// life months with and without OI history, stratified by OI type
/** Total life months lived without OI history stratified by OI type */
double LMsNoOIHistoryOIs[SimContext::OI_NUM];
/** Total life months lived with OI history stratified by OI type */
double LMsOIHistoryOIs[SimContext::OI_NUM];
/** Total life months lived with CHRM History for HIV+ patients stratified by CHRM type */
double LMsCHRMHistoryCHRMsHIVPos[SimContext::CHRM_NUM];
/** Total life months lived with CHRM History for HIV- patients stratified by CHRM type */
double LMsCHRMHistoryCHRMsHIVNeg[SimContext::CHRM_NUM];
// life months stratified by HIV state and HIV positive total
/** Total life months lived with HIV */
double LMsHIVPositive;
/** Total life months lived in each HIV state */
double LMsHIVState[SimContext::HIV_ID_NUM];
/** Total quality adjusted life months lived with HIV */
double QALMsHIVPositive;
/** Total quality adjusted life months lived in each HIV state */
double QALMsHIVState[SimContext::HIV_ID_NUM];
// life months in screening state and regular model
/** Total life months lived in the screening state */
double LMsInScreening;
/** Total quality adjusted life months lived in the screening state */
double QALMsInScreening;
// Total life months lived by HIV-negative patients on PrEP
double LMsHIVNegativeOnPrEP;
/** Total life months lived in "regular CEPAC" (i.e. non-screening state) */
double LMsInRegularCEPAC;
// life months by gender
/** Total life months lived stratified by gender */
double LMsGender[SimContext::GENDER_NUM];
/** Total quality adjusted life months lived stratified by gender */
double QALMsGender[SimContext::GENDER_NUM];
}; /* end OverallSurvival */
/** OverallCosts class contains aggregate cost stats */
class OverallCosts {
public:
// costs without OI history, with OI history, and both
// stratified by totals and CD4
/** Total costs accrued without OI history */
double costsNoOIHistory;
/** Total costs accrued without OI history stratified by CD4 */
double costsNoOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Total costs accrued with OI history */
double costsOIHistory;
/** Total costs accrued with OI history stratified by CD4 */
double costsOIHistoryCD4[SimContext::CD4_NUM_STRATA];
/** Total costs accrued */
double costsTotal;
/** Total costs accrued stratified by CD4 */
double costsTotalCD4[SimContext::CD4_NUM_STRATA];
// costs stratified by HVL and HVL setpoint
/** Total costs accrued stratified by HVL */
double costsHVL[SimContext::HVL_NUM_STRATA];
/** Total costs accrued stratified by HVL setpoint */
double costsHVLSetpoint[SimContext::HVL_NUM_STRATA];
// direct medical costs for prophylaxis, stratified by total, OI, and OI x proph line
/** Total direct medical costs for prophylaxis */
double directCostsProph;
/** Direct medical costs for prophylaxis stratified by OI type */
double directCostsProphOIs[SimContext::OI_NUM];
/** Direct medical costs for prophylaxis stratified by OI type and prophylaxis line */
double directCostsProphOIsProph[SimContext::OI_NUM][SimContext::PROPH_NUM];
// direct costs for ART, stratified by total and ART line
/** Direct costs for ART */
double directCostsART;
/** Direct costs for ART stratified by ART line*/
double directCostsARTLine[SimContext::ART_NUM_LINES];
/** Direct costs for ART if using mult discount rates*/
double directCostsARTMultDisc[SimContext::NUM_DISCOUNT_RATES];
double directCostsARTLineMultDisc[SimContext::ART_NUM_LINES][SimContext::NUM_DISCOUNT_RATES];
/**Costs for initiating a line of art*/
double costsARTInit;
/**Costs for initiating a line of art by art line*/
double costsARTInitLine[SimContext::ART_NUM_LINES];
/**Monthly costs of art*/
double costsARTMonthly;
/**Monthly costs of art by art line*/
double costsARTMonthlyLine[SimContext::ART_NUM_LINES];
/** monthly and init costs for art if using multiple discount rates*/
double costsARTInitMultDisc[SimContext::NUM_DISCOUNT_RATES];
double costsARTInitLineMultDisc[SimContext::ART_NUM_LINES][SimContext::NUM_DISCOUNT_RATES];
double costsARTMonthlyMultDisc[SimContext::NUM_DISCOUNT_RATES];
double costsARTMonthlyLineMultDisc[SimContext::ART_NUM_LINES][SimContext::NUM_DISCOUNT_RATES];
// costs stratified by HIV states and total for HIV positives
/** Total costs for HIV positive patients */
double costsHIVPositive;
/** Total costs stratified by HIV states */
double costsHIVState[SimContext::HIV_ID_NUM];
// costs for various screening and testing
/** Total costs for CD4 tests */
double costsCD4Testing;
/** Total costs for HVL tests */
double costsHVLTesting;
/** costs of cd4 and hvl testing for multiple discount rates*/
double costsCD4TestingMultDisc[SimContext::NUM_DISCOUNT_RATES];
double costsHVLTestingMultDisc[SimContext::NUM_DISCOUNT_RATES];
/** Total TB costs (Discounted)*/
double costsTBTotal;
/** Costs of TB tests */
double costsTBTests;
double costsTBTestsInit[SimContext::TB_NUM_TESTS];
double costsTBTestsDST[SimContext::TB_NUM_TESTS];
/** costs of TB treatment */
double costsTBTreatment;
double costsTBTreatmentByLine[SimContext::TB_NUM_TREATMENTS];
double costsTBTreatmentToxByLine[SimContext::TB_NUM_TREATMENTS];
/** TB Visit Costs */
double costsTBProviderVisits[SimContext::COST_NUM_TYPES];
double costsTBMedicationVisits[SimContext::COST_NUM_TYPES];
/** Total costs for clinic visits */
double costsClinicVisits;
/** Total PrEP costs */
double costsPrEP;
/** Total PrEP costs for those never infected with HIV */
double costsPrEPNeverHIV;
/** Total PrEP costs for those who have had PrEP but get HIV by PrEP status*/
double costsPrEPHIVPos[SimContext::HIV_POS_PREP_STATES_NUM-1];
/** Total costs for HIV screening tests */
double costsHIVScreeningTests;
/** Total costs for HIV screening miscellaneous costs */
double costsHIVScreeningMisc;
/** Total Costs for Lab Staging tests */
double costsLabStagingTests;
/** Total Costs for EID tests */
double costsEIDTests;
/** Total costs for Lab Staging misc costs*/
double costsLabStagingMisc;
/** Total Costs for EID misc costs */
double costsEIDMisc;
/** Total costs for EID visits */
double costsEIDVisits;
/** Total costs for Infant HIV Proph */
double costsInfantHIVProph;
// undiscounted costs stratified by cost type and unclassified costs
/** Total undiscounted costs stratified by cost type */
double totalUndiscountedCosts[SimContext::COST_NUM_TYPES];
/** Total undiscounted unclassified costs */
double totalUndiscountedCostsUnclassified;
// discounted costs stratified by cost type and unclassified costs
/** Total discounted costs stratified by cost type */
double totalDiscountedCosts[SimContext::COST_NUM_TYPES];
/** Total discounted unclassified costs */
double totalDiscountedCostsUnclassified;
// costs for drugs and toxicities
/** Costs due to drugs */
double costsDrugs;
double costsDrugsDiscounted;
/**costs due to adherence interventions*/
double costsInterventionStartup;
double costsInterventionMonthly;
/** Costs due to toxicity*/
double costsToxicity;
double costsToxicityDiscounted;
/** Costs due to CHRMs*/
double costsCHRMs[SimContext::CHRM_NUM];
/** Total costs stratified by gender */
double costsGender[SimContext::GENDER_NUM];
}; /* end OverallCosts */
/** TBStats class contains stats about TB occurrences, treatments, and costs */
class TBStats {
public:
/** Total number with TB disease at model entry for those infected with TB, stratified by TB strain x TB state */
int numInStateAtEntryStrain[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_STATES];
/** Total number uninfected with TB at model entry*/
int numUninfectedTBAtEntry;
/** Total number with each combination of unfavorable outcomes */
int numWithUnfavorableOutcome[2][2][2][2];
// number with various TB treatment effects, stratified by TB strain x TB treatment number
/** Total number of times patients start a TB treatment regimen stratified by observed TB strain x TB treatment number */
int numStartOnTreatment[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_TREATMENTS];
/** Total number who drop out of TB treatment stratified by observed TB strain x TB treatment number */
int numDropoutTreatment[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_TREATMENTS];
/** Total number who transition to TB Treatment Default state (i.e. are cured of TB despite dropping out of treatment) stratified by observed TB strain x TB treatment number */
int numTransitionsToTBTreatmentDefault[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_TREATMENTS];
/** Total number of times patients finish treatment stratified by observed TB strain x TB treatment number */
int numFinishTreatment[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_TREATMENTS];
/** Total number who are cured after finishing treatment stratified by true TB strain x TB treatment number */
int numCuredAtTreatmentFinish[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_TREATMENTS];
/** Total number with increased resistance after stopping treatment stratified by true TB strain before increase x TB treatment number - XDR is included in declaration for convenience but should never be incremented or output*/
int numIncreaseResistanceAtTreatmentStop[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_TREATMENTS];
// total number of infections and reinfections, stratified by TB strain and TB state
int numInfections[SimContext::TB_NUM_STATES][SimContext::TB_NUM_STRAINS];
/** Total number of reactivations from latent TB stratified by TB strain */
int numReactivationsLatent[SimContext::TB_NUM_STRAINS];
int numReactivationsPulmLatent[SimContext::TB_NUM_STRAINS];
int numReactivationsExtraPulmLatent[SimContext::TB_NUM_STRAINS];
// number of relapses from treated or default TB states, stratified by TB strain
int numRelapses[SimContext::TB_NUM_STRAINS];
int numRelapsesPulm[SimContext::TB_NUM_STRAINS];
int numRelapsesExtraPulm[SimContext::TB_NUM_STRAINS];
/** Total number of self-cures from active TB, stratified by TB strain */
int numTBSelfCures[SimContext::TB_NUM_STRAINS];
/** Total number of deaths from active TB, stratified by TB strain */
int numDeaths[SimContext::TB_NUM_STRAINS];
// Total number of deaths from active TB in HIV-positive patients, stratified by TB strain
int numDeathsHIVPos[SimContext::TB_NUM_STRAINS];
// Total number of deaths from active TB in HIV-negative patients, stratified by TB strain
int numDeathsHIVNeg[SimContext::TB_NUM_STRAINS];
/** Total number of minor toxicities stratified by treatment line */
int numTreatmentMinorToxicity[SimContext::TB_NUM_TREATMENTS];
/** Total number of major toxicities stratified by treatment line */
int numTreatmentMajorToxicity[SimContext::TB_NUM_TREATMENTS];
/** Total number of minor toxicities stratified by proph line */
int numProphMinorToxicity[SimContext::TB_NUM_PROPHS];
/** Total number of major toxicities stratified by proph line */
int numProphMajorToxicity[SimContext::TB_NUM_PROPHS];
// Number of DST test results for those without Tb by observed strain
int numDSTTestResultsUninfectedTB[SimContext::TB_NUM_STRAINS];
// Number of DST test results for those by observed strain and true strain [obsv][true]
int numDSTTestResultsByTrueTBStrain[SimContext::TB_NUM_STRAINS][SimContext::TB_NUM_STRAINS];
}; /* end TBStats */
/** LTFUStats contains stats about patient loss to follow up and return to care */
class LTFUStats {
public:
// totals for patients that were ever lost and deaths while lost
/** Total number of patients ever lost*/
int numPatientsLost;
/** Total number of patients who ever returned */
int numPatientsReturned;
/** Total number of deaths occurring while lost from care */
int numDeathsWhileLost;
// totals for times ltfu and rtc stratified by CD4