Skip to content

API

RheumaComposites.RheumaComposites Module
julia
RheumaComposites

A Julia package for composite scores in Rheumatology.

source
RheumaComposites.AbstractComposite Type

AbstractComposite

Abstract type that specifies the category of composites.

It is either ContinuousComposite, BooleanComposite, or ModifiedComposite.

source
RheumaComposites.BASDAI Type
julia
BASDAI(; tjc, sjc, pga, jpn[; units])

Store component measures of the Bath Ankylosing Spondylitis Disease Activity Index, or BASDAI.

Optionally specify the units for each component using Unitful.@u_str.

Components

  • q1 (cm) fatigue or tiredness

  • q2 (cm) AS neck, back, or hip pain

  • q3 (cm) pain or swelling in other joints

  • q4 (cm) discomfort from tender areas

  • q5 (cm) morning stiffness severity

  • q6 (cm) morning stiffness duration

Categories

The only cutoff I am aware of checks if a person's BASDAI is below 4. This is currently implemented in categorise and isremission, making them effectively redundant. Feel free to open an issue on the GitHub page of this package if you know about other cutoffs.

External links

See also score.

source
RheumaComposites.BooleanComposite Type
julia
BooleanComposite <: AbstractComposite

Abstract type for composites only implementing a definition of remission.

See also isremission, ContinuousComposite.

source
RheumaComposites.BooleanRemission Type
julia
BooleanRemission(; tjc, sjc, pga, crp[; units])

Store the components of the original ACR/EULAR Boolean remission.

Optionally specify the units for each component using Unitful.@u_str.

Components

  • tjc 28 tender joint count

  • sjc 28 swollen joint count

  • pga (cm) patient's global assessment

  • crp (mg/dL) C-reactive protein

See also isremission.

source
RheumaComposites.CDAI Type
julia
CDAI(; tjc, sjc, pga, ega[; units])

Store component measures of the Clinical Disease Activity Index, or CDAI.

Optionally specify the units for each component using Unitful.@u_str.

Components

  • tjc 28 tender joint count

  • sjc 28 swollen joint count

  • pga (cm) patient's global assessment

  • ega (cm) evaluator's global assessment

Categories

  • < 2.8 = Remission

  • 10.0 = Low

  • 22.0 = Moderate

  • > 22.0 = High

External links

See also score, categorise, isremission.

source
RheumaComposites.ContinuousComposite Type
julia
ContinuousComposite <: AbstractComposite

Abstract type for composites whose scores are floating point numbers.

See also score, BooleanComposite.

source
RheumaComposites.DAPSA Type
julia
DAPSA(; tjc, sjc, pga, jpn[; units])

Store component measures of the index for Disease Activity in Psoriatic Arthritis, or DAPSA.

Optionally specify the units for each component using Unitful.@u_str.

Components

  • tjc 66 tender joint count

  • sjc 68 swollen joint count

  • pga (cm) patient's global assessment

  • jpn (cm) joint pain

Categories

  • 4.0 = Remission

  • 14.0 = Low

  • 28.0 = Moderate

  • > 28.0 = High

External links

See also score, categorise, isremission.

source
RheumaComposites.DAS28 Type
julia
DAS28 <: ContinuousComposite

Abstract type for DAS28 subtypes.

See also DAS28ESR, DAS28CRP.

source
RheumaComposites.DAS28CRP Type
julia
DAS28CRP(; tjc, sjc, pga, apr[; units])

Store the component measures of the DAS28CRP.

Optionally specify the units for each component using Unitful.@u_str.

Components

  • tjc 28 tender joint count

  • sjc 28 swollen joint count

  • pga (cm) patient's global assessment

  • apr (mg/L) active phase reactant, here CRP

Categories

  • < 2.4 = Remission

  • 2.9 = Low

  • 4.6 = Moderate

  • > 4.6 = High

External links

See also score, categorise, isremission.

source
RheumaComposites.DAS28ESR Type
julia
DAS28ESR(; tjc, sjc, pga, apr[; units])

Store the component measures of the DAS28ESR.

Optionally specify the units for each component using Unitful.@u_str.

Components

  • tjc 28 tender joint count

  • sjc 28 swollen joint count

  • pga (cm) patient's global assessment

  • apr (mm/hr) active phase reactant, here ESR

Categories

  • < 2.6 = Remission

  • 3.2 = Low

  • 5.1 = Moderate

  • > 5.1 = High

External links

See also score, categorise, isremission.

source
RheumaComposites.Faceted Type
julia
Faceted{T} <: ModifiedComposite

This type indicates a further grouping of the stored composite's components.

source
RheumaComposites.ModifiedComposite Type
julia
ModifiedComposite <: AbstractComposite

Abstract type representing alterations to existing composites.

See also faceted, revised, threeitem.

source
RheumaComposites.Partial Type
julia
Partial{T}

Redefine a composite as a subset of its components.

source
RheumaComposites.Revised Type
julia
Revised{T} <: ModifiedComposite

This type indicates that the stored composite's threshold for remission has been revised.

See also BooleanRemission.

source
RheumaComposites.SDAI Type
julia
SDAI(; tjc, sjc, pga, ega, crp[; units])

Store component measures of the Simplified Disease Activity Index, or SDAI.

Optionally specify the units for each component using Unitful.@u_str.

Components

  • tjc 28 tender joint count

  • sjc 28 swollen joint count

  • pga (cm) patient's global assessment

  • ega (cm) evaluator's global assessment

  • crp (mg/dL) c-reactive protein

