Skip to content

Job request: 14221

Organisation:
Bennett Institute
Workspace:
medication_reviews
ID:
clqbzbbpazrpwwaq

This page shows the technical details of what happened when the authorised researcher Louis Fisher requested one or more actions to be run against real patient data in the project, within a secure environment.

By cross-referencing the list of jobs with the pipeline section below, you can infer what security level various outputs were written to. Researchers can never directly view outputs marked as highly_sensitive ; they can only request that code runs against them. Outputs marked as moderately_sensitive can be viewed by an approved researcher by logging into a highly secure environment. Only outputs marked as moderately_sensitive can be requested for release to the public, via a controlled output review service.

Jobs

Pipeline

Show project.yaml
version: '3.0'

expectations:
  population_size: 3000

actions:

  generate_study_population:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition
        --index-date-range "2019-04-01 to 2019-12-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort: output/input_2019*.csv.gz

  generate_study_population_range2:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition
        --index-date-range "2020-01-01 to 2020-12-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort: output/input_2020*.csv.gz

  generate_study_population_range3:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition
        --index-date-range "2021-01-01 to 2021-12-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort: output/input_2021*.csv.gz

  generate_study_population_range4:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition
        --index-date-range "2022-01-01 to 2022-03-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort: output/input_2022*.csv.gz

  generate_study_population_allmedrev:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition_allmedrev
        --index-date-range "2019-04-01 to 2019-12-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort: output/input_allmedrev_2019*.csv.gz

  generate_study_population_allmedrev_range2:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition_allmedrev
        --index-date-range "2020-01-01 to 2020-12-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort2: output/input_allmedrev_2020*.csv.gz

  generate_study_population_allmedrev_range3:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition_allmedrev
        --index-date-range "2021-01-01 to 2021-12-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort3: output/input_allmedrev_2021*.csv.gz

  generate_study_population_allmedrev_range4:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition_allmedrev
        --index-date-range "2022-01-01 to 2022-03-01 by month"
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort3: output/input_allmedrev_2022*.csv.gz

  generate_ethnicity_cohort:
    run: >
      cohortextractor:latest generate_cohort
        --study-definition study_definition_ethnicity
        --output-format='csv.gz'
    outputs:
      highly_sensitive:
        cohort: output/input_ethnicity.csv.gz

  join_cohorts:
    run: >
      cohort-joiner:v0.0.44
        --lhs output/input_20*.csv.gz
        --rhs output/input_ethnicity.csv.gz
        --output-dir output/joined
    needs: [generate_study_population, generate_study_population_range2, generate_study_population_range3, generate_study_population_range4, generate_ethnicity_cohort]
    outputs:
      highly_sensitive:
        cohort: output/joined/input_20*.csv.gz

  join_cohorts_allmedrev:
    run: >
      cohort-joiner:v0.0.44
        --lhs output/input_allmedrev*.csv.gz
        --rhs output/input_ethnicity.csv.gz
        --output-dir output/joined
    needs: [generate_study_population_allmedrev, generate_study_population_allmedrev_range2, generate_study_population_allmedrev_range3, generate_study_population_allmedrev_range4, generate_ethnicity_cohort]
    outputs:
      highly_sensitive:
        cohort: output/joined/input_allmedrev_*.csv.gz

