Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Workflow to send HL7 messages to RS staging #1274

Merged
merged 39 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a5aa836
Added inital workflow to send hl7 files to staging
basiliskus Aug 26, 2024
2e67e76
Added option for manual testing
basiliskus Aug 26, 2024
1603bfd
Added trigger to test
basiliskus Aug 27, 2024
1456832
Fixed installation
basiliskus Aug 27, 2024
bbc00f0
Fixed path
basiliskus Aug 27, 2024
3ba2f64
Fixed hurl command call and added test sample files
basiliskus Aug 27, 2024
254e61c
Testing workflow
basiliskus Aug 27, 2024
f55d2f6
Testing workflow
basiliskus Aug 27, 2024
5b330b8
Added env variable
basiliskus Aug 27, 2024
7da7f00
Seems like the jwt cli has a limitation that requires the private key…
basiliskus Aug 27, 2024
81fd4ec
Added required pem extension
basiliskus Aug 27, 2024
48e8fae
Fixed path to hurl script
basiliskus Aug 27, 2024
a1310ee
Changed sender name for testing
basiliskus Aug 27, 2024
039d1ec
Testing getting token from RS
basiliskus Aug 27, 2024
58ec377
Fixed variable name
basiliskus Aug 27, 2024
67532d5
Added request to waters api
basiliskus Aug 27, 2024
fd58ebf
Cleaned up and reverted to correct sender name
basiliskus Aug 27, 2024
3079d99
Remved temp files and updated file path
basiliskus Aug 27, 2024
558b3e9
Clean up
basiliskus Aug 27, 2024
55e5436
Removed pr trigger
basiliskus Aug 28, 2024
a1f7180
Changed to use Azure storage blob instead of repository to store files
basiliskus Aug 28, 2024
0337357
Added back pr trigger for testing purposes
basiliskus Aug 28, 2024
e02dd6e
Added required permissions
basiliskus Aug 28, 2024
c1f4dad
Changed source for az command and formatted
basiliskus Aug 29, 2024
540e60c
Merge branch 'main' into story/1255/add-gh-workflow
basiliskus Sep 3, 2024
e082782
Changed back to use repository-stored files instead of Azure container
basiliskus Sep 3, 2024
6b26f03
Renamed workflow
basiliskus Sep 3, 2024
34c4772
Testing uploading to azure storage container
basiliskus Sep 3, 2024
bbc4659
Testing uploading to azure storage container (cont.)
basiliskus Sep 3, 2024
c3f41f2
Testing uploading to azure storage container (cont.)
basiliskus Sep 3, 2024
3e979c0
Reverted steps used for testing
basiliskus Sep 3, 2024
f122dc1
Removed pull_request trigger used for testing
basiliskus Sep 3, 2024
6cbb0a6
Added test order based on AL sample file
basiliskus Sep 5, 2024
72b7b1c
Added pull_request trigger for testing
basiliskus Sep 5, 2024
0f759be
Small change to trigger gh action
basiliskus Sep 5, 2024
c010213
Changed public/private keypair for RS sender
basiliskus Sep 5, 2024
0f3ee9a
Removed pull_request trigger used for testing
basiliskus Sep 5, 2024
12f94f1
Changed schedule to run from Tuesday to Saturday, after changes in th…
basiliskus Sep 6, 2024
90083a3
Added ORU sample file
basiliskus Sep 6, 2024
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
61 changes: 61 additions & 0 deletions .github/workflows/automated-staging-test-submit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Automated Staging Test - Submit Messages

on:
schedule:
- cron: "0 0 * * 2-6" # Tuesday to Saturday at Midnight UTC
workflow_dispatch:

jobs:
send_files:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Install jq
run: sudo apt-get install -y jq

- name: Install jwt-cli
run: |
curl --silent --location https://github.com/mike-engel/jwt-cli/releases/latest/download/jwt-linux.tar.gz | tar xvz -C /usr/local/bin/
sudo chmod +x /usr/local/bin/jwt

- name: Write private key to file
run: |
echo "${{ secrets.AUTOMATED_STAGING_RS_INTEGRATION_PRIVATE_KEY }}" > /tmp/staging_private_key.pem
chmod 600 /tmp/staging_private_key.pem

- name: Send HL7 sample messages to staging RS
run: |
host=https://staging.prime.cdc.gov:443
client_id=flexion
client_sender=automated-staging-test-sender
jwt=$(jwt encode --exp='+5min' --jti $(uuidgen) --alg RS256 \
-k $client_id.$client_sender -i $client_id.$client_sender \
-s $client_id.$client_sender -a $host --no-iat -S @/tmp/staging_private_key.pem)

token=$(curl \
--header "Content-Type: application/x-www-form-urlencoded" \
--data "scope=$client_id.*.report" \
--data "client_assertion=$jwt" \
--data "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer" \
--data "grant_type=client_credentials" \
--silent \
"$host/api/token" | jq -r ".access_token")

