-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'br-base-profiles' of https://github.com/WorldHealthOrga…
…nization/smart-base into br-base-profiles
- Loading branch information
Showing
23 changed files
with
327 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,15 +61,23 @@ jobs: | |
# Get the latest publisher - don't run the batch script but run the line directly | ||
args: curl -L https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar -o ./input-cache/publisher.jar --create-dirs | ||
|
||
|
||
- name: Create package cache folder | ||
uses: docker://hl7fhir/ig-publisher-base:latest | ||
with: | ||
entrypoint: /bin/sh | ||
args: -c "mkdir -p ./fhir-package-cache && chown 1001:127 ./fhir-package-cache" | ||
|
||
|
||
- name: Run the IG publisher | ||
uses: docker://hl7fhir/ig-publisher-base:latest | ||
with: | ||
# Run the publisher - don't run the batch script but run the line directly | ||
args: java -Xmx4g -jar ./input-cache/publisher.jar publisher -ig . -auto-ig-build -repo https://github.com/${{github.repository}} | ||
args: java -Xmx4g -jar ./input-cache/publisher.jar publisher -ig . -auto-ig-build -repo https://github.com/${{github.repository}} -package-cache-folder ./fhir-package-cache | ||
|
||
- name: Get branch names | ||
id: branch-name | ||
uses: tj-actions/branch-names@v4.3 | ||
uses: tj-actions/branch-names@v7.0.7 | ||
|
||
- name: Deploy candidate | ||
uses: JamesIves/[email protected] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# ImplementationGuide Publisher GitHub Action | ||
|
||
This GitHub Action automatically builds and publishes FHIR Implementation Guides using the HL7 FHIR IG Publisher. It is designed to run the publisher on push or pull request events and publish the output to GitHub Pages. | ||
|
||
## Features | ||
|
||
- Default branch is published in `https://<owner>.github.io/<repo>`. Branches are published in `https://<owner>.github.io/<repo>/branches/<branch>` | ||
- Automatically uses the latest versions of sushi and IG publisher | ||
|
||
## Prerequisites | ||
|
||
Before you can use this GitHub Action, you need to ensure the following: | ||
|
||
- Your repository should have a branch called `gh-pages`. | ||
- You have configured GitHub Pages to serve from the `gh-pages` branch. | ||
- Write permissions are granted for workflows | ||
- Your FHIR IG source files are properly set up in your repository. | ||
|
||
## Setup | ||
|
||
1. **Configure GitHub Pages** | ||
|
||
Make sure that GitHub Pages is enabled for your repository and is set to deploy from the `gh-pages` branch. | ||
|
||
2. **Add the Workflow File** | ||
|
||
Create a `.github/workflows` directory in your repository if it doesn't already exist, and call this workflow: | ||
```yaml | ||
jobs: | ||
call_build: | ||
uses: WorldHealthOrganization/smart-base/.github/workflows/ghbuild.yml@main | ||
``` | ||
See [example](https://github.com/WorldHealthOrganization/smart-ig-starter-kit/blob/main/.github/workflows/ghbuild.yml). | ||
3. **GitHub Token** | ||
This action uses the `GITHUB_TOKEN` provided by GitHub Actions, so you don't need to manually create one. | ||
|
||
## Usage | ||
|
||
The action is configured to run on push or pull requests to any branch except the `gh-pages` branch. It can also be triggered manually via the GitHub Actions tab. | ||
|
||
### Workflow Triggers | ||
|
||
- **Push to `main` branch**: When commits are pushed to the `main` branch, the IG Publisher is run, and the output is published to the root of the GitHub Pages site. | ||
- **Push to other branches**: When commits are pushed to branches other than `main`, the output is published to a subdirectory named after the branch - branches/<vranch_name> | ||
- **Pull Request**: The action will run to ensure that the IG Publisher can build the IG from the pull request, but will not deploy to GitHub Pages. | ||
- **Manual Trigger**: You can manually trigger the workflow from the GitHub Actions tab if needed. | ||
|
||
### What the Workflow Does | ||
|
||
Here is a step-by-step description of the workflow: | ||
|
||
1. **Checkout**: Checks out the repository code. | ||
2. **Get the latest image of the IG publisher**: Downloads the latest `publisher.jar` from the official FHIR IG Publisher repository. | ||
4. **Create package cache folder**: Creates a cache folder for the packages needed by the publisher. | ||
5. **Run the IG publisher**: Executes the IG Publisher to generate the IG site files. | ||
6. **Deploy to GitHub Pages**: Depending on the branch, deploys the output to the `gh-pages` branch of your repository. | ||
|
||
### Notes | ||
|
||
- The action is currently set up to keep a history of deployments for branches other than `main`. This can be changed by adjusting the `single-commit` and `clean` options in the workflow file. | ||
|
||
|
||
## Contributing | ||
|
||
Contributions to this GitHub Action are welcome. Please feel free to submit issues or pull requests with improvements. | ||
|
||
## License | ||
|
||
This project is licensed under the [MIT License](LICENSE). Feel free to use it and contribute. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Update README | ||
|
||
on: | ||
workflow_call: # Reusable by other workflows | ||
inputs: | ||
repositoryOwner: | ||
required: true | ||
type: string | ||
repositoryName: | ||
required: true | ||
type: string | ||
push: | ||
branches-ignore: | ||
- 'gh-pages' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-readme-badges: | ||
runs-on: ubuntu-latest | ||
env: | ||
REPOSITORY_OWNER: ${{ inputs.repositoryOwner }} | ||
REPOSITORY_NAME: ${{ inputs.repositoryName }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download badges.md | ||
run: | | ||
curl -o badges.md https://raw.githubusercontent.com/WorldHealthOrganization/smart-ig-empty/main/badges.md | ||
- name: Debug Variables | ||
run: | | ||
echo "Repository Owner: $REPOSITORY_OWNER" | ||
echo "Repository Name: $REPOSITORY_NAME" | ||
|
||
- name: Replace placeholders in badges.md | ||
run: | | ||
sed -i "s/<REPO_OWNER>/$REPOSITORY_OWNER/" badges.md | ||
sed -i "s/<REPO_NAME>/$REPOSITORY_NAME/" badges.md | ||
- name: Replace include with content of badges | ||
run: | | ||
awk 'NR==FNR{new = new $0 ORS; next} /<!--\/badges-->/{f=0} !f{print} /<!--badges-->/{printf "%s",new; f=1}' badges.md README.md > README_NEW.md && mv README_NEW.md README.md | ||
cat README.md | ||
- run: | | ||
rm badges.md | ||
- name: Stage changed files | ||
run: git add ./README.md | ||
|
||
- name: Deploy candidate | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: ${{ github.ref_name }} # The branch the action should deploy to. | ||
folder: . # The folder the action should deploy. | ||
commit-message: Deploy branch | ||
target-folder: . | ||
clean: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[IG] | ||
ig = fsh-generated/resources/ImplementationGuide-who.fhir.smart-base.json | ||
ig = fsh-generated/resources/ImplementationGuide-who.base.json | ||
|
||
#template = #local-template | ||
template = who.fhir.template#current | ||
template = who.template#current |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Profile: SGBusinessProcess | ||
Parent: PlanDefinition |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Profile: SGCodeSystem | ||
Parent: CodeSystem | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Profile: SGImplementationGuide | ||
Parent: ImplementationGuide | ||
|
||
* license = #CC-BY-SA-3.0-IGO | ||
|
||
|
||
|
||
|
||
* definition.resource | ||
* ^slicing.discriminator.type = #profile | ||
* ^slicing.discriminator.path = "reference.resolve()" | ||
* ^slicing.rules = #open | ||
|
||
* definition.resource contains | ||
LogicalModel 0..* and | ||
Extension 0..* and | ||
Profile 0..* | ||
|
||
* definition.resource[LogicalModel].reference.type = #StructureDefinition | ||
* definition.resource[LogicalModel].reference only Reference(SGLogicalModel) | ||
|
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Profile: SGMeasure | ||
Parent: Measure | ||
|
||
* title 1..1 | ||
* version 1..1 | ||
* name 1..1 | ||
* publisher 1..1 | ||
* description 1..1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Profile: SGPersona | ||
Parent: ActorDefinition | ||
|
||
* identifier 1..* | ||
* status MS | ||
* name 1..1 | ||
* title 1..1 | ||
* type = #person | ||
* experimental 1..1 | ||
* description 1..1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Profile: SGValueSet | ||
Parent: ValueSet | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"index-version" : 2, | ||
"files" : [] | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"index-version" : 2, | ||
"files" : [] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<table class="table table-bordered"> | ||
<thead class="thead-dark"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Title</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for data_file in site.data %} | ||
{% assign filename = data_file[0] %} | ||
{% assign entry = data_file[1] %} | ||
|
||
{% assign name = "" %} | ||
{% assign title = "" %} | ||
{% assign description = "" %} | ||
{% assign link_path = filename | remove: ".json" | append: ".html" %} | ||
|
||
{% assign profile_includes_string = false %} | ||
|
||
{% for extension in entry.extension %} | ||
{% if extension.url == "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name" %} | ||
{% assign name = extension.valueString %} | ||
{% elsif extension.url == "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title" %} | ||
{% assign title = extension.valueString %} | ||
{% elsif extension.url == "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description" %} | ||
{% assign description = extension.valueMarkdown %} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if entry.meta and entry.meta.profile %} | ||
{% for profile in entry.meta.profile %} | ||
{% if profile == "http://worldhealthorganization.github.io/smart-base/StructureDefinition/SGPersona" %} | ||
{% assign profile_includes_string = true %} | ||
{% break %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
|
||
{% if entry.resourceType == "ActorDefinition" or profile_includes_string %} | ||
<tr> | ||
<td><a href="{{ link_path }}">{{ name }}</a></td> | ||
<td>{{ title }}</td> | ||
<td>{{ description }}</td> | ||
</tr> | ||
{% endif %} | ||
|
||
{% endfor %} | ||
</tbody> | ||
</table> |
51 changes: 51 additions & 0 deletions
51
local-template/package/includes/fragment-functionalrequirements.liquid
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% for data_file in site.data %} | ||
{% assign content = data_file[1] %} | ||
{% assign requirements_statement_found = false %} | ||
{% assign requirements_extensions = nil %} | ||
|
||
|
||
|
||
{% if content.code.coding[0].code == "Requirements" %} | ||
{% for ext in content.extension %} | ||
{% if ext.url == "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title" %} | ||
<h3>{{ext.valueString}}</h3> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
<div> | ||
<table class="table table-bordered"> | ||
<thead class="thead-dark"> | ||
<tr> | ||
<th>Key</th> | ||
<th>Requirement</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
{% for ext in content.extension %} | ||
{% if ext.url == "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement" %} | ||
<tr> | ||
{% for statement in ext.extension %} | ||
|
||
|
||
{% if statement.url == "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.key" %} | ||
<td>{{ statement.valueId }}</td> | ||
{% endif %} | ||
|
||
{% if statement.url == "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.requirement" %} | ||
<td>{{ statement.valueMarkdown | markdownify}}</td> | ||
{% endif %} | ||
|
||
{% endfor %} | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
<br> <!-- Adding a break between tables for visual separation --> | ||
|
||
|
||
|
||
{% endif %} | ||
{% endfor %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "who.fhir.smart-ig-empty-local", | ||
"version": "0.0.1", | ||
"type": "fhir.template", | ||
"license": "CC0-1.0", | ||
"description": "Local template extension for WHO SMART FHIR IG", | ||
"author": "http://who.int", | ||
"base": "who.fhir.template", | ||
"dependencies": { | ||
"who.fhir.template": "current" | ||
} | ||
} |
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