Skip to content

Commit

Permalink
Merge branch 'main' into update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljohanneskraft authored Sep 11, 2024
2 parents 635a117 + 4ad861b commit 540fe08
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 100 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/beta-deployment.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/build-and-test.yml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#
# This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Build and Test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
workflow_dispatch:
workflow_call:

jobs:
reuseaction:
name: REUSE Compliance Check
uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2
markdownlinkcheck:
name: Markdown Link Check
uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: 'true'
- name: Git LFS Pull
run: git lfs pull
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.6.x
- name: Install Dependencies
run: npm run install
- name: Build
run: npm run build
- name: Lint
run: npm run lint:strict
permissions:
contents: read
buildandtest:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: 'true'
- name: Git LFS Pull
run: git lfs pull
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.6.x
- name: Install Dependencies
run: npm run install
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Build
run: npm run build
- name: Test
id: test
run: npm run test:ci
- name: Archive Regenerated Test Results
uses: actions/upload-artifact@v4
with:
name: test results
path: functions/src/tests/resources
permissions:
contents: read
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: CodeQL

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 8 * * 1'

jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
86 changes: 86 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#
# This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Deployment

on:
push:
branches:
- main
workflow_dispatch:
inputs:
environment:
description: |
The GitHub deployment environment.
required: true
default: 'development'
type: choice
options:
- development
- staging
- production
workflow_call:
inputs:
environment:
description: |
The GitHub deployment environment.
required: false
type: string
default: development

concurrency:
group: deployment
cancel-in-progress: false

jobs:
determineenvironment:
name: Determine Environment
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.set-env.outputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Determine Environment
id: set-env
run: |
if [[ -z "${{ inputs.environment }}" ]]; then
echo "environment=staging" >> $GITHUB_OUTPUT
else
echo "environment=${{ inputs.environment }}" >> $GITHUB_OUTPUT
fi
vars:
name: Inject Environment Variables In Deployment Workflow
needs: determineenvironment
runs-on: ubuntu-latest
environment: ${{ needs.determineenvironment.outputs.environment }}
outputs:
FIREBASE_PROJECT_ID: ${{ vars.FIREBASE_PROJECT_ID }}
steps:
- run: |
echo "Injecting Environment Variables In Deployment Workflow: ${{ vars.FIREBASE_PROJECT_ID }}"
buildandtest:
name: Build and Test
needs: determineenvironment
uses: ./.github/workflows/build-and-test.yml
permissions:
contents: read
checks: write
secrets: inherit
deployfirebase:
name: Deploy Firebase Project
needs: [buildandtest, determineenvironment, vars]
uses: StanfordBDHG/.github/.github/workflows/firebase-deploy.yml@v2
permissions:
contents: read
with:
customcommand: "npm run install"
environment: ${{ needs.determineenvironment.outputs.environment }}
arguments: '--project ${{ needs.vars.outputs.FIREBASE_PROJECT_ID }}'
secrets:
GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_BASE64 }}
50 changes: 0 additions & 50 deletions .github/workflows/lintbuildandtest.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/monthly-markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Monthly Markdown Link Check

on:
schedule:
- cron: '0 8 1 * *'

jobs:
markdown_link_check:
name: Markdown Link Check
uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
#
# This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project
# This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Release Models Package
name: Production Deployment

on:
release:
types: [published]
workflow_dispatch:

concurrency:
group: production
cancel-in-progress: false

jobs:
build:
deployment:
name: Production Deployment
uses: ./.github/workflows/deployment.yml
permissions:
contents: read
actions: read
security-events: write
secrets: inherit
with:
environment: production
publishpackage:
name: Publish Package
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -25,7 +40,6 @@ jobs:
working-directory: ./functions/models
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '22.x'
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/reuse.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Based on [FHIR AllergyIntolerance](https://hl7.org/fhir/R4B/allergyintolerance.h
|-|-|-|-|
|id|string|-|[Resource](https://hl7.org/fhir/R4B/resource.html): Logical id of this artifact|
|type|optional [allergyIntoleranceType](https://hl7.org/fhir/R4B/valueset-allergy-intolerance-type.html)|e.g. "allergy", "intolerance"|In addition to the FHIR defined value set, we also use "financial" - these values shall not be exposed to EHR systems.|
|code|CodableContent|e.g. "{"coding":[{"system":"https://hl7.org/fhir/R4B/valueset-allergyintolerance-code.html","code":"293963004","display":"Cardioselective beta-blocker allergy"}],"text":"Cardioselective beta-blocker allergy"}"|Uses either [AllergyIntoleranceCode](https://hl7.org/fhir/R4B/valueset-allergyintolerance-code.html), `medicationId` as used in /medications/$medicationId$ and/or `medicationId` as used in /medicationClasses/$medicationClassId$.|
|code|CodableContent|e.g. `{"coding":[{"system":"https://hl7.org/fhir/R4B/valueset-allergyintolerance-code.html","code":"293963004","display":"Cardioselective beta-blocker allergy"}],"text":"Cardioselective beta-blocker allergy"}`|Uses either [AllergyIntoleranceCode](https://hl7.org/fhir/R4B/valueset-allergyintolerance-code.html), `medicationId` as used in /medications/$medicationId$ and/or `medicationId` as used in /medicationClasses/$medicationClassId$.|
|patient|string|-|`userId` as used in /users/$userId$ and related collections.|

We use RxNorm codes to identify contraindications using the following rules:
Expand Down

0 comments on commit 540fe08

Please sign in to comment.