Skip to content

Add files via upload #36

Add files via upload

Add files via upload #36

Workflow file for this run

name: Download CSV Files
on:
push:
paths:
- 'mappings/*.csv'
- '.github/workflows/update-csvs.yaml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.5.3
- name: Cache Maven modules
uses: actions/cache@v2
with:
path: ~/.m2
key: v1-maven-deps-${{ hashFiles('**/pom.xml') }}
restore-keys: v1-maven-deps-
- name: Build the Conversion tools
shell: bash
run: mvn compile package
- name: Download files
shell: bash
run: |
rm -f mappings/segments/*.csv mappings/messages/*.csv mappings/codesystems/*.csv mappings/datatypes/*.csv
$JAVA_HOME/bin/java -cp target/v2-to-fhir.jar:target/lib/* org.hl7.v2tofhir.Convert -omappings/segments "-rmappings/v2-to-FHIR Map Inventory - Segment.csv" -omappings/datatypes "-rmappings/v2-to-FHIR Map Inventory - Data Type.csv" -omappings/messages "-rmappings/v2-to-FHIR Map Inventory - Message.csv" -omappings/codesystems "-rmappings/v2-to-FHIR Map Inventory - Code System.csv"
# Change -r to -d to download all files in java command above to download all instead of just ready for pub
- name: Recreate SUSHI Files
shell: bash
run: |
rm -f input/Datatype*.fsh input/Segment*.fsh input/Table*.fsh input/Message*.fsh
$JAVA_HOME/bin/java -cp target/v2-to-fhir.jar:target/lib/* org.hl7.v2tofhir.Convert -oinput/fsh mappings/messages mappings/segments mappings/datatypes mappings/codesystems || echo Conversion failed, continuing anyway
- name: Commit and Push changes
run: |
git config --global user.name 'Automated CSV Converter'
git config --global user.email '[email protected]'
git add -A
git commit -m "Add downloaded CSV files"
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push