# hapifhir/fhir-tutorial architecture

> Architecture diagram of the GitHub repository hapifhir/fhir-tutorial, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hapifhir/fhir-tutorial
- Repository: https://github.com/hapifhir/fhir-tutorial

## Overview

##### Project type and purpose
- This is not a traditional code-heavy application but an open-collaborative training package: a static documentation/tutorial site for FHIR (Fast Healthcare Interoperability Resources).
- The README calls it a “FHIR Tutorial” comprising individual lessons (CRUD, FHIRPath, Profiling, etc.), images, and example payloads.

##### File structure
- Top-level directories correspond to lesson modules:
- CRUD operations
- FHIRPath
- Profiling
- SearchParameter
- Search_References_ChainHasIncludeRevinclude
- Terminology/CodeSystem_and_ValueSet
- Transactions
- examples (contains JSON test-data)
- Each lesson folder has:
- lesson.md (Markdown content)
- img or images subfolder (assets)
- No source code or server components—pure content repository.

##### README insights
- The focus is on training materials; there is no built-in application code or API server here.
- Licensed under Creative Commons, hosted in Git.

a. Main components to represent:
1. Content Modules – each lesson folder (CRUD, FHIRPath, …)
2. Media Assets – images directories under each module
3. Examples – test-data JSON files
4. Documentation Processing Pipeline – static site generator (e.g., Jekyll, MkDocs) or GitHub Pages renderer
5. CI/CD – GitHub Actions or other build workflows (linting Markdown, deploying site)
6. Hosting & Delivery – GitHub Pages or CDN, served to end-users (browsers)
7. External References – Smile CDR, Creative Commons License badge
b. Relationships & interactions:
– From Pipeline to Hosting/CDN.
– From Hosting to End Users (Browsers).
– CI/CD connected to Git repository and Pipeline.
c. Architectural patterns/design principles:
– Modular content architecture: each lesson is self-contained.
– Static site generation: content-as-code.
– Continuous deployment: automatic publish on commit to main branch.
d. Relevant technologies/frameworks:
– Markdown (.md)
– Static Site Generator (Jekyll, Hugo, MkDocs—choose one or note “to be decided”)
– Git & GitHub (version control, hosting)
– GitHub Actions (CI/CD pipeline)
– CDN/GitHub Pages (hosting)

