moving mappings to subfolder #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create FHIR code system | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
generate: | |
name: Create FHIR Code System | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Check file exists | |
run: | | |
test -f kin-fhir.json && echo "file_exists=1" >> $GITHUB_ENV || echo "file_exists=0" >> $GITHUB_ENV | |
- name: Download FHIR-OWL | |
uses: wei/wget@v1 | |
with: | |
args: -O fhirowl.jar https://github.com/aehrc/fhir-owl/releases/download/v1.1/fhir-owl-v1.1.jar | |
- name: Run transformation | |
run: | | |
java -jar fhirowl.jar -i src/main/resources/kin.owl -o kin-fhir.json -r jfact -useFhirExtension -dateRegex "(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})" -n FamilyHistoryRelationsOntology -t "Family History Relations Ontology" -codeReplace _,: | |
- name: Add FHIR code system from Git | |
run: git add kin-fhir.json | |
- name: Set up Git config | |
run: | | |
git config --local user.email "358260+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Check generated file changed | |
run: | | |
git diff --exit-code kin-fhir.json && echo "file_changed=0" >> $GITHUB_ENV || echo "file_changed=1" >> $GITHUB_ENV | |
- name: Commit FHIR code system | |
run: | | |
if [ ${{ env.file_changed }} -eq 1 ] || [ ${{ env.file_exists }} -eq 0 ] | |
then | |
echo "Commiting FHIR code system because it didn't exist or it has changes" | |
git commit -m "Updated FHIR code system" | |
else | |
echo "FHIR code system did not change" | |
fi | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |