-
Notifications
You must be signed in to change notification settings - Fork 6
59 lines (48 loc) · 1.93 KB
/
fhir-codesystem.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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 }}