for file in $(pwd)/examples/Test/Automated/*.hl7; do
echo "Sending $file"
curl \
--header "Content-Type: application/hl7-v2" \
--header "Client: $client_id.$client_sender" \
--header "Authorization: Bearer $token" \
--data-binary "@$file" \
--silent \
"$host/api/waters"
done

- name: Clean up private key
if: always()
run: |
rm -f /tmp/staging_private_key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MSH|^~\&|Sender Application^sender.test.com^DNS|Sender Facility^0.0.0.0.0.0.0.0^ISO|Receiver Application^0.0.0.0.0.0.0.0^ISO|Receiver Facility^automated-staging-test-receiver-id^DNS|20230101010000-0000||ORM^O01^ORM_O01|111111|T|2.5.1||||||||||
PID|1||1300974^^^Baptist East^MR||ONE^TESTCASE||202402210152-0500|F^Female^HL70001||2106-3^White^HL70005|1234 GPCS WAY^^MONTGOMERY^Alabama^36117^USA^home^^Montgomery|||||||2227600015||||N^Not Hispanic or Latino^HL70189|||1|||||
NK1|1|ONE^MOMFIRST|MTH^Mother^HL70063||^^^^^804^5693861||||||||||||||||||||||||||||123456789^^^Medicaid&2.16.840.1.113883.4.446&ISO^MD||||000-00-0000^^^ssn&2.16.840.1.113883.4.1&ISO^SS
ORC|NW|4560411583^ORDERID||||||||||12345^^^^^^^^NPI&2.16.840.1.113883.4.6&ISO^L|||||||||
OBR|1|4560411583^ORDERID||54089-8^Newborn screening panel AHIC^LN|||202402221854-0500|||||||||12345^^^^^^^^NPI&2.16.840.1.113883.4.6&ISO^L||||||||
OBX|1|ST|57723-9^Unique bar code number of Current sample^LN||123456||||||F|||202402221854-0500
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MSH|^~\&|Sender Application^sender.test.com^DNS|Sender Facility^0.0.0.0.0.0.0.0^ISO|Receiver Application^0.0.0.0.0.0.0.0^ISO|Receiver Facility^automated-staging-test-receiver-id^DNS|20230101010000-0000||ORU^R01^ORU_R01|111111|T|2.5.1||||||||||
PID|1||1300974^^^Baptist East^MR||ONE^TESTCASE||20230504131000|F^Female^HL70001||2106-3^White^HL70005|1234 GPCS WAY^^MONTGOMERY^Alabama^36117^USA^home^^Montgomery|||||||2227600015||||N^Not Hispanic or Latino^HL70189|||1|||||N|
NK1|1|ONE^MOMFIRST|MTH^Mother^HL70063^^^^^^Mother||^^^^^804^5693861||||||||||||||||||||||||||||123456789^^^Medicaid&2.16.840.1.113883.4.446&ISO^MD||||000-00-0000^^^ssn&2.16.840.1.113883.4.1&ISO^SS|||||||
ORC|RE|4560411583^ORDERID|20231561137^ALPHL|||||||||1174911127^SMITH^SAMANTHA^^^^^^NPI^L^^^NPI|||||||||BAPTIST EAST^L^^^^CMS^NPI^^^1043269798~BAPTIST EAST^L^^^^AL Public Health Lab^Submitter ID^^^739||||||||||54089-8^Newborn screening panel American Health Information Community (AHIC)^LN|
OBR|1|4560411583^ORDERID|20231561137^ALPHL|57128-1^Newborn Screening Report summary panel^LN|||20230603045000||||O|||||1174911127^SMITH^SAMANTHA^^^^^^NPI^L^^^NPI||||||20230606191613|||F||||423787478&EPIC&1.2.840.114350.1.13.145.2.7.2.695071&ISO^20231561137&AL Public Health Lab&2.16.840.1.114222.4.1.10080&ISO|||||||||||||||||||||54089-8^Newborn screening panel American Health Information Community (AHIC)^LN|
OBX|1|CWE|57718-9^Sample quality of Dried blood spot^LN|^1^1|LA12432-3^Acceptable^LN||||||F|||20230603045000|||||20230606191613||||AL PHL Newborn Screening Laboratory^^^^^|204 Legends Court^^Prattville^AL^36066|^Miller^Marie^^^^^^||||RSLT|UNSP|
SPM|1|423787478&EPIC&1.2.840.114350.1.13.145.2.7.2.695071&ISO^20231561137&AL Public Health Lab&2.16.840.1.114222.4.1.10080&ISO||440500007^Blood spot specimen^SCT|||||||||||||20230603045000^20230603045000|20230605102300|