generated from opensafely/research-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1660a9b
Showing
14 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ensure unix line endings on windows for files that need them. | ||
*.sh eol=lf | ||
codelists/* eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Test that the project is runnable | ||
|
||
on: [push, workflow_dispatch] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCKER_RO_TOKEN: ${{ secrets.DOCKER_RO_TOKEN }} | ||
STATA_LICENSE: ${{ secrets.STATA_LICENSE }} | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Test the project can run, using dummy data | ||
steps: | ||
- name: Test that the project is runnable | ||
uses: opensafely-core/research-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*~ | ||
model.log | ||
*/input.csv | ||
__pycache__ | ||
.python-version | ||
output/* | ||
metadata/* | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/ | ||
tasks: | ||
- name: Install opensafely cli tool | ||
# runs when workspace initially created, and as pre-build | ||
init: | | ||
pip install opensafely | ||
opensafely pull --project project.yaml | ||
- name: Update opensafely | ||
# run every time you open a workspace | ||
command: | ||
opensafely upgrade | ||
|
||
github: | ||
prebuilds: | ||
# enable for the default branch (defaults to true) | ||
master: true | ||
# enable for all branches in this repo (defaults to false) | ||
branches: true | ||
# enable for pull requests coming from this repo (defaults to true) | ||
pullRequests: true | ||
# enable for pull requests coming from forks (defaults to false) | ||
pullRequestsFromForks: true | ||
# add a check to pull requests (defaults to true) | ||
addCheck: true | ||
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false) | ||
addComment: true | ||
# add a "Review in Gitpod" button to the pull request's description (defaults to false) | ||
addBadge: false | ||
|
||
vscode: | ||
extensions: | ||
- ms-python.python | ||
- vscode.html-language-features | ||
- redhat.vscode-yaml | ||
- ikuyadeu.r | ||
- randomfractalsinc.vscode-data-preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"python.linting.pylintEnabled": false, | ||
"python.linting.flake8Enabled": true, | ||
"python.linting.enabled": true, | ||
"data.preview.create.json.schema": false, | ||
"data.preview.theme": "light", | ||
// this doesn't work, don't know why yet | ||
"files.associations": { | ||
"*.feather": "arrow", | ||
}, | ||
"window.autoDetectColorScheme": true, | ||
"extensions.ignoreRecommendations": true, | ||
"workbench.startupEditor": "readme", | ||
"files.autoSave": "afterDelay", | ||
"files.autoSaveDelay": 1000, | ||
"window.menuBarVisibility": "visible" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "OpenSAFELY run project", | ||
"type": "shell", | ||
"command": "opensafely run run_all -f", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"echo": true, | ||
"reveal": "always", | ||
"focus": true, | ||
"panel": "new", | ||
"showReuseMessage": false, | ||
"clear": true, | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) {{current_year}} {{organisation}} | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# {{project_name}} | ||
|
||
This is the code and configuration for {{project_name}} | ||
|
||
* The paper is [here]() | ||
* Raw model outputs, including charts, crosstabs, etc, are in `released_outputs/` | ||
* If you are interested in how we defined our variables, take a look at the [study definition](analysis/study_definition.py); this is written in `python`, but non-programmers should be able to understand what is going on there | ||
* If you are interested in how we defined our code lists, look in the [codelists folder](./codelists/). | ||
* Developers and epidemiologists interested in the framework should review [the OpenSAFELY documentation](https://docs.opensafely.org) | ||
|
||
# About the OpenSAFELY framework | ||
|
||
The OpenSAFELY framework is a secure analytics platform for | ||
electronic health records research in the NHS. | ||
|
||
Instead of requesting access for slices of patient data and | ||
transporting them elsewhere for analysis, the framework supports | ||
developing analytics against dummy data, and then running against the | ||
real data *within the same infrastructure that the data is stored*. | ||
Read more at [OpenSAFELY.org](https://opensafely.org). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from cohortextractor import StudyDefinition, patients, codelist, codelist_from_csv # NOQA | ||
|
||
|
||
study = StudyDefinition( | ||
default_expectations={ | ||
"date": {"earliest": "1900-01-01", "latest": "today"}, | ||
"rate": "uniform", | ||
"incidence": 0.5, | ||
}, | ||
population=patients.registered_with_one_practice_between( | ||
"2019-02-01", "2020-02-01" | ||
), | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '3.0' | ||
|
||
expectations: | ||
population_size: 1000 | ||
|
||
actions: | ||
|
||
generate_study_population: | ||
run: cohortextractor:latest generate_cohort --study-definition study_definition | ||
outputs: | ||
highly_sensitive: | ||
cohort: output/input.csv |