Skip to content

Commit

Permalink
Merge pull request #41 from ecohealthalliance/dev
Browse files Browse the repository at this point in the history
edit database airtable chapter and add test render workflow; fix #34; fix #40
  • Loading branch information
ernestguevarra authored Dec 1, 2024
2 parents c2bea8f + 4c35243 commit 4104ca8
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 46 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/test-book-render.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test book render

on:
pull_request:
branches: [main, master]
workflow_dispatch:

jobs:
test-book-render:
runs-on: ubuntu-latest
container: rocker/tidyverse:4.4.2
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
GIT_CRYPT_KEY64: ${{ secrets.GIT_CRYPT_KEY64 }}
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
apt-get update && apt-get install -y --no-install-recommends \
libglpk-dev git-crypt gh curl jq rsync
- name: Install chrome
run: |
curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt-get install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
- name: Trust repo
run: |
git config --global --add safe.directory /__w/acdc-db-handbook/acdc-db-handbook
- name: Decrypt repository using symmetric key
run: |
echo $GIT_CRYPT_KEY64 > git_crypt_key.key64 && base64 -di git_crypt_key.key64 > git_crypt_key.key && git-crypt unlock git_crypt_key.key
rm git_crypt_key.key git_crypt_key.key64
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: true

- name: Install packages from renv.lock (with cache)
if: ${{ !env.ACT }}
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 2

- name: Install packages from renv.lock (local, no cache)
if: ${{ env.ACT }}
run: |
renv::restore()
shell: Rscript {0}

- name: Render document
run: |
readRenviron(".env")
quarto::quarto_render("index.qmd")
shell: Rscript {0}
2 changes: 1 addition & 1 deletion 04-airtable.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ As of May 2024, the Africa CDC Database backend has shifted from Airtable to Dol

This chapter has been kept here to document how the database started and to show the history of its development.

To read about DoltHub, see @sec-dolt. To learn more about the use of dolt and DoltHub as the current backend for the database, read @sec-database.
To read about DoltHub, see @sec-dolt. To learn more about the use of dolt and DoltHub as the current backend for the database, read @sec-database-dolthub.

:::

Expand Down
7 changes: 7 additions & 0 deletions 05-database-dolthub.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
output-file: database-dolthub.html
---

# Database - DoltHub {#sec-database-dolthub}


68 changes: 39 additions & 29 deletions 05-database.qmd → 06-database-airtable.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
output-file: database.html
output-file: database-airtable.html
---

```{r setup, include = FALSE}
Expand All @@ -13,18 +13,28 @@ airtable_metadata <- airtable(
)$`Meta Data`$select()
```

::: {.callout-note title="Airtable not anymore used to host the database"}

# Database {#sec-database}
As of May 2024, the Africa CDC Database backend has shifted from Airtable to DoltHub.

This chapter has been kept here to document how the database started and to show the history of its development.

To read about DoltHub, see @sec-dolt. To learn more about the use of dolt and DoltHub as the current backend for the database, read @sec-database-dolthub.

:::


# Database {#sec-database-airtable}

The current database is built using [Airtable](https://airtable.com). The current database has the following schema:

![](images/database_schema.png)

This schema can be viewed interactively from here - https://airtable.com/appAL7fJUpBPYtOq4/tblt9ott045tWENcg/viwznxjIFAsTu0jzJ?blocks=bliZ6LV2bkGQNzgKF

## Activities Table {#activities-table}
## Activities Table {#sec-activities-table}

### Table details
### Table details {#sec-activities-table-details}

```{r activity-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Activities") |>
Expand All @@ -38,7 +48,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Activities") |>

Following are the different fields within the Activities table with their description.

### Fields details
### Fields details {#sec-activities-fields-details}

```{r activity-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Activities") |>
Expand All @@ -48,9 +58,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "Activities") |>
kableExtra::kable_paper(lightable_options = "striped")
```

## Countries Table {#countries-table}
## Countries Table {#sec-countries-table}

### Table details
### Table details {#sec-countries-table-details}

```{r au-countries-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "AU Countries") |>
Expand All @@ -64,7 +74,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "AU Countries") |>

Following are the different fields within the Countries table with their description.

### Fields details
### Fields details {#sec-countries-fields-details}