Categories

  • 3.3 = Remission

  • 11.0 = Low

  • 26.0 = Moderate

  • > 26.0 = High

External links

See also score, categorise, isremission.

source
Base.names Method
julia
names(x::AbstractComposite)

Return the names of x's values.

source
Base.values Method
julia
values(x::AbstractComposite)

Return the values stored in x.

source
Base.values Method
julia
values(x::ModifiedComposite)

Return the values of the unmodified composite, i.e., x.root.values.

source
Base.values Method
julia
values(x::Partial{N,<:BooleanComposite})

Return the values kept by x.

source
RheumaComposites.categorise Method
julia
categorise(x::ContinuousComposite)

Convert x to a discrete value.

Examples

julia
julia> DAS28ESR(tjc=4, sjc=5, pga=12u"mm", apr=44u"mm/hr") |> categorise
"moderate"
source
RheumaComposites.categorise Method
julia
categorise(x::Faceted{<:ContinuousComposite})

Convert the root composite of x to a discrete value.

source
RheumaComposites.categorise Method
julia
categorise(::Type{T}, s::Real) where {T<:ContinuousComposite}

Convert score s to a discrete value using T's thresholds.

Examples

julia
julia> categorise(SDAI, 3.6)
"low"
source
RheumaComposites.decompose Method
julia
decompose(x::ContinuousComposite; digits=3)

Return the proportion to which each component contributes to the composite's score.

Optionally specify the number of digits to round the results to.

See also score.

Examples

julia
julia> SDAI(tjc=4, sjc=5, pga=1.6u"cm", ega=1.2u"cm", crp=3u"mg/dL") |> decompose
Dict{Symbol, Float64} with 5 entries:
  :tjc => 0.27
  :ega => 0.081
  :sjc => 0.338
  :pga => 0.108
  :crp => 0.203
source
RheumaComposites.decompose Method
julia
decompose(x::Faceted{<:ContinuousComposite}; digits=3)

Return the proportion to which each facet contributes to the composite's score.

Examples

julia
julia> root = DAS28ESR(tjc=4, sjc=5, pga=14u"mm", apr=12u"mm/hr");

julia> faceted(root, (objective=[:sjc, :apr], subjective=[:tjc, :pga])) |> decompose
Dict{Symbol, Float64} with 2 entries:
  :subjective => 0.357
  :objective  => 0.642
source
RheumaComposites.faceted Method
julia
faceted(root::ContinuousComposite, facets::NamedTuple)

Specify a custom grouping along which the composite can be analysed.

See also decompose.

source
RheumaComposites.intercept Method
julia
intercept(x::ContinuousComposite)

Return the intercept.

This function can be useful if you want to implement custom decomposition or component reweighting.

See also score, decompose.

source
RheumaComposites.isremission Method
julia
isremission(x::AbstractComposite)

Check whether a composite fulfils remission criteria.

Examples

julia
julia> DAS28ESR(tjc=4, sjc=5, pga=44u"mm", apr=23u"mm/hr") |> isremission
false
julia> BooleanRemission(tjc=1, sjc=0, pga=1.4u"cm", crp=0.4u"mg/dL") |>
       revised |>
       isremission
true
source
RheumaComposites.isremission Method
julia
isremission(::Type{T}, s::Real) where {T<:ContinuousComposite}

Check whether a composite fulfils remission criteria.

Examples

julia
julia> isremission(DAS28ESR, 3.9)
false
source
RheumaComposites.named_vals Method
julia
named_vals(x::AbstractComposite)

Return the values of x and their names in a NamedTuple.

source
RheumaComposites.offsets Method
julia
offsets(x::Revised{<:BooleanComposite})

Return the offsets to remission thresholds.

source
RheumaComposites.partial Method
julia
partial(root::AbstractComposite, keep::Vector{Symbol})

Redefine a composite as a subset of its components.

Functions like score or isremission act on the subset of components.

source
RheumaComposites.revised Method
julia
revised(root::BooleanRemission, offset::NamedTuple)
revised(root::BooleanRemission; offset::NamedTuple=(; pga=10u"mm"))

Modify the remission thresholds of a composite.

The values passed to offset will be added to the default thresholds of root.

See also isremission.

source
RheumaComposites.root Method
julia
root(x::ModifiedComposite)

Return the unmodified composite.

source
RheumaComposites.score Method
julia
score(c::ContinuousComposite; digits=3)

Score a composite and optionally specify the rounding precision.

Examples

julia
julia> DAS28ESR(tjc=4, sjc=2, pga=64u"mm", apr=44u"mm/hr") |> score
5.061
source
RheumaComposites.threeitem Method
julia
threeitem(root::BooleanRemission)

Change the calculation of Boolean remission to exclude patient global assessment.

Alias for partial(root::BooleanRemission, [:sjc, :tjc, :crp]).

See also partial, isremission, BooleanRemission.

source
RheumaComposites.units Method
julia
units(x::AbstractComposite)

Return the units of x's values.

source
RheumaComposites.uvalues Method
julia
uvalues(x::AbstractComposite)

Return the values stored in x in their units.

source
RheumaComposites.weight Method
julia
weight(x::T) where {T}

Weight a composite score's components according to its weighting scheme.

Example

julia
julia> DAS28CRP(tjc=2, sjc=2, pga=54u"mm", apr=19u"mg/L") |> weight
(0.7919595949289333, 0.39597979746446665, 0.756, 1.0784636184794367)
source