Costs
computes treatment, screening and biopsy costs given age
and other arguments that specifically apply to the cost-type.
The class's constructor reads the costs specifications from its Scenario
argument. The specifications are formatted like this:
# discount: pairs of (increasing) begin-diam: cost # age cost biop (first diameter must be 0) costs: 50 0 176 0: 6438 20: 7128 50: 7701
Its d_treatment
vector stores the various diameter/costs combinations. The
age specifications are double
values.
Biopsy, screening and treatment costs are all computed by the member
discount
. Depending on the context (cf. section 2.5) either the
screening age or the tumor self-detection age is used as discount's
age argument.
When computing the biopsy cost the configured biopsy cost is used as
discount's
cost argument. When computing the screening costs the costs of
the used modality are used. When computing the treatment costs the biopsy
costs plus the costs associated with the tumor's diameter are used.
The member discount
is a simple 1-line function:
double Costs::discount(double age, size_t cost) const { return cost * pow(1 + d_discountProportion, d_referenceAge - age); }
The costs associated with the tumor's diameter is returned by the member
cost
, returning the costs that are associated with the last configured
diameter that is at least equal to the specified diameter (e.g., if the
diameters 0, 20, and 50 are configured and the specified diameter is equal to
30 then the costs associated with diameter 20 are used.
Densities
object provides access to information about the breast
densities (cf. bi-rads info).
The American College of Radiology (ACR) distinguishes four breast densitiy
categories:
In the simrisc
configuration file the distributions of probabilities of these four
categories by age groups are provided by the breastDensities:
specifications, e.g.,
bi-rad classification ---------------------------- agegroup a b c d breastDensities: 0 - 40 0.05 0.30 0.48 0.17 ... breastDensities: 70 - * 0.18 0.54 0.26 0.02
Age groups consist of an initial age and an upper limit. The upper limit is
not considered part of the age range, but becomes the initial age of the next
range. The final age range may use age specification *
, indicating the
maximum possible age of simulated cases. Specifications following a
specification using ending age *
are ignored. Simrisc
checks whether the
bi-rad probabilities per age group add to 1.00, and whether the ending age of
an age group is equal to the initial age of the next age group.
At the initialization phase of Loop::womenLoop
(cf. section 2.5.2
breast densitiy indices (0..3) corresponding to bi-rad classifications a..d
are determined for the simulated case's screening ages. The member
Densities::indices
generates a random value from the uniform random
distribution and uses that probability to determine the bi-rad classification
for the various screening ages, returning a vector containing the bi-rad
classifications (0..3) for each screening round.
Modalities
object. The
modalities object provides the interface to modalities that are defined for
screening rounds. All modalities that are thus accessible are derived from a
base class ModBase
. ModBase
defines the interface that must be offered
by classes derived from ModBase
. This allows reuse of existing components
of simrisc
that use modalities, irrespective of what actual modalities are
configured for the various screening rounds.
The structure of this design is illustrated in Figure 3.
Figure 3 shows the Modality
object in blue. It communicates with
ModBase
objects. ModBase
is a polymorphic base clase completely
defining the interface modalities must provide. What modalities there are or
will be at some poiny in the future is irrelevant, as long as these future
modalities implement the interface required by ModBase
.
Currently three modalities are available: an MRI modality, a Mammo modality
and a Tomo modality. The arrows pointing down from ModBase
suggest time:
MammoTomo was originally implemented. At some later point in time MRI was
added. At some point in the future another, as yet unknown, modality may be
added. At that point only the new modality must be implemented, but the
program using the new modality can be reused, not requiring additional
modifications.
The Modality
constructor receives the modality
parameter
specifications from the configuration file. Modality parameters specify the
name of the modality; the costs of using the modality; optionally
specifications of radiation doses for the treatment of the four bi-rads
categories; the modality's sensitivity (optionally differently specified for
the four bi-rads categories, and the modality's specificity, optionally using
age groups, like the age groups that were used when specifying breast density
parameters. E.g.,
# bi-rads bi-rads (agegroups: values) # modalities id cost dose sensitivity specificity # 1..4 1..4 modality: Mammo 64 3 3 3 3 0.87 0.84 0.73 0.65 0-40: 0.961 40-*: 0.965 modality: MRI 64 0.00 0.00
The constructor uses the specification ID to create the matching
modality-handling object. Modality handlers are derived from the (polymorphic)
modality base class ModBase
(see the next section).
When a screening is performed for a specific screening age (cf. section
2.5.5.2) then all modalities that were specified for that screening age
are visited in turn. Screening round specifications define the modalities that
are used for those rounds (cf. section 3.4). The Screening
class provides, per screening round, the names (IDs) of the modalities that
are used for those rounds, The member Modality::use
receives these IDs and
returns pointers to the modalities that are associated with those IDs. Those
modalities are then applied in turn to the current case.
ModBase
defines the interface for modalities that is available
for other parts of simrisc
, in particular to members of the class Loop
(cf. section 2.5). The interface provides the following members:
double sensitivity(size_t idx)
: the modality's sensitivity given a
bi-rad category idx
. For modalities that are independent of bi-rad
categories the idx
argument is ignored;
double specificity(double age)
: the modality's specificity given an
age. For modalities that are independent of age the age
argument
is ignored;
uint16_t cost()
: returns the costs associated with using the
modality;
uint16_t nr() const
: returns an identifying order-number of the
modality; The order number is used, e.g., when updating the number of
false negative decisions during screening loops;
void resetCounters(size_t nRounds)
: clears the vector counting the
number of times modalities are used by the screening rounds and resets
the number of encountered false positives to 0;
void count(size_t round)
: increments the usage count for the
specified screening round;
void falsePositive()
: increments the number of false positive
decisions;
std::string const &id()
: returns the name (e.g., MRI, Mammo) of the
modality;
double const *dose()
: returns the array of radiation doses associated
with the modality or 0 if there are no associated radiation doses;
double dose(uint16_t idx)
: returns the radiation dose of a specified
bi-rad category or 0 if there are no associated radiation doses.
MRI
is derived from ModBase
. Its sensitivity and specificity
values are constant values, and there are no radiation doses associated with
this modality.
MammoTomo
is derived from ModBase
.
This description is currently under construction.
Screening
handles the screening parameters. Screening parameters
are obtained from the Scenario
object (cf. section 2.4).
At construction time the following parameters are obtained:
# value distribution: systematicError: 0 Normal
# value distribution: attendanceRate: 0.8 Normal
MRI,
Mammo
(mammography) and Tomo
(tomosynthesis) are available.
Screening rounds use specifications like this:
screeningRound: 58 Mammo MRI