# This line defines the study population
 population=patients.satisfying(
     """
         has_follow_up AND
         (age >=18 AND age <= 110) AND
         (sex = "M" OR sex = "F")
         """,
     has_follow_up=patients.registered_with_one_practice_between(
         "2019-02-28", "2020-02-29")),
 # Outcomes
 icu_date_admitted=patients.admitted_to_icu(
     on_or_after="2020-03-01",
     include_day=True,
     returning="date_admitted",
     find_first_match_in_period=True,
     return_expectations={
         "date": {
             "earliest": "2020-03-01"
         },
         "incidence": 0.1
     },
 ),
 died_ons_covid_flag_any=patients.with_these_codes_on_death_certificate(
     covid_identification,
     on_or_after="2020-03-01",
     match_only_underlying_cause=False,
     return_expectations={
         "date": {
             "earliest": "2020-03-01"
         },
         "incidence": 0.1
     },
        find_first_match_in_period=True,
        return_expectations={
            "date": {
                "earliest": "2020-02-01"
            },
            "rate": "exponential_increase"
        },
    ),

    # ICU attendance and ventilation
    any_resp_support_flag=patients.admitted_to_icu(
        on_or_after="2020-02-01",
        find_first_match_in_period=True,
        returning="had_respiratory_support",
        return_expectations={
            "date": {
                "earliest": "2020-02-01"
            },
            "rate": "exponential_increase"
        },
    ),
    basic_resp_support_flag=patients.admitted_to_icu(
        on_or_after="2020-02-01",
        find_first_match_in_period=True,
        returning="had_basic_respiratory_support",
        return_expectations={
            "date": {
                "earliest": "2020-02-01"
            },
            "rate": "exponential_increase"
        },
Exemplo n.º 3
0
                "ratios": {
                    "10": 0.5,
                    "20": 0.5
                }
            },
            "incidence": 0.4,
        },
    ),

    # ICU ADMISSION
    icu_admission_date=patients.admitted_to_icu(
        on_or_after="sgss_pos_inrange",
        find_first_match_in_period=True,
        returning="date_admitted",
        date_format="YYYY-MM-DD",
        return_expectations={
            "date": {
                "earliest": "2020-11-16"
            },
            "incidence": 0.2
        },
    ),

    ### DEMOGRAPHIC COVARIATES
    # AGE
    age=patients.age_as_of(
        "sgss_pos_inrange",
        return_expectations={
            "rate": "universal",
            "int": {
                "distribution": "population_ages"
            },
Exemplo n.º 4
0
            saba_single OR
            ics_single OR
            low_med_dose_ics OR
            low_med_dose_ics_multiple_ingredient OR
            low_med_dose_ics_single_ingredient OR
            high_dose_ics_multiple_ingredient OR
            high_dose_ics_single_ing OR
            high_dose_ics

            """),
    ),
    ## OUTCOMES (at least one outcome or covariate is required)
    icu_date_admitted=patients.admitted_to_icu(
        on_or_after="2020-03-01",
        include_day=True,
        returning="date_admitted",
        return_expectations={"date": {
            "earliest": "2020-03-01"
        }},
    ),
    died_date_cpns=patients.with_death_recorded_in_cpns(
        on_or_after="2020-03-01",
        returning="date_of_death",
        include_month=True,
        include_day=True,
        return_expectations={"date": {
            "earliest": "2020-03-01"
        }},
    ),
    died_ons_covid_flag_any=patients.with_these_codes_on_death_certificate(
        covid_codelist,
        on_or_after="2020-03-01",
Exemplo n.º 5
0
     returning="date_arrived",
     date_format="YYYY-MM-DD",
     find_first_match_in_period=True,
     return_expectations={
         "date": {
             "earliest": "2020-02-01"
         },
         "rate": "exponential_increase",
     },
 ),
 icu_date_admitted=patients.admitted_to_icu(
     on_or_after="2020-02-01",
     include_day=True,
     returning="date_admitted",
     find_first_match_in_period=True,
     return_expectations={
         "date": {
             "earliest": "2020-02-01"
         },
         "rate": "exponential_increase",
     },
 ),
 died_date_cpns=patients.with_death_recorded_in_cpns(
     on_or_after="2020-02-01",
     returning="date_of_death",
     include_month=True,
     include_day=True,
     return_expectations={
         "date": {
             "earliest": "2020-02-01"
         },
         "rate": "exponential_increase",