## generate Structured Medication Review Measures and plots

  generate_measures_mr_smr:
     run: >
       cohortextractor:latest generate_measures 
       --study-definition study_definition
       --output-dir=output/joined
     needs: [join_cohorts]
     outputs:
       moderately_sensitive:
         mr_measure_csv: output/joined/measure_mr_*_rate.csv
         mr12m_measure_csv: output/joined/measure_mr12m_*_rate.csv
         smr_measure_csv: output/joined/measure_smr_*_rate.csv
         smr12m_measure_csv: output/joined/measure_smr12m_*_rate.csv

  generate_measures_all_reviews:
     run: >
       cohortextractor:latest generate_measures 
       --study-definition study_definition_allmedrev
       --output-dir=output/joined
     needs: [join_cohorts_allmedrev]
     outputs:
       moderately_sensitive:
         allmedrev_measure_csv: output/joined/measure_allmedrv_*_rate.csv
         allmedrev12m_measure_csv: output/joined/measure_allmedrv12m_*_rate.csv
         allmedrev_measure_asgrouped_csv: output/joined/measure_allmedrv_*_rate_agestandardgrouped.csv
         allmedrev12m_measure_asgrouped_csv: output/joined/measure_allmedrv12m_*_rate_agestandardgrouped.csv

  generate_deciles_charts:
    run: >
      deciles-charts:v0.0.33
        --input-files output/joined/measure_*_practice_rate.csv
        --output-dir output/joined
    config:
      show_outer_percentiles: false
      tables:
        output: true
      charts:
        output: true
    needs: [generate_measures_mr_smr, generate_measures_all_reviews]
    outputs:
      moderately_sensitive:
        deciles_charts: output/joined/deciles_*_*.*

  redact_and_round:
    run: python:latest python analysis/redact_and_round.py
    needs: [generate_measures_mr_smr, generate_codeuse_output, generate_allmedrev_codeuse_output, generate_measures_all_reviews]
    outputs:
      moderately_sensitive:
        cohort: output/redacted/redacted_measure_*.csv
        cohort_codeuse: output/redacted/redacted_totalcodeuse*.csv

  generate_plots:
    run: python:latest python analysis/plots.py
    needs: [redact_and_round, generate_deciles_charts]
    outputs:
      moderately_sensitive:
        percent_cohort: output/figures/*_*_rate_percentage.jpeg
        perthousand_cohort: output/figures/*_*_rate_perthousand.jpeg 

  generate_table_1:
    run: python:latest python analysis/table_1.py --study_def_paths="output/joined/input_allmedrev_*.csv.gz" --demographics="age_band,sex,region,imdQ5,ethnicity,learning_disability,care_home_type,addictivemeds_last12m,dmards_last12m,teratogenicmeds_last12m,highriskmeds_last12m" --outcome "had_anymedrev"
    needs: [join_cohorts_allmedrev]
    outputs:
      moderately_sensitive:
        counts: output/table_1.csv
        had_outcome: output/table_1_had_outcome.csv

  generate_codeuse_output:
    run: python:latest python analysis/code_use_summary.py --study_def_paths="output/joined/input_20*.csv.gz" --codelistfile="user-chriswood-medication-review.csv" --outputfile="codeuse"
    needs: [join_cohorts]
    outputs:
      moderately_sensitive:
        code_counts: output/codeuse.csv
        total_code_counts: output/totalcodeuse.csv

  generate_allmedrev_codeuse_output:
    run: python:latest python analysis/code_use_summary.py --study_def_paths="output/joined/input_allmedrev_*.csv.gz" --codelistfile="user-chriswood-all-medication-reviews.csv" --outputfile="codeuse_allmedrev"
    needs: [join_cohorts_allmedrev]
    outputs:
      moderately_sensitive:
        code_counts: output/codeuse_allmedrev.csv
        total_code_counts: output/totalcodeuse_allmedrev.csv

  run_tests:
    run: python:latest python -m pytest --junit-xml=output/pytest.xml --verbose
    outputs:
      moderately_sensitive:
        log: output/pytest.xml



  generate_study_population_report_ethnicity:
    run: cohortextractor:latest generate_cohort 
      --study-definition study_definition_ethnicity_report --output-dir output/report --output-format=csv.gz
    outputs:
      highly_sensitive:
        cohort: output/report/input_ethnicity_report.csv.gz


  generate_study_population_report:
    run: cohortextractor:latest generate_cohort 
      --study-definition study_definition_report 
      --param codelist_1_frequency="monthly"
      --param codelist_2_comparison_date="event_1_date"
      --param codelist_2_period_start="- 365"
      --param codelist_2_period_end="+ 0"
      --param operator="AND"
      --param population="registered_adults"
      --param breakdowns="sex,age_band,imd,region"
      --index-date-range "2019-01-01 to 2022-11-01 by month" 
      --output-dir=output/report
      --output-format=csv.gz
    outputs:
      highly_sensitive:
        cohort: output/report/input_*.csv.gz

  join_cohorts_report:
    run: >
      cohort-joiner:v0.0.38
        --lhs output/report/input_report_20*.csv.gz
        --rhs output/report/input_ethnicity_report.csv.gz
        --output-dir output/report/joined
    needs: [generate_study_population_report, generate_study_population_report_ethnicity]
    outputs:
      highly_sensitive:
        cohort: output/report/joined/input_report_20*.csv.gz
  
  generate_measures_report:
    run: >
      python:latest python analysis/measures_report.py --breakdowns="sex,age_band,imd,region,ethnicity" --input_dir="output/report/joined" --measure="med_review"

    needs: [join_cohorts_report]
    outputs:
      moderately_sensitive:
        measure: output/report/joined/measure*rate.csv

  deciles_chart_report:
    run: >
      deciles-charts:v0.0.33
        --input-files output/report/joined/measure_practice_rate.csv
        --output-dir output/report/joined
    config:
      show_outer_percentiles: true
      tables:
        output: true
      charts:
        output: true
    needs: [generate_measures_report]
    outputs:
      moderately_sensitive:
        deciles_charts: output/report/joined/deciles_*.*

Timeline

  • Created:

  • Started:

  • Finished:

  • Runtime: 15:23:48

These timestamps are generated and stored using the UTC timezone on the TPP backend.

Job information

Status
Succeeded
Backend
TPP
Workspace
medication_reviews
Requested by
Louis Fisher
Branch
main
Force run dependencies
No
Git commit hash
75e7fbe
Requested actions
  • generate_study_population_report_ethnicity
  • generate_study_population_report
  • join_cohorts_report
  • generate_measures_report
  • deciles_chart_report

Code comparison

Compare the code used in this Job Request