Skip to content

Commit

Permalink
Merge pull request #25 from smart-on-fhir/mikix/resources
Browse files Browse the repository at this point in the history
Add new Supported Resources page and some other improvements
  • Loading branch information
mikix authored Apr 2, 2024
2 parents cf557ec + 670e4d7 commit e7ee513
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Pull external sources
run: ./prep.sh
- name: Build with Jekyll
Expand All @@ -39,7 +39,7 @@ jobs:
source: ./docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
Expand All @@ -51,4 +51,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
.jekyll-metadata
vendor

/docs/aggregator/
/docs/chart-review/
/docs/etl/
/docs/library/
65 changes: 65 additions & 0 deletions docs/resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Supported Resources
_parent: Overview
nav_order: 2
# audience: non-programmers vaguely familiar with Cumulus
# type: explanation
---

# Supported FHIR Resources

## What's a Resource?

The [FHIR specification](https://www.hl7.org/fhir/R4/) describes many kinds of _resources_,
which are individual logical bundles of data.
For example: [Patients](https://www.hl7.org/fhir/R4/patient.html),
[Encounters](https://www.hl7.org/fhir/R4/encounter.html),
or [Devices](https://www.hl7.org/fhir/R4/device.html).

Resources are the atomic units of data that flow through the Cumulus pipeline.

You can bulk export them from your EHR.<br/>
You can feed them through Cumulus ETL.<br/>
And you can query them with Cumulus Library.

## Levels of Support

Only a subset of the FHIR resources are supported by Cumulus.
And not every resource enjoys the same level of support.

For a resource to enter the Cumulus pipeline, Cumulus ETL must support it.
Any resource that the ETL supports can be directly queried in Athena.

But for more convenient querying,
the Cumulus Library's `core` study has additional support for some resources.
For example, the `core` study abstracts the complexities of querying medication
codes for you, because it has special knowledge of MedicationRequests and
Medications.

If a resource isn't supported by the `core` study, it can still be queried!
It just may not be as convenient,
as you'll have to handle directly querying FHIR nested layouts yourself.

Over time, more resources will be added to the `core` study.

## Support List

| Resource | ETL | `core` |
|--------------------|---------------|--------|
| AllergyIntolerance |||
| Condition |||
| Device |||
| DiagnosticReport |||
| DocumentReference |||
| Encounter |||
| Immunization |||
| Medication | ✅<sup>1</sup> ||
| MedicationRequest |||
| Observation |||
| Patient |||
| Procedure |||
| ServiceRequest |||

1. Medications are not usually bulk-exportable.
Instead, as the ETL processes MedicationRequest resources,
it downloads any linked Medication resources as well.
14 changes: 14 additions & 0 deletions prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ copy_docs()
set_nav_order $TARGET_PATH/index.md $ORDER
}

rewind_submodule_to_last_tag()
{
REPO=sources/$1
LATEST_TAG=$(git -C $REPO describe --abbrev=0 --tags)
git -C $REPO checkout "$LATEST_TAG"
}

while getopts ":d" option; do
case $option in
d) # dev (local) mode, assumes that we are siblings of other source packages
Expand All @@ -55,6 +62,13 @@ done

git submodule update --init --remote

# Some projects do proper releases, and for those we should only
# reference the latest tagged release. Other projects (like the
# ETL or aggregator) don't do normal releases and so can just
# pull from main.
rewind_submodule_to_last_tag cumulus-library
rewind_submodule_to_last_tag chart-review

# Only use nav_order 10-20 for submodules
copy_docs cumulus-etl etl 10
copy_docs cumulus-library library 11
Expand Down
2 changes: 1 addition & 1 deletion sources/chart-review
2 changes: 1 addition & 1 deletion sources/cumulus-aggregator
Submodule cumulus-aggregator updated 36 files
+9 −15 .github/workflows/ci.yaml
+8 −15 .pre-commit-config.yaml
+25 −21 pyproject.toml
+1 −1 scripts/cumulus_upload_data.py
+86 −0 scripts/migrations/migration.002.column_types.py
+1 −4 src/handlers/dashboard/filter_config.py
+8 −7 src/handlers/dashboard/get_chart_data.py
+122 −0 src/handlers/dashboard/get_csv.py
+3 −3 src/handlers/dashboard/get_data_packages.py
+4 −2 src/handlers/dashboard/get_metadata.py
+3 −3 src/handlers/dashboard/get_study_periods.py
+1 −1 src/handlers/shared/awswrangler_functions.py
+2 −2 src/handlers/shared/decorators.py
+14 −5 src/handlers/shared/enums.py
+107 −40 src/handlers/shared/functions.py
+8 −9 src/handlers/site_upload/api_gateway_authorizer.py
+3 −3 src/handlers/site_upload/cache_api.py
+3 −3 src/handlers/site_upload/fetch_upload_url.py
+103 −50 src/handlers/site_upload/powerset_merge.py
+41 −45 src/handlers/site_upload/process_upload.py
+29 −26 src/handlers/site_upload/study_period.py
+87 −10 template.yaml
+49 −33 tests/conftest.py
+3 −3 tests/dashboard/test_filter_config.py
+3 −9 tests/dashboard/test_get_chart_data.py
+150 −0 tests/dashboard/test_get_csv.py
+28 −29 tests/dashboard/test_get_metadata.py
+1 −12 tests/dashboard/test_get_study_periods.py
+1 −5 tests/dashboard/test_get_subscriptions.py
+21 −1 tests/mock_utils.py
+7 −10 tests/site_upload/test_api_gateway_authorizer.py
+1 −3 tests/site_upload/test_cache_api.py
+1 −6 tests/site_upload/test_fetch_upload_url.py
+54 −42 tests/site_upload/test_powerset_merge.py
+3 −6 tests/site_upload/test_process_upload.py
+3 −8 tests/site_upload/test_study_period.py
2 changes: 1 addition & 1 deletion sources/cumulus-library
Submodule cumulus-library updated 145 files

0 comments on commit e7ee513

Please sign in to comment.