Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/CDCgov/phdi into robert/add…
Browse files Browse the repository at this point in the history
…-baseclass-to-containers
  • Loading branch information
robertmitchellv committed May 8, 2023
2 parents 0279d83 + cb21800 commit 353f09c
Show file tree
Hide file tree
Showing 75 changed files with 841 additions and 75 deletions.
1 change: 1 addition & 0 deletions .github/workflows/buildReleaseContainers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
ref: ${{ inputs.container-tag }}
images: ghcr.io/${{ github.repository }}/${{matrix.container-to-build}}
# this sets the version for tags and labels for each of the containers to be
# be the same as the version/tag where the code was pulled from
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/createNewRelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,27 @@ jobs:
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Tag Release
uses: EndBug/latest-tag@latest
with:
ref: ${{ steps.get_version.outputs.version }}
# Generate release notes
- name: Generate release notes
id: release_notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag ${{ steps.get_version.outputs.version }}
git push origin ${{ steps.get_version.outputs.version }}
latest_release_date=$(gh release list --limit 1 --json createdAt -q ".[0].createdAt")
prs=$(gh pr list --base main --state closed --json title,number,url,closedAt -q ".[] | select(.closedAt > \"$latest_release_date\")")
release_notes="# Release Notes\n\n"
for pr in "$prs"; do
pr_title=$(echo "$pr" | jq -r ".title")
pr_number=$(echo "$pr" | jq -r ".number")
pr_url=$(echo "$pr" | jq -r ".url")
release_notes+="- $pr_title ([PR#$pr_number]($pr_url))\n"
done
echo "RELEASE_NOTES=$release_notes" >> $GITHUB_OUTPUT
# Create new release based upon the latest created tag
- name: Create Release
id: create_release
Expand All @@ -66,7 +84,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.version }}
release_name: Release ${{ steps.get_version.outputs.version }}
release_name: ${{ steps.get_version.outputs.version }}
body: ${{ steps.release_notes.outputs.RELEASE_NOTES }}

release-to-pypi:
name: Build and publish PHDI to PyPI
Expand Down Expand Up @@ -164,6 +183,15 @@ jobs:
ref: ${{ needs.tag-release.outputs.version }}

- name: Update Container Documenation
env:
MPI_DBNAME: testdb
MPI_PASSWORD: pw
MPI_DB_TYPE: postgres
MPI_HOST: localhost
MPI_USER: postgres
MPI_PORT: 5432
MPI_PATIENT_TABLE: patient
MPI_PERSON_TABLE: person
run: |
npm i -g redoc-cli
CONTAINER=${{ matrix.container }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "general"
/ "patient_bundle.json"
)

Expand Down
1 change: 1 addition & 0 deletions containers/tabulation/tests/test_tabulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
pathlib.Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "tabulation"
/ "valid_schema.json"
)

Expand Down
1 change: 1 addition & 0 deletions containers/tabulation/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def test_check_schema_validity_valid_schema():
pathlib.Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "tabulation"
/ "valid_schema.json"
)
valid_schema = json.load(open(valid_schema_path))
Expand Down
14 changes: 7 additions & 7 deletions containers/validation/config/ecr_config_LAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ fields:
textRequired: 'True'
- fieldName: City
cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:city"
errorType: "fatal"
errorType: "errors"
textRequired: 'True'
relatives:
- name: addr
cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:addr"
attributes:
- attributeName: use
regEx: "H"
# relatives:
# - name: addr
# cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:addr"
# attributes:
# - attributeName: use
# regEx: "H"
- fieldName: State
cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:state"
errorType: "errors"
Expand Down
14 changes: 7 additions & 7 deletions containers/validation/config/sample_ecr_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ fields:
# - attributeName: value
- fieldName: First Name
cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name/hl7:given"
errorType: "fatal"
errorType: "errors"
textRequired: 'True'
validateOne: False
relatives:
- name: name
cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name"
attributes:
- attributeName: use
regEx: "L"
# relatives:
# - name: name
# cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name"
# attributes:
# - attributeName: use
# regEx: "L"
- fieldName: Middle Name
cdaPath: "//hl7:ClinicalDocument/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name/hl7:given"
errorType: "errors"
Expand Down
2 changes: 2 additions & 0 deletions containers/validation/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_validate_config_bad():
pathlib.Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "validation"
/ "sample_ecr_config_bad.yaml",
"r",
) as file:
Expand All @@ -56,6 +57,7 @@ def test_validate_config_good():
pathlib.Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "validation"
/ "sample_ecr_config.yaml",
"r",
) as file:
Expand Down
6 changes: 3 additions & 3 deletions containers/validation/tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
pathlib.Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "validation"
/ "ecr_sample_input_good.xml"
).read()

Expand All @@ -25,6 +26,7 @@
pathlib.Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "validation"
/ "ecr_sample_input_bad.xml"
).read()

Expand All @@ -33,6 +35,7 @@
pathlib.Path(__file__).parent.parent.parent.parent
/ "tests"
/ "assets"
/ "validation"
/ "ecr_sample_input_good_with_RR.xml"
).read()

Expand Down Expand Up @@ -94,9 +97,6 @@ def test_validate_ecr_invalid():
+ "'Conditions' Attributes: attribute #1: 'code' "
+ "with the required value pattern: '[0-9]+',"
+ " attribute #2: 'codeSystem'",
"Could not find field. Field name: 'City' Related"
+ " elements: Field name: 'addr' Attributes: attribute"
+ " #1: 'use' with the required value pattern: 'H'",
"The field value does not exist or doesn't match "
+ "the following pattern: "
+ "'[0-9]{5}(?:-[0-9]{4})?'. For the Field name: 'Zip' value: '9999'",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@
<entry>
<act classCode="ACT" moodCode="EVN">
<templateId extension="2017-04-01" root="2.16.840.1.113883.10.20.15.2.3.29"/>
<id root="39d966b9-8a3a-4024-93d8-138e97d5898a"/>
<id root="8675309a-7754-r2d2-c3p0-973d9f777777"/>
<code code="RRVS19" codeSystem="2.16.840.1.114222.4.5.274" codeSystemName="PHIN VS (CDC Local Coding System)" displayName="eICR processed"/>
</act>
</entry>
Expand Down
Loading

0 comments on commit 353f09c

Please sign in to comment.