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

Cohort.Criteria

Description

This module defines the return type of Cohort.Cohort.runCriteria in a CohortSpec. Criteria, an alias for NonEmpty Criterion, is computed subject-by-subject for each cohort. Each Criteria is computed from subject-level data and a given index time. A single subject has one value of Criteria, with one or more Criterion values, at each given index time.

Each Criterion indicates whether an Cohort.Cohort.ObsUnit, of which there is one per subject and index time, should be Excludeed from the cohort, or Includeed contingent on the Cohort.Cohort.ObsUnit not being Excludeed by any other criterion. In other words, a Cohort.Cohort.ObsUnit is included if and only if they are Includeed for every Criterion.

See the Hasklepias module documentation in `hasklepias-main` for more information on how Criteria are processed in a CohortApp pipeline.

Synopsis

Documentation

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 #

type Criteria = NonEmpty Criterion Source #

Type alias for a NE.NonEmpty list of Criterion. This is the return type of Cohort.Cohort.CohortSpec.runCriteria. NE.NonEmpty is used to prevent ill-defined behavior in the cohort processing logic of Cohort.Core: An subject with no Criterion computed for a given index time would need to be given an implicit Include or Exclude with empty label, which instead is better supplied explicitly as a singleton list of Criteria.

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