Skip to content

Job request: 8278

Organisation:
Bennett Institute
Workspace:
antidepressant-prescribing-lda
ID:
2eqzfjlgrc5zvc5g

This page shows the technical details of what happened when the authorised researcher Christine Cunningham 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: 10000

actions:

  ####################
  # Cohort Generation
  ####################

  # Since this runs on everyone, we can reuse for both studies 
  generate_study_population_ethnicity:
    run: cohortextractor:latest generate_cohort --study-definition study_definition_ethnicity --output-format=csv.gz
    outputs:
      highly_sensitive:
        cohort: output/input_ethnicity.csv.gz

  # Generate depression register, dep003, depression and prescription variables by month
  generate_study_population:
    run: cohortextractor:latest generate_cohort --study-definition study_definition --index-date-range "2019-01-01 to 2022-01-01 by month" --output-format=csv.gz
    outputs:
      highly_sensitive:
        cohort: output/input_*.csv.gz

  ####################
  # Join ethnicity to all generated input files
  # Efficiency fix https://github.com/opensafely/research-template
  # BUT BEWARE STALE DATA
  ###################

  join_cohorts:
    run: >
      cohort-joiner:v0.0.18
        --lhs output/input_*.csv.gz
        --rhs output/input_ethnicity.csv.gz
        --output-dir output/joined
    needs: [generate_study_population_ethnicity, generate_study_population]
    outputs:
      highly_sensitive:
        cohort: output/joined/input_*.csv.gz

  ####################
  # Measures 
  ####################

  # Output the summary values by date
  generate_measures:
      run: cohortextractor:latest generate_measures --study-definition study_definition --output-dir=output/joined
      needs: [join_cohorts]
      outputs:
        moderately_sensitive:
          # Only output the single summary file
          measure_csv: output/joined/measure_*_rate.csv

  #############################
  # Plotting
  #############################
  generate_deciles_charts:
    run: >
            deciles-charts:v0.0.15
            --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]
    outputs:
      moderately_sensitive:
        cohort: output/joined/deciles_*_*.*

  generate_groups:
    run: >
            python:latest python analysis/group_charts.py
            --input-files output/joined/measure_*.csv
            --output-dir output/joined
            --date-lines "2019-03-31" "2020-03-31" "2021-03-31"
            --scale "rate"
    needs: [generate_measures]
    outputs:
      moderately_sensitive:
        cohort: output/joined/group_chart_*.png

  # TODO: overwriting plots for small subset the require percentage
  generate_percentage_groups:
    run: >
            python:latest python analysis/group_charts.py
            --input-files output/joined/measure_dep003*.csv
            --output-dir output/joined
            --date-lines "2019-03-31" "2020-03-31" "2021-03-31"
            --scale "percentage"
    needs: [generate_measures]
    outputs:
      moderately_sensitive:
        cohort: output/joined/group_chart_dep003*.png


  generate_table1:
    run: >
            python:latest python analysis/table1.py
            --input-dir output/joined
            --output-dir output/joined
            --measure-attribute "antidepressant_any"
    needs: [generate_measures]
    outputs:
      moderately_sensitive:
        cohort: output/joined/table1.csv

  #############################
  # Display
  #############################
  generate_report:
    run: >
            python:latest python analysis/report.py
            --input-dir output/joined
            --output-dir output/joined
            --resource-dir analysis/resources
    needs: [generate_deciles_charts, generate_groups, generate_percentage_groups]
    outputs:
      moderately_sensitive:
        cohort: output/joined/report.html

Timeline

  • Created:

  • Started:

  • Finished:

  • Runtime: 02:17:15

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

Job information

Status
Failed
Backend
TPP
Requested by
Christine Cunningham
Branch
main
Force run dependencies
Yes
Git commit hash
e82a628
Requested actions
  • run_all

Code comparison

Compare the code used in this Job Request