simplifier-ig 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simplifier_ig-0.1.1/PKG-INFO +252 -0
- simplifier_ig-0.1.1/README.md +229 -0
- simplifier_ig-0.1.1/pyproject.toml +41 -0
- simplifier_ig-0.1.1/setup.cfg +4 -0
- simplifier_ig-0.1.1/simplifier_ig/__init__.py +3 -0
- simplifier_ig-0.1.1/simplifier_ig/__main__.py +7 -0
- simplifier_ig-0.1.1/simplifier_ig/cli.py +357 -0
- simplifier_ig-0.1.1/simplifier_ig/config.py +33 -0
- simplifier_ig-0.1.1/simplifier_ig/generator.py +561 -0
- simplifier_ig-0.1.1/simplifier_ig/ig_resource.py +369 -0
- simplifier_ig-0.1.1/simplifier_ig/initializer.py +297 -0
- simplifier_ig-0.1.1/simplifier_ig/models.py +37 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/.simplifierupload +7 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/guide.yaml +22 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pages/index.md +8 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-examples.md +13 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-mappings.md +15 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-resource-base.md +8 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-resource-copyright.md +8 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-resource-date.md +8 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-resource-description.md +8 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-resource-name.md +8 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-get-resource-version.md +8 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-profile-bindings.md +21 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-profile-constraints.md +16 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/fql-referenced-by.md +12 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-fql-constraints.md +18 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-fql-search-parameters.md +11 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-fql-terminology-bindings.md +19 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-meta-table.md +21 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-meta.md +19 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-view-example.md +19 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-view-render.md +22 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates/resource-view-tree.md +23 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/codesystem.index.md +16 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/codesystem.md +13 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/examples.index.md +17 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/examples.md +10 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/structuredefinition.index.md +17 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/structuredefinition.md +14 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/valueset.index.md +16 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/pagetemplates-artifacts/valueset.md +13 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/styles/custom/master.html +134 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/styles/custom/settings.style +1 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/styles/custom/style.css +558 -0
- simplifier_ig-0.1.1/simplifier_ig/templates/variables.yaml +7 -0
- simplifier_ig-0.1.1/simplifier_ig/utils.py +20 -0
- simplifier_ig-0.1.1/simplifier_ig/validator.py +252 -0
- simplifier_ig-0.1.1/simplifier_ig/yaml_helpers.py +20 -0
- simplifier_ig-0.1.1/simplifier_ig.egg-info/PKG-INFO +252 -0
- simplifier_ig-0.1.1/simplifier_ig.egg-info/SOURCES.txt +53 -0
- simplifier_ig-0.1.1/simplifier_ig.egg-info/dependency_links.txt +1 -0
- simplifier_ig-0.1.1/simplifier_ig.egg-info/entry_points.txt +2 -0
- simplifier_ig-0.1.1/simplifier_ig.egg-info/requires.txt +1 -0
- simplifier_ig-0.1.1/simplifier_ig.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simplifier-ig
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: CLI tool for generating Simplifier.net supported Implementation Guide structures from an IG publisher like input folder
|
|
5
|
+
Author: Ardon Toonstra
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/ArdonToonstra/simplifier-ig
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/ArdonToonstra/simplifier-ig/issues
|
|
9
|
+
Keywords: fhir,simplifier,implementation-guide,hl7,cli
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
19
|
+
Classifier: Environment :: Console
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: pyyaml
|
|
23
|
+
|
|
24
|
+
# simplifier-ig
|
|
25
|
+
|
|
26
|
+
CLI tool for generating [Simplifier.net](https://simplifier.net) Implementation Guide structures from a IG publisher like input folder. The tool supports initializing a new IG input structure, validating the input, and generating the IG output. It also allows saving configuration for repeated use.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Via pip (recommended for developers)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install simplifier-ig
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Via standalone binary (no Python required)
|
|
37
|
+
|
|
38
|
+
Download the pre-built binary for your OS from the [GitHub Actions artifacts](https://github.com/ArdonToonstra/simplifier-ig/actions/workflows/build.yml):
|
|
39
|
+
|
|
40
|
+
1. Go to the **Actions** tab → **Build Binaries** workflow
|
|
41
|
+
2. Click on the latest successful run (tagged with a version like `v0.1.0`)
|
|
42
|
+
3. Scroll down to **Artifacts** and download:
|
|
43
|
+
- `simplifier-ig-linux` (Linux)
|
|
44
|
+
- `simplifier-ig-macos` (macOS)
|
|
45
|
+
- `simplifier-ig-windows` (Windows)
|
|
46
|
+
4. Extract the binary and make it executable (Linux/macOS only):
|
|
47
|
+
```bash
|
|
48
|
+
# Linux/macOS
|
|
49
|
+
chmod +x simplifier-ig
|
|
50
|
+
./simplifier-ig --help
|
|
51
|
+
|
|
52
|
+
# Or add to PATH
|
|
53
|
+
sudo mv simplifier-ig /usr/local/bin/
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
# Windows (PowerShell)
|
|
58
|
+
.\simplifier-ig.exe --help
|
|
59
|
+
|
|
60
|
+
# Or add to PATH by moving to a directory in your PATH
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
> **Note**: Binaries are currently stored as GitHub Actions artifacts (90-day retention). For permanent releases, they can be manually attached to GitHub Releases or automated via an additional workflow.
|
|
64
|
+
|
|
65
|
+
### From source
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/ArdonToonstra/simplifier-ig.git
|
|
69
|
+
cd simplifier-ig
|
|
70
|
+
pip install .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### As a GitHub Action
|
|
74
|
+
|
|
75
|
+
Use this action in your workflows to generate IGs automatically:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
# .github/workflows/generate-ig.yml
|
|
79
|
+
name: Generate IG
|
|
80
|
+
on: [push]
|
|
81
|
+
|
|
82
|
+
jobs:
|
|
83
|
+
generate:
|
|
84
|
+
runs-on: ubuntu-latest
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v4
|
|
87
|
+
|
|
88
|
+
- name: Generate Implementation Guide
|
|
89
|
+
uses: ArdonToonstra/simplifier-ig@v1
|
|
90
|
+
with:
|
|
91
|
+
input: ./input
|
|
92
|
+
output: ./guides
|
|
93
|
+
|
|
94
|
+
- name: Upload IG output
|
|
95
|
+
uses: actions/upload-artifact@v4
|
|
96
|
+
with:
|
|
97
|
+
name: ig-output
|
|
98
|
+
path: ./guides
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Action inputs
|
|
102
|
+
|
|
103
|
+
| Input | Description | Default |
|
|
104
|
+
|--------------------|--------------------------------------------------|-------------|
|
|
105
|
+
| `command` | Command to run: `generate`, `validate`, `ig-resource` | `generate` |
|
|
106
|
+
| `input` | Path to the IG input folder | `./input` |
|
|
107
|
+
| `output` | Path to the output folder | `./guides` |
|
|
108
|
+
| `skip-validation` | Skip input validation (`true`/`false`) | `false` |
|
|
109
|
+
| `no-ig-resource` | Skip ImplementationGuide.json generation (`true`/`false`) | `false` |
|
|
110
|
+
| `python-version` | Python version to use | `3.12` |
|
|
111
|
+
|
|
112
|
+
#### Validate only
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
- uses: ArdonToonstra/simplifier-ig@v1
|
|
116
|
+
with:
|
|
117
|
+
command: validate
|
|
118
|
+
input: ./input
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Usage
|
|
122
|
+
|
|
123
|
+
### Initialize a new IG input folder
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
simplifier-ig init --path ./my-ig --name "My Implementation Guide"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
| Option | Description | Default |
|
|
130
|
+
|-----------|------------------------------------------|------------------------------|
|
|
131
|
+
| `--path` | Where to create the IG input structure | `./input` |
|
|
132
|
+
| `--name` | Name for the Implementation Guide | `My Implementation Guide` |
|
|
133
|
+
| `--style` | Style folder name | `custom` |
|
|
134
|
+
| `--force` | Allow init in a non-empty directory | |
|
|
135
|
+
|
|
136
|
+
### Validate an IG input folder
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
simplifier-ig validate --input ./my-ig
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Generate an IG
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
simplifier-ig generate --input ./my-ig --output ./output
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
By default, an `ImplementationGuide.json` FHIR R4 resource is generated alongside the IG. Only FHIR R4 (`4.0.1`) is currently supported for IG resource generation. This requires the following fields in `guide.yaml`:
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
id: my.ig.id
|
|
152
|
+
status: draft # draft | active | retired | unknown
|
|
153
|
+
fhirVersion: 4.0.1
|
|
154
|
+
canonical: https://example.org/fhir
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
If these fields are missing, the tool warns and skips IG resource generation automatically.
|
|
158
|
+
|
|
159
|
+
| Option | Description | Default |
|
|
160
|
+
|----------------------|--------------------------------------------------|----------|
|
|
161
|
+
| `--input` | Path to the input folder | saved path or `./input` |
|
|
162
|
+
| `--output` | Path to the output folder | `./guides` |
|
|
163
|
+
| `--skip-validation` | Skip input validation | |
|
|
164
|
+
| `--no-ig-resource` | Skip ImplementationGuide.json resource generation | |
|
|
165
|
+
|
|
166
|
+
### Generate IG resource separately
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
simplifier-ig ig-resource --path ./output/my-ig --input ./my-ig
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Configuration
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
simplifier-ig config # Show current configuration
|
|
176
|
+
simplifier-ig clear # Clear saved configuration
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Input folder structure
|
|
180
|
+
|
|
181
|
+
After running `init`, the input folder will have this structure:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
my-ig/
|
|
185
|
+
├── guide.yaml # IG configuration (title, url-key, menu, etc.)
|
|
186
|
+
├── variables.yaml # Template variables
|
|
187
|
+
├── resources/ # FHIR conformance resources (.json)
|
|
188
|
+
├── examples/ # FHIR example resources (.json)
|
|
189
|
+
├── pages/ # Markdown documentation pages
|
|
190
|
+
├── images/ # (optional) Images
|
|
191
|
+
├── pagetemplates/ # (optional) Reusable page snippets
|
|
192
|
+
├── pagetemplates-artifacts/ # Per-resource-type page templates
|
|
193
|
+
└── styles/
|
|
194
|
+
└── custom/
|
|
195
|
+
├── master.html
|
|
196
|
+
├── settings.style
|
|
197
|
+
└── style.css
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Development
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
git clone https://github.com/ArdonToonstra/simplifier-ig.git
|
|
204
|
+
cd simplifier-ig
|
|
205
|
+
pip install -e .
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
You can also run the tool as a module:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
python -m simplifier_ig --help
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Building binaries
|
|
215
|
+
|
|
216
|
+
The GitHub Actions workflow builds standalone binaries for Linux, macOS, and Windows using PyInstaller when a version tag is pushed (e.g., `v0.1.0`).
|
|
217
|
+
|
|
218
|
+
**To build binaries for a release:**
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
git tag v0.1.0
|
|
222
|
+
git push origin v0.1.0
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
This triggers the **Build Binaries** workflow which creates three artifacts:
|
|
226
|
+
- `simplifier-ig-linux` (Ubuntu)
|
|
227
|
+
- `simplifier-ig-macos` (macOS)
|
|
228
|
+
- `simplifier-ig-windows` (Windows .exe)
|
|
229
|
+
|
|
230
|
+
Artifacts are available in the **Actions** tab → **Build Binaries** workflow for 90 days. To attach binaries permanently to GitHub Releases, either:
|
|
231
|
+
- Download artifacts and manually attach to the release, or
|
|
232
|
+
- Extend the workflow to automatically create a GitHub Release with attached binaries
|
|
233
|
+
|
|
234
|
+
### Publishing to PyPI
|
|
235
|
+
|
|
236
|
+
Tag a release to trigger the publish workflow:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
git tag v0.1.0
|
|
240
|
+
git push origin v0.1.0
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
This triggers the **Publish to PyPI** workflow, which uses OpenID Connect (Trusted Publisher) — no API token or secret is required.
|
|
244
|
+
|
|
245
|
+
## Dependencies
|
|
246
|
+
|
|
247
|
+
- Python >= 3.9
|
|
248
|
+
- [PyYAML](https://pypi.org/project/PyYAML/)
|
|
249
|
+
|
|
250
|
+
## License
|
|
251
|
+
|
|
252
|
+
MIT
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# simplifier-ig
|
|
2
|
+
|
|
3
|
+
CLI tool for generating [Simplifier.net](https://simplifier.net) Implementation Guide structures from a IG publisher like input folder. The tool supports initializing a new IG input structure, validating the input, and generating the IG output. It also allows saving configuration for repeated use.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Via pip (recommended for developers)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install simplifier-ig
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Via standalone binary (no Python required)
|
|
14
|
+
|
|
15
|
+
Download the pre-built binary for your OS from the [GitHub Actions artifacts](https://github.com/ArdonToonstra/simplifier-ig/actions/workflows/build.yml):
|
|
16
|
+
|
|
17
|
+
1. Go to the **Actions** tab → **Build Binaries** workflow
|
|
18
|
+
2. Click on the latest successful run (tagged with a version like `v0.1.0`)
|
|
19
|
+
3. Scroll down to **Artifacts** and download:
|
|
20
|
+
- `simplifier-ig-linux` (Linux)
|
|
21
|
+
- `simplifier-ig-macos` (macOS)
|
|
22
|
+
- `simplifier-ig-windows` (Windows)
|
|
23
|
+
4. Extract the binary and make it executable (Linux/macOS only):
|
|
24
|
+
```bash
|
|
25
|
+
# Linux/macOS
|
|
26
|
+
chmod +x simplifier-ig
|
|
27
|
+
./simplifier-ig --help
|
|
28
|
+
|
|
29
|
+
# Or add to PATH
|
|
30
|
+
sudo mv simplifier-ig /usr/local/bin/
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
# Windows (PowerShell)
|
|
35
|
+
.\simplifier-ig.exe --help
|
|
36
|
+
|
|
37
|
+
# Or add to PATH by moving to a directory in your PATH
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> **Note**: Binaries are currently stored as GitHub Actions artifacts (90-day retention). For permanent releases, they can be manually attached to GitHub Releases or automated via an additional workflow.
|
|
41
|
+
|
|
42
|
+
### From source
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
git clone https://github.com/ArdonToonstra/simplifier-ig.git
|
|
46
|
+
cd simplifier-ig
|
|
47
|
+
pip install .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### As a GitHub Action
|
|
51
|
+
|
|
52
|
+
Use this action in your workflows to generate IGs automatically:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
# .github/workflows/generate-ig.yml
|
|
56
|
+
name: Generate IG
|
|
57
|
+
on: [push]
|
|
58
|
+
|
|
59
|
+
jobs:
|
|
60
|
+
generate:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
|
|
65
|
+
- name: Generate Implementation Guide
|
|
66
|
+
uses: ArdonToonstra/simplifier-ig@v1
|
|
67
|
+
with:
|
|
68
|
+
input: ./input
|
|
69
|
+
output: ./guides
|
|
70
|
+
|
|
71
|
+
- name: Upload IG output
|
|
72
|
+
uses: actions/upload-artifact@v4
|
|
73
|
+
with:
|
|
74
|
+
name: ig-output
|
|
75
|
+
path: ./guides
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Action inputs
|
|
79
|
+
|
|
80
|
+
| Input | Description | Default |
|
|
81
|
+
|--------------------|--------------------------------------------------|-------------|
|
|
82
|
+
| `command` | Command to run: `generate`, `validate`, `ig-resource` | `generate` |
|
|
83
|
+
| `input` | Path to the IG input folder | `./input` |
|
|
84
|
+
| `output` | Path to the output folder | `./guides` |
|
|
85
|
+
| `skip-validation` | Skip input validation (`true`/`false`) | `false` |
|
|
86
|
+
| `no-ig-resource` | Skip ImplementationGuide.json generation (`true`/`false`) | `false` |
|
|
87
|
+
| `python-version` | Python version to use | `3.12` |
|
|
88
|
+
|
|
89
|
+
#### Validate only
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
- uses: ArdonToonstra/simplifier-ig@v1
|
|
93
|
+
with:
|
|
94
|
+
command: validate
|
|
95
|
+
input: ./input
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Usage
|
|
99
|
+
|
|
100
|
+
### Initialize a new IG input folder
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
simplifier-ig init --path ./my-ig --name "My Implementation Guide"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Option | Description | Default |
|
|
107
|
+
|-----------|------------------------------------------|------------------------------|
|
|
108
|
+
| `--path` | Where to create the IG input structure | `./input` |
|
|
109
|
+
| `--name` | Name for the Implementation Guide | `My Implementation Guide` |
|
|
110
|
+
| `--style` | Style folder name | `custom` |
|
|
111
|
+
| `--force` | Allow init in a non-empty directory | |
|
|
112
|
+
|
|
113
|
+
### Validate an IG input folder
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
simplifier-ig validate --input ./my-ig
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Generate an IG
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
simplifier-ig generate --input ./my-ig --output ./output
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
By default, an `ImplementationGuide.json` FHIR R4 resource is generated alongside the IG. Only FHIR R4 (`4.0.1`) is currently supported for IG resource generation. This requires the following fields in `guide.yaml`:
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
id: my.ig.id
|
|
129
|
+
status: draft # draft | active | retired | unknown
|
|
130
|
+
fhirVersion: 4.0.1
|
|
131
|
+
canonical: https://example.org/fhir
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
If these fields are missing, the tool warns and skips IG resource generation automatically.
|
|
135
|
+
|
|
136
|
+
| Option | Description | Default |
|
|
137
|
+
|----------------------|--------------------------------------------------|----------|
|
|
138
|
+
| `--input` | Path to the input folder | saved path or `./input` |
|
|
139
|
+
| `--output` | Path to the output folder | `./guides` |
|
|
140
|
+
| `--skip-validation` | Skip input validation | |
|
|
141
|
+
| `--no-ig-resource` | Skip ImplementationGuide.json resource generation | |
|
|
142
|
+
|
|
143
|
+
### Generate IG resource separately
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
simplifier-ig ig-resource --path ./output/my-ig --input ./my-ig
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Configuration
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
simplifier-ig config # Show current configuration
|
|
153
|
+
simplifier-ig clear # Clear saved configuration
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Input folder structure
|
|
157
|
+
|
|
158
|
+
After running `init`, the input folder will have this structure:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
my-ig/
|
|
162
|
+
├── guide.yaml # IG configuration (title, url-key, menu, etc.)
|
|
163
|
+
├── variables.yaml # Template variables
|
|
164
|
+
├── resources/ # FHIR conformance resources (.json)
|
|
165
|
+
├── examples/ # FHIR example resources (.json)
|
|
166
|
+
├── pages/ # Markdown documentation pages
|
|
167
|
+
├── images/ # (optional) Images
|
|
168
|
+
├── pagetemplates/ # (optional) Reusable page snippets
|
|
169
|
+
├── pagetemplates-artifacts/ # Per-resource-type page templates
|
|
170
|
+
└── styles/
|
|
171
|
+
└── custom/
|
|
172
|
+
├── master.html
|
|
173
|
+
├── settings.style
|
|
174
|
+
└── style.css
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Development
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
git clone https://github.com/ArdonToonstra/simplifier-ig.git
|
|
181
|
+
cd simplifier-ig
|
|
182
|
+
pip install -e .
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
You can also run the tool as a module:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
python -m simplifier_ig --help
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Building binaries
|
|
192
|
+
|
|
193
|
+
The GitHub Actions workflow builds standalone binaries for Linux, macOS, and Windows using PyInstaller when a version tag is pushed (e.g., `v0.1.0`).
|
|
194
|
+
|
|
195
|
+
**To build binaries for a release:**
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
git tag v0.1.0
|
|
199
|
+
git push origin v0.1.0
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
This triggers the **Build Binaries** workflow which creates three artifacts:
|
|
203
|
+
- `simplifier-ig-linux` (Ubuntu)
|
|
204
|
+
- `simplifier-ig-macos` (macOS)
|
|
205
|
+
- `simplifier-ig-windows` (Windows .exe)
|
|
206
|
+
|
|
207
|
+
Artifacts are available in the **Actions** tab → **Build Binaries** workflow for 90 days. To attach binaries permanently to GitHub Releases, either:
|
|
208
|
+
- Download artifacts and manually attach to the release, or
|
|
209
|
+
- Extend the workflow to automatically create a GitHub Release with attached binaries
|
|
210
|
+
|
|
211
|
+
### Publishing to PyPI
|
|
212
|
+
|
|
213
|
+
Tag a release to trigger the publish workflow:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
git tag v0.1.0
|
|
217
|
+
git push origin v0.1.0
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
This triggers the **Publish to PyPI** workflow, which uses OpenID Connect (Trusted Publisher) — no API token or secret is required.
|
|
221
|
+
|
|
222
|
+
## Dependencies
|
|
223
|
+
|
|
224
|
+
- Python >= 3.9
|
|
225
|
+
- [PyYAML](https://pypi.org/project/PyYAML/)
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
MIT
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "simplifier-ig"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "CLI tool for generating Simplifier.net supported Implementation Guide structures from an IG publisher like input folder"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
dependencies = ["pyyaml"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Ardon Toonstra" }
|
|
15
|
+
]
|
|
16
|
+
keywords = ["fhir", "simplifier", "implementation-guide", "hl7", "cli"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 3 - Alpha",
|
|
19
|
+
"Intended Audience :: Healthcare Industry",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Topic :: Software Development :: Code Generators",
|
|
27
|
+
"Environment :: Console",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Repository = "https://github.com/ArdonToonstra/simplifier-ig"
|
|
32
|
+
"Bug Tracker" = "https://github.com/ArdonToonstra/simplifier-ig/issues"
|
|
33
|
+
|
|
34
|
+
[project.scripts]
|
|
35
|
+
simplifier-ig = "simplifier_ig.cli:main"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.packages.find]
|
|
38
|
+
include = ["simplifier_ig*"]
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.package-data]
|
|
41
|
+
simplifier_ig = ["templates/**/*", "templates/.*"]
|