##### Additional notes
- Don’t overcomplicate—reflect the straightforward, modular, static nature of the site.
- Viewer can trace from raw markdown files all the way to the rendered tutorial in a browser.
- Where to insert new modules or how to extend the pipeline for new lessons.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Content Modules"
        subgraph "CRUD Module" 
            CRUD_Lesson["lesson.md"]:::content
            CRUD_Images["img/"]:::content
        end
        subgraph "FHIRPath Module"
            FHIRPath_Lesson["lesson.md"]:::content
        end
        subgraph "Profiling Module"
            Profiling_Lesson["lesson.md"]:::content
            Profiling_Images["images/"]:::content
            Profiling_Examples["profile_examples/"]:::content
        end
        subgraph "SearchParameter Module"
            SP_Lesson["lesson.md"]:::content
            SP_Images["images/"]:::content
        end
        subgraph "Search References/ChainHasIncludeRevinclude Module"
            SRC_Lesson["lesson.md"]:::content
            SRC_Images["images/"]:::content
        end
        subgraph "Terminology Module"
            Term_Lesson["lesson.md"]:::content
            Term_Images["img/"]:::content
        end
        subgraph "Transactions Module"
            Trans_Lesson["lesson.md"]:::content
            Trans_Images["img/"]:::content
        end
        subgraph "Examples"
            Examples_JSON["examples/"]:::content
            Examples_Sub["examples/Search_References_ChainHasIncludeRevinclude/"]:::content
        end
        README["README.md"]:::content
        Gitignore[".gitignore"]:::content
    end

    subgraph "CI/CD Pipeline"
        GitHubActions["GitHub Actions"]:::pipeline
    end

    DocumentationProcessor["Documentation Processor (SSG)"]:::pipeline
    Hosting["GitHub Pages / CDN"]:::hosting
    Browser["Learner Browser"]:::external
    ExternalRef["Smile CDR & CC License"]:::external
    GitHubRepo["GitHub Repository"]:::external

    %% Connections
    GitHubRepo -->|"push"| GitHubActions
    GitHubActions -->|"build"| DocumentationProcessor
    CRUD_Lesson -->|"input"| DocumentationProcessor
    CRUD_Images -->|"assets"| DocumentationProcessor
    FHIRPath_Lesson -->|"input"| DocumentationProcessor
    Profiling_Lesson -->|"input"| DocumentationProcessor
    Profiling_Images -->|"assets"| DocumentationProcessor
    Profiling_Examples -->|"assets"| DocumentationProcessor
    SP_Lesson -->|"input"| DocumentationProcessor
    SP_Images -->|"assets"| DocumentationProcessor
    SRC_Lesson -->|"input"| DocumentationProcessor
    SRC_Images -->|"assets"| DocumentationProcessor
    Term_Lesson -->|"input"| DocumentationProcessor
    Term_Images -->|"assets"| DocumentationProcessor
    Trans_Lesson -->|"input"| DocumentationProcessor
    Trans_Images -->|"assets"| DocumentationProcessor
    Examples_JSON -->|"input"| DocumentationProcessor
    Examples_Sub -->|"input"| DocumentationProcessor
    README -->|"docs info"| DocumentationProcessor
    Gitignore -->|"config"| DocumentationProcessor

    DocumentationProcessor -->|"deploy"| Hosting
    Hosting -->|"serve"| Browser
    ExternalRef -.->|"reference"| DocumentationProcessor

    %% Click Events
    click CRUD_Lesson "https://github.com/hapifhir/fhir-tutorial/blob/master/CRUD operations/lesson.md"
    click CRUD_Images "https://github.com/hapifhir/fhir-tutorial/tree/master/CRUD operations/img/"
    click FHIRPath_Lesson "https://github.com/hapifhir/fhir-tutorial/blob/master/FHIRPath/lesson.md"
    click Profiling_Lesson "https://github.com/hapifhir/fhir-tutorial/blob/master/Profiling/lesson.md"
    click Profiling_Images "https://github.com/hapifhir/fhir-tutorial/tree/master/Profiling/images/"
    click Profiling_Examples "https://github.com/hapifhir/fhir-tutorial/tree/master/Profiling/profile_examples/"
    click SP_Lesson "https://github.com/hapifhir/fhir-tutorial/blob/master/SearchParameter/lesson.md"
    click SP_Images "https://github.com/hapifhir/fhir-tutorial/tree/master/SearchParameter/images/"
    click SRC_Lesson "https://github.com/hapifhir/fhir-tutorial/blob/master/Search_References_ChainHasIncludeRevinclude/lesson.md"
    click SRC_Images "https://github.com/hapifhir/fhir-tutorial/tree/master/Search_References_ChainHasIncludeRevinclude/images/"
    click Term_Lesson "https://github.com/hapifhir/fhir-tutorial/blob/master/Terminology/CodeSystem_and_ValueSet/lesson.md"
    click Term_Images "https://github.com/hapifhir/fhir-tutorial/tree/master/Terminology/CodeSystem_and_ValueSet/img/"
    click Trans_Lesson "https://github.com/hapifhir/fhir-tutorial/blob/master/Transactions/lesson.md"
    click Trans_Images "https://github.com/hapifhir/fhir-tutorial/tree/master/Transactions/img/"
    click Examples_JSON "https://github.com/hapifhir/fhir-tutorial/tree/master/examples/"
    click Examples_Sub "https://github.com/hapifhir/fhir-tutorial/tree/master/examples/Search_References_ChainHasIncludeRevinclude/"
    click README "https://github.com/hapifhir/fhir-tutorial/blob/master/README.md"
    click Gitignore "https://github.com/hapifhir/fhir-tutorial/blob/master/.gitignore"

    %% Styles
    classDef content fill:#CFFFB3,stroke:#2E8B57,stroke-width:1px
    classDef pipeline fill:#B3E5FC,stroke:#0288D1,stroke-width:1px
    classDef hosting fill:#FFE082,stroke:#FFA000,stroke-width:1px
    classDef external fill:#F8BBD0,stroke:#C2185B,stroke-width:1px
```
