hasklepias-core-0.30.3: Domain-aware tools and types for constructing epidemiological cohorts
Copyright(c) Target RWE 2023
LicenseBSD3
Maintainerbbrown@targetrwe.com ljackman@targetrwe.com dpritchard@targetrwe.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cohort

Description

 
Synopsis

Types for Cohort data

type CohortSpecMap t m a = Map Text (CohortSpec t m a) Source #

Container for CohortSpec for different cohorts, as given by the Text keys.

data CohortSpec t m a Source #

A container for all logic needed to construct a cohort. The provided functions will be run on subject-level data, subject-by-subject. Logic will be executed as part of a CohortApp pipeline. The type CohortApp itself is not exported, but the user will create such a pipeline via the exported cohortMain.

Note runVariables must construct *all* output variables. For a more detailed explanation of the cohort-building pipeline, see the Hasklepias module documentation from `hasklepias-main`.

Constructors

MkCohortSpec 

Fields

  • runIndices :: NonEmpty (Event t m a) -> IndexSet a

    Constructs the set of index times, of type Interval a, for a given subject based on the full list of subject data in the NonEmpty input list of Event t m a.

  • runCriteria :: NonEmpty (Event t m a) -> Interval a -> Criteria

    Constructs a non-empty list of inclusion / exclusion criteria for a single subject, relative to a particular index time. There will be one Criteria value for each subject and element of IndexSet a.

  • runVariables :: NonEmpty (Event t m a) -> Interval a -> VariableRow

    Construct all output variables for the provided subject data, with respect to a particular index time.

Index

Criteria

data Criterion Source #

A Status paired with some descriptive label.

Constructors

MkCriterion 

Fields

Instances

Instances details
Arbitrary Criterion 
Instance details

Defined in Tests.Cohort.Criteria

Show Criterion Source # 
Instance details

Defined in Cohort.Criteria

Eq Criterion Source # 
Instance details

Defined in Cohort.Criteria

data Status Source #

Indication of whether a given subject should be included or excluded from the cohort.

Constructors

Include 
Exclude 

Instances

Instances details
Arbitrary Status 
Instance details

Defined in Tests.Cohort.Criteria

Methods

arbitrary :: Gen Status

shrink :: Status -> [Status]

Show Status Source # 
Instance details

Defined in Cohort.Criteria

Eq Status Source # 
Instance details

Defined in Cohort.Criteria

Methods

(==) :: Status -> Status -> Bool #

(/=) :: Status -> Status -> Bool #

includeIf :: Bool -> Status Source #

Helpers to convert a Bool to a Status.

>>> includeIf True
>>> includeIf False
Include
Exclude

excludeIf :: Bool -> Status Source #

Helpers to convert a Bool to a Status.

>>> includeIf True
>>> includeIf False
Include
Exclude