diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..223391b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# We'll let Git's auto-detection algorithm infer if a file is text. If it is, +# enforce LF line endings regardless of OS or git configurations. +* text=auto eol=lf + +# Force bash scripts to always use LF line endings so that if a repo is accessed +# in Unix via a file share from Windows, the scripts will work. +*.sh text eol=lf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c0246cb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +# This workflow will setup IG publisher, run sushi +# It should also publish results (TBD) + +name: Node.js CI + +on: + push: + branches: [ "main" ] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup IG publisher + run: docker-compose run runner bash -c "cd /workdir && chmod +x ./_updatePublisher.sh && ./_updatePublisher.sh --yes" + - name: Generate + run: docker-compose run runner bash -c "cd /workdir && chmod +x ./_genonce.sh && ./_genonce.sh" + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: './output' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f33af14 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM node:lts-bullseye +RUN npm install -g fsh-sushi + +RUN apt-get update && apt-get -y install openjdk-17-jdk-headless ruby-full build-essential zlib1g-dev +RUN gem install jekyll bundler diff --git a/README.md b/README.md index a1613e8..3e767ec 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,30 @@ The profiles will be based on R4, [FHIR 4.0.1](http://hl7.org/fhir/R4/). (*) The work has started with Patient, Practitioner, and Organization. These should support the implementation guide for SMART App Launch. (?) Profiling device and medication related resources will be started if we identify implementers who have used these resources and feel there is a need for profiling. Sensotrend uses MedicationAdministration, in Finland with the Kanta PHR, but sees no need for a Finnish profile. + + +## Required tools +* NodeJS 18 +* Java 17 +* Jekyll (ruby) + +Or you can use docker, see [Dockerfile](Dockerfile). + +## Quick start + +With requirements installed locally: + +``` bash +./_updatePublisher.sh --yes +./_genonce.sh +``` + + +With docker: + +``` bash +docker-compose run runner bash -c "cd /workdir && ./_updatePublisher.sh --yes" +docker-compose run runner bash -c "cd /workdir && ./_genonce.sh" +``` + +Html output will be generated to `output/StructureDefinition-FinnishCorePatient.html`. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c62f100 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3.7' +services: + runner: + build: + context: . + dockerfile: Dockerfile + volumes: + - ./:/workdir \ No newline at end of file