|
| 1 | +# WellData FHIR Implementation Guide |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +This is a FHIR R4 Implementation Guide for the WellData project, which enables personal health data storage in Solid pods with FHIR-based access. |
| 6 | + |
| 7 | +## Technology Stack |
| 8 | + |
| 9 | +- **FHIR Shorthand (FSH)**: Profiles and examples defined in `input/fsh/` |
| 10 | +- **SUSHI**: FSH compiler |
| 11 | +- **HL7 FHIR IG Publisher**: Generates the full Implementation Guide |
| 12 | +- **Docker**: Build environment |
| 13 | + |
| 14 | +## Project Structure |
| 15 | + |
| 16 | +``` |
| 17 | +├── input/ |
| 18 | +│ ├── fsh/ |
| 19 | +│ │ ├── profiles/ # FHIR profile definitions (FSH) |
| 20 | +│ │ └── instances/ # Example instances (FSH) |
| 21 | +│ ├── pagecontent/ # Markdown documentation pages |
| 22 | +│ └── images-source/ # PlantUML diagrams |
| 23 | +├── sushi-config.yaml # SUSHI/IG configuration |
| 24 | +├── ig.ini # IG Publisher configuration |
| 25 | +├── Makefile # Build targets |
| 26 | +├── Dockerfile # Build environment |
| 27 | +└── docker-entrypoint.sh # Docker entry point |
| 28 | +``` |
| 29 | + |
| 30 | +## Build Commands |
| 31 | + |
| 32 | +All builds use Docker. First build the image: |
| 33 | + |
| 34 | +```shell |
| 35 | +docker build . -t gidsopenstandaarden-welldata-ig |
| 36 | +``` |
| 37 | + |
| 38 | +Then run targets: |
| 39 | + |
| 40 | +```shell |
| 41 | +# Full IG build (generates HTML, JSON, TTL) |
| 42 | +docker run --rm -v "${PWD}:/src" gidsopenstandaarden-welldata-ig build |
| 43 | + |
| 44 | +# SUSHI only (quick FSH validation) |
| 45 | +docker run --rm -v "${PWD}:/src" gidsopenstandaarden-welldata-ig sushi |
| 46 | + |
| 47 | +# Show available targets |
| 48 | +docker run --rm -v "${PWD}:/src" gidsopenstandaarden-welldata-ig help |
| 49 | +``` |
| 50 | + |
| 51 | +## Key Configuration |
| 52 | + |
| 53 | +In `sushi-config.yaml`: |
| 54 | +- `FSHOnly: false` - Generate full IG structure |
| 55 | +- `excludettl: false` - Generate TTL (RDF) output |
| 56 | +- `excludexml: true` - Skip XML output |
| 57 | + |
| 58 | +## FHIR Profiles |
| 59 | + |
| 60 | +| Profile | File | Description | |
| 61 | +|---------|------|-------------| |
| 62 | +| WellDataPatient | `profiles/WellDataPatient.fsh` | Patient demographic data | |
| 63 | +| WellDataObservation | `profiles/WellDataObservation.fsh` | Health observations (vitals, lab results, surveys) | |
| 64 | +| WellDataQuestionnaire | `profiles/WellDataQuestionnaire.fsh` | Questionnaire definitions | |
| 65 | +| WellDataQuestionnaireResponse | `profiles/WellDataQuestionnaireResponse.fsh` | Questionnaire answers | |
| 66 | + |
| 67 | +## Adding Examples |
| 68 | + |
| 69 | +Add FSH instances in `input/fsh/instances/`. Example: |
| 70 | + |
| 71 | +```fsh |
| 72 | +Instance: example-new-observation |
| 73 | +InstanceOf: WellDataObservation |
| 74 | +Title: "New Observation Example" |
| 75 | +* status = #final |
| 76 | +* code.coding.system = "http://snomed.info/sct" |
| 77 | +* code.coding.code = #12345678 |
| 78 | +* subject.reference = "Patient/example-welldata-patient" |
| 79 | +* effectiveDateTime = "2025-06-10T09:00:00+02:00" |
| 80 | +* valueQuantity.value = 100 |
| 81 | +* valueQuantity.unit = "mg/dL" |
| 82 | +``` |
| 83 | + |
| 84 | +## Adding Documentation Pages |
| 85 | + |
| 86 | +1. Create markdown file in `input/pagecontent/` |
| 87 | +2. Add to `pages:` section in `sushi-config.yaml` |
| 88 | +3. Add to `menu:` section in `sushi-config.yaml` |
| 89 | + |
| 90 | +## PlantUML Diagrams |
| 91 | + |
| 92 | +Place `.plantuml` files in `input/images-source/`. Reference in markdown: |
| 93 | + |
| 94 | +```markdown |
| 95 | +{::nomarkdown} |
| 96 | +{% include diagram-name.svg %} |
| 97 | +{:/} |
| 98 | +``` |
| 99 | + |
| 100 | +## Output |
| 101 | + |
| 102 | +After `make build`, output is in `output/`: |
| 103 | +- `*.html` - Documentation pages |
| 104 | +- `*.json` - FHIR resources as JSON |
| 105 | +- `*.ttl` - FHIR resources as RDF/Turtle |
| 106 | +- `package.tgz` - FHIR package for distribution |
| 107 | + |
| 108 | +## Git Conventions |
| 109 | + |
| 110 | +- Do not commit `output/`, `fsh-generated/`, `temp/`, `input-cache/` |
| 111 | +- Use `git rm -f` for deletions, `git mv` for moves |
| 112 | +- Add new files to git immediately |
0 commit comments