Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add download examples #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
# OMOP Metadata
# OMOP Processed Vocabularies

Repository for metadata for working with the [OMOP CDM](https://ohdsi.github.io/CommonDataModel/) at UCLH.
Repository for pre-processed vocabularies for working with the [OMOP CDM](https://ohdsi.github.io/CommonDataModel/) at UCLH.

You can download these files directly or follow the local development instructions to use git to clone the files

## Downloading versions

You can download a specific tagged version using https.
in this format, replacing the curly braced values:

`https://github.com/SAFEHR-data/omop-vocabs-processed/raw/refs/tags/{tag}/{relative_path}`

For example for `v4` data file for the `data/version.txt`:

```r
tag = "v4"
relative_path = "data/version.txt"
download_url = glue::glue("https://github.com/SAFEHR-data/omop-vocabs-processed/raw/refs/tags/{tag}/{relative_path}")
download.file(download_url,
destfile = "version.txt",
mode = "w")
```

```python
import urllib.request

tag = "v4"
relative_path = "data/version.txt"
download_url = f"https://github.com/SAFEHR-data/omop-vocabs-processed/raw/refs/tags/{tag}/{relative_path}"
local_filename = "version.txt"

urllib.request.urlretrieve(download_url, local_filename)
```

```shell
export OMOP_METADATA_VERSION=v4
export OMOP_METADATA_PATH=data/version.txt
curl -L -o version.txt "https://github.com/SAFEHR-data/omop-vocabs-processed/raw/refs/tags/${OMOP_METADATA_VERSION}/${OMOP_METADATA_PATH}"
```

## Local development

If you haven't already set up `git lfs` with your git user account:
Expand All @@ -17,13 +52,13 @@ If you haven't already set up `git lfs` with your git user account:
Clone this repository:

```shell
git clone https://github.com/SAFEHR-data/omop-metadata.git
git clone https://github.com/SAFEHR-data/omop-vocabs-processed.git
```

## Release procedure

1. Update the vocabulary
2. Update the [data/metadata_version.txt](data/metadata_version.txt) file with this version
2. Update the [data/version.txt](data/version.txt) file with this version
3. Tag the release, replacing `${version}` with your version, e.g. `v4`
```shell
git tag ${version}
Expand All @@ -32,3 +67,4 @@ git clone https://github.com/SAFEHR-data/omop-metadata.git
```shell
git push --tags origin
```

File renamed without changes.