Skip to content

Getting started

Creating your first composite score is straightforward:

julia
using RheumaComposites, Unitful
das28 = DAS28CRP(tjc=1, sjc=0, pga=2.2u"cm", apr=4u"mg/L")
DAS28CRP
  VALUES: (1.0, 0.0, 22.0, 4.0)
  NAMES: (:tjc, :sjc, :pga, :apr)
  UNITS: (pga = mm, apr = mg L^-1)

RheumaComposites requires you to specify units where possible. To do so you can use the @u_str macro as shown above.

This hopefully makes it much less unlikely that a measurement taken in centimeters is suddely entered as millimeters!

You are free to specify the score in whichever unit you'd like, so long as it is a compatible unit (i.e., meters and centimeters works, but not square centimeters).

julia
score(das28) == score(DAS28CRP(tjc=1, sjc=0, pga=22u"mm", apr=4u"mg/L"))
true

If you need to retrieve a specific value stored in the composite, you can use the respectively named accessor function:

julia
pga(das28)
22.0 mm

If you would like to retrieve all values, you can use values:

julia
values(das28)
(1.0, 0.0, 22.0, 4.0)

As you can see, these values come without units! Depending on your needs, you can also retrieve the units with units using uvalues

julia
uvalues(das28)
(1.0, 0.0, 22.0 mm, 4.0 mg L^-1)

Finally, you can use names to retrieve the variables names making up that composite.

julia
names(das28)
(:tjc, :sjc, :pga, :apr)

The above concepts hold for all supported composites.


This page was generated using Literate.jl.