```{r countries-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Countries") |>
Expand Down Expand Up @@ -99,9 +109,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "AU Regions") |>
--->

## Description Table {#description-table}
## Description Table {#sec-description-table}

### Table details
### Table details {#sec-description-table-details}

```{r description-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Description") |>
Expand All @@ -115,7 +125,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Description") |>

Following are the different fields within the Description table with their description.

### Field details
### Fields details {#sec-description-fields-details}

```{r description-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Description") |>
Expand All @@ -125,9 +135,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "Description") |>
kableExtra::kable_paper(lightable_options = "striped")
```

## Funder Table {#funders-table}
## Funder Table {#sec-funders-table}

### Table details
### Table details {#sec-funders-table-details}

```{r funders-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Funders") |>
Expand All @@ -141,7 +151,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Funders") |>

Following are the different fields within the Funders table with their description.

### Field details
### Fields details {#sec-funders-fields-details}

```{r funders-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Funders") |>
Expand All @@ -151,9 +161,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "Funders") |>
kableExtra::kable_paper(lightable_options = "striped")
```

## Institutions Table {#institutions-table}
## Institutions Table {#sec-institutions-table}

### Table details
### Table details {#sec-institutions-table-details}

```{r institutions-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Institutions") |>
Expand All @@ -167,7 +177,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Institutions") |>

Following are the different fields within the Institutions table with their description.

### Field details
### Fields details {#sec-institutions-fields-details}

```{r institutions-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Institutions") |>
Expand All @@ -177,9 +187,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "Institutions") |>
kableExtra::kable_paper(lightable_options = "striped")
```

## Researchers Table {#researchers-table}
## Researchers Table {#sec-researchers-table}

### Table details
### Table details {#sec-researchers-table-details}

```{r researchers-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Researchers") |>
Expand All @@ -193,7 +203,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Researchers") |>

Following are the different fields within the Researchers table with their description.

### Field details
### Fields details {#sec-researchers-fields-details}

```{r researchers-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Researchers") |>
Expand All @@ -203,9 +213,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "Researchers") |>
kableExtra::kable_paper(lightable_options = "striped")
```

## Sources Table {#sources-table}
## Sources Table {#sec-sources-table}

### Table details
### Table details {#sec-sources-table-details}

```{r sources-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Sources") |>
Expand All @@ -219,7 +229,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Sources") |>

Following are the different fields within the Sources table with their description.

### Field details
### Fields details {#sec-sources-fields-details}

```{r sources-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Sources") |>
Expand All @@ -229,9 +239,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "Sources") |>
kableExtra::kable_paper(lightable_options = "striped")
```

## Survey Results Table {#survey-results-table}
## Survey Results Table {#sec-survey-results-table}

### Table details
### Table details {#sec-survey-results-table-details}

```{r survey-results-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Survey Results") |>
Expand All @@ -245,7 +255,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Survey Results") |

Following are the different fields within the Survey Results table with their description.

### Field details
### Field details {#sec-survey-results-fields-table}

```{r survey-results-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Survey Results") |>
Expand All @@ -255,9 +265,9 @@ create_data_dictionary(metadata = airtable_metadata, table = "Survey Results") |
kableExtra::kable_paper(lightable_options = "striped")
```

## Topics Table {#topics-table}
## Topics Table {#sec-topics-table}

### Table details
### Table details {#sec-topics-table-details}

```{r topics-table, eval = FALSE}
create_data_dictionary(metadata = airtable_metadata, table = "Topics") |>
Expand All @@ -271,7 +281,7 @@ create_data_dictionary(metadata = airtable_metadata, table = "Topics") |>

Following are the different fields within the Topics table with their description.

### Field details
### Fields details {#sec-topics-fields-details}

```{r topics-field-table}
create_data_dictionary(metadata = airtable_metadata, table = "Topics") |>
Expand Down
2 changes: 1 addition & 1 deletion 06-sources.qmd → 07-sources.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The Trust's mission is to improve health by supporting scientists, researchers,

The Wellcome Trust is known for its long-term, strategic approach to funding research, and for its commitment to open science and data sharing. It also operates the Wellcome Collection, a public venue in London that hosts exhibitions and events related to health, medicine, and science.

## National Insitutes of Health {#nih}
## National Institutes of Health {#nih}

The National Institutes of Health (NIH) is a biomedical research agency of the United States federal government. It is the largest biomedical research institution in the world, with its main campus located in Bethesda, Maryland. The NIH is composed of 27 separate institutes and centers, each with a specific research focus, and is responsible for conducting and funding research in a wide range of areas, including cancer, genetics, infectious diseases, and neuroscience.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ book:
- 04-airtable.qmd
- part: Database
chapters:
- 05-database.qmd
- 05-database-dolthub.qmd
- 06-database-airtable.qmd
- part: Sources
chapters:
- 06-sources.qmd
- 07-sources.qmd
- part: Maintenance
chapters:
- 07-updates.qmd
- 08-survey.qmd
- 09-references.qmd
- 08-updates.qmd
- 09-survey.qmd
- 10-references.qmd
cover-image: images/acdc_eha.png
search: true
repo-url: https://github.com/ecohealthalliance/acdc-db-handbook/
repo-actions: [edit]
downloads: [pdf, epub]
sharing: [twitter, facebook]

bibliography: book.bib

Expand Down
19 changes: 10 additions & 9 deletions book.bib
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@Book{xie2015,
title = {Dynamic Documents with {R} and knitr},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2015},
edition = {2nd},
note = {ISBN 978-1498716963},
url = {http://yihui.org/knitr/},

@article{seminog_protocol_2024,
title = {A protocol for a living mapping review of global research funding for infectious diseases with a pandemic potential ? Pandemic {PACT} [version 2; peer review: 2 approved, 2 approved with reservations]},
volume = {9},
doi = {10.12688/wellcomeopenres.21202.2},
number = {156},
journaltitle = {Wellcome Open Research},
author = {Seminog, O and Furst, R and Mendy, T and Rohanian, O and Levanita, S and Kadri-Alabi, Z and Jabin, N and Humphreys, G and Antonio, E and Bucher, A and Norton, A},
date = {2024},
file = {8331ff21-7a4d-4d8a-a371-5e5603addfe2_21202_-_alice_norton_v2:/home/ernestguevarra/Zotero/storage/8C6FAN5L/8331ff21-7a4d-4d8a-a371-5e5603addfe2_21202_-_alice_norton_v2.pdf:application/pdf},
}

0 comments on commit 4104ca8

Please sign in to comment.