Skip to content

Commit a914366

Browse files
authored
Merge pull request #39 from Ardenexal/feat/demo-site
Feat/demo site
2 parents 88c6e2e + 18a4abd commit a914366

2,016 files changed

Lines changed: 247127 additions & 4249 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,11 @@
114114
"emmet.includeLanguages": {
115115
"php": "html"
116116
},
117-
"php.suggest.basic": false
117+
"php.suggest.basic": false,
118+
"chat.tools.terminal.autoApprove": {
119+
"composer": true,
120+
"FHIRBundleServiceRegistrationTest": true,
121+
"VersionRangeValidityTest": true,
122+
"CodeGenerationTestCoverageTest": true
123+
}
118124
}

CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ composer test
4343
composer test-unit
4444
composer test-integration
4545
composer test-fhir
46+
composer test-fhirpath-spec # FHIRPath specification conformance tests
4647

4748
# Component-specific tests
4849
composer test:bundle
@@ -81,6 +82,15 @@ composer quality:all # lint + phpstan + test
8182
- Test fixtures in `tests/Fixtures/`
8283
- Integration tests verify FHIR conformance and serialization round-trips
8384

85+
### FHIRPath Specification Tests
86+
87+
The FHIRPath component includes official specification conformance tests in a separate test suite (`fhirpath-spec`). These tests validate implementation against the official FHIR FHIRPath test cases and are currently in development as the evaluator implementation is being completed.
88+
89+
- Run with: `composer test-fhirpath-spec`
90+
- Located in: `src/Component/FHIRPath/tests/Integration/`
91+
- These tests are excluded from the main integration suite to allow focused development
92+
- Track progress toward full FHIRPath 2.0 specification compliance
93+
8494
## FHIR Model Generation
8595

8696
The `fhir:generate` command generates PHP classes from FHIR packages:

composer.json

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"license": "MIT",
66
"minimum-stability": "stable",
77
"prefer-stable": true,
8+
"repositories": [
9+
{
10+
"type": "package",
11+
"package": {
12+
"name": "fhir/fhir-test-cases",
13+
"version": "1.7.49",
14+
"dist": {
15+
"url": "https://github.com/FHIR/fhir-test-cases/archive/refs/tags/1.7.49.zip",
16+
"type": "zip"
17+
}
18+
}
19+
}
20+
],
821
"require": {
922
"php": ">=8.3",
1023
"ext-ctype": "*",
@@ -13,9 +26,14 @@
1326
"amphp/http-client": "^5.3.4",
1427
"composer/semver": "^3.4.4",
1528
"nette/php-generator": "^4.2.1",
29+
"psr/http-client": "^1.0",
30+
"symfony/config": "^6.4|^7.4",
1631
"symfony/console": "^6.4|^7.4",
32+
"symfony/dependency-injection": "^6.4|^7.4",
1733
"symfony/filesystem": "^6.4|^7.4",
34+
"symfony/finder": "^6.4|^7.4",
1835
"symfony/http-client": "^6.4|^7.4",
36+
"symfony/http-kernel": "^6.4|^7.4",
1937
"symfony/intl": "^6.4|^7.4",
2038
"symfony/polyfill-php84": "^v1.33.0",
2139
"symfony/polyfill-php85": "^v1.33.0",
@@ -26,15 +44,17 @@
2644
"symfony/yaml": "^6.4|^7.4"
2745
},
2846
"require-dev": {
47+
"fhir/fhir-test-cases": "1.7.49",
2948
"giorgiosironi/eris": "^1.0",
3049
"laravel/pint": "^1.27.1",
3150
"phpstan/phpstan": "^2.1.39",
32-
"phpunit/phpunit": "^11.0|^12.5.11",
51+
"phpstan/phpstan-symfony": "^2.0.14",
52+
"phpunit/phpunit": "^11.0|^12.5.14",
3353
"roave/security-advisories": "dev-latest",
34-
"symfony/browser-kit": "^6.4|^7.4",
54+
"symfony/browser-kit": "^6.4|^7.4.4",
3555
"symfony/css-selector": "^6.4|^7.4",
36-
"symfony/dom-crawler": "^6.4|^7.4",
37-
"symfony/phpunit-bridge": "^6.4|^7.4"
56+
"symfony/dom-crawler": "^6.4|^7.4.4",
57+
"symfony/phpunit-bridge": "^6.4|^7.4.3"
3858
},
3959
"config": {
4060
"allow-plugins": {
@@ -55,7 +75,8 @@
5575
"autoload-dev": {
5676
"psr-4": {
5777
"Ardenexal\\FHIRTools\\Tests\\": "tests/",
58-
"Ardenexal\\FHIRTools\\Component\\FHIRPath\\Tests\\": "src/Component/FHIRPath/tests/"
78+
"Ardenexal\\FHIRTools\\Component\\FHIRPath\\Tests\\": "src/Component/FHIRPath/tests/",
79+
"Ardenexal\\FHIRTools\\Component\\Serialization\\Tests\\": "src/Component/Serialization/tests/"
5980
}
6081
},
6182
"replace": {
@@ -84,6 +105,7 @@
84105
"test-unit": "php ./vendor/phpunit/phpunit/phpunit --testsuite=unit",
85106
"test-integration": "php ./vendor/phpunit/phpunit/phpunit --testsuite=integration",
86107
"test-fhir": "php ./vendor/phpunit/phpunit/phpunit --testsuite=fhir",
108+
"test-fhirpath-spec": "php ./vendor/phpunit/phpunit/phpunit --testsuite=fhirpath-spec",
87109
"test:bundle": "php ./vendor/phpunit/phpunit/phpunit tests/Unit/Bundle/ --no-coverage",
88110
"test:codegen": "php ./vendor/phpunit/phpunit/phpunit tests/Unit/Component/CodeGeneration/ --no-coverage",
89111
"test:serialization": "php ./vendor/phpunit/phpunit/phpunit tests/Unit/Component/Serialization/ --no-coverage",
@@ -124,9 +146,18 @@
124146
"@quality:serialization",
125147
"@quality:fhir-path"
126148
],
149+
"generate-models": "php ./demo/bin/console fhir:generate -vvv",
150+
"generate-models-all": [
151+
"echo 'Generating FHIR R4 models...'",
152+
"php ./demo/bin/console fhir:generate --package=hl7.fhir.r4.core --package=hl7.fhir.r4b.core --package=hl7.fhir.r5.core -vvv",
153+
"echo 'All FHIR models generated successfully!'"
154+
],
155+
"generate-models-r4": "php ./demo/bin/console fhir:generate --package=hl7.fhir.r4.core -vvv",
156+
"generate-models-r4b": "php ./demo/bin/console fhir:generate --package=hl7.fhir.r4b.core -vvv",
157+
"generate-models-r5": "php ./demo/bin/console fhir:generate --package=hl7.fhir.r5.core -vvv",
127158
"fix-newlines": "powershell -ExecutionPolicy Bypass -File scripts/fix-newlines.ps1",
128159
"validate-recipe": "php scripts/validate-recipe.php",
129160
"test-recipe": "php ./vendor/phpunit/phpunit/phpunit tests/Integration/FlexRecipeTest.php",
130161
"test-package-installation": "php scripts/test-package-installation.php"
131162
}
132-
}
163+
}

demo/.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[{compose.yaml,compose.*.yaml}]
14+
indent_size = 2
15+
16+
[*.md]
17+
trim_trailing_whitespace = false

demo/.env

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
# https://symfony.com/doc/current/configuration/secrets.html
13+
#
14+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16+
17+
###> symfony/framework-bundle ###
118
APP_ENV=dev
2-
APP_SECRET=demo-secret-not-for-production
19+
APP_SECRET=
20+
APP_SHARE_DIR=var/share
21+
###< symfony/framework-bundle ###
22+
23+
###> symfony/routing ###
24+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
25+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
26+
DEFAULT_URI=http://localhost
27+
###< symfony/routing ###

demo/.env.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
###> symfony/framework-bundle ###
3+
APP_SECRET=54e8764c36be4f03708e1b068d4d3141
4+
###< symfony/framework-bundle ###

demo/.env.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'

demo/.gitignore

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
/vendor/
1+
2+
###> symfony/framework-bundle ###
3+
/.env.local
4+
/.env.local.php
5+
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
7+
/public/bundles/
28
/var/
3-
.env.local
4-
.env.*.local
9+
/vendor/
10+
###< symfony/framework-bundle ###
11+
12+
###> phpunit/phpunit ###
13+
/phpunit.xml
14+
/.phpunit.cache/
15+
###< phpunit/phpunit ###
16+
17+
###> symfony/asset-mapper ###
18+
/public/assets/
19+
/assets/vendor/
20+
###< symfony/asset-mapper ###

demo/CLAUDE.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# demo/CLAUDE.md
2+
3+
This file documents conventions for the demo Symfony 7.4 application.
4+
5+
## Stack
6+
7+
- **Framework**: Symfony 7.4 with `MicroKernelTrait`
8+
- **Templates**: Twig (`*.html.twig`) in `templates/`
9+
- **CSS**: Tailwind CSS via Play CDN (`<script src="https://cdn.tailwindcss.com">` in `base.html.twig`)
10+
- **JS**: Stimulus controllers in `assets/controllers/`, Turbo for partial page updates
11+
- **Routes**: PHP 8 `#[Route]` attributes on controllers (auto-discovered via `config/routes.yaml`)
12+
- **Services**: Autowired via `config/services.yaml`; FHIR services injected by type hint (registered by FHIRBundle)
13+
14+
## Controllers
15+
16+
Located in `src/Controller/`. Use `#[Route]` attribute for routing. Extend `AbstractController`.
17+
18+
## FHIR Services (via FHIRBundle)
19+
20+
Inject by type hint — all autowired:
21+
22+
- `Ardenexal\FHIRTools\Component\FHIRPath\Service\FHIRPathService` — evaluate/validate FHIRPath expressions
23+
- `Ardenexal\FHIRTools\Component\Serialization\FHIRSerializationService` — serialize/deserialize FHIR JSON/XML
24+
- `Ardenexal\FHIRTools\Component\Serialization\Validator\FHIRValidator` — validate FHIR objects
25+
- `Ardenexal\FHIRTools\Component\Serialization\Metadata\FHIRMetadataExtractorInterface` — extract resource metadata
26+
27+
## FHIR Config
28+
29+
`config/packages/fhir.yaml` — configures default version, output/cache directories, validation, and FHIRPath cache.
30+
31+
## Useful Commands
32+
33+
```bash
34+
# From the demo/ directory:
35+
symfony local:server:start # Start local dev server (http://localhost:8000)
36+
php bin/console debug:router # Inspect registered routes
37+
php bin/console debug:container # Inspect services
38+
php bin/console cache:clear # Clear cache
39+
```
40+
41+
## Testing
42+
43+
Start the local server with `symfony local:server:start` from the `demo/` directory, then use the
44+
`webapp-testing` skill to interact with `http://localhost:8000`.

demo/assets/app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import './stimulus_bootstrap.js';
2+
/*
3+
* Welcome to your app's main JavaScript file!
4+
*
5+
* This file will be included onto the page via the importmap() Twig function,
6+
* which should already be in your base.html.twig.
7+
*/
8+
import './styles/app.css';
9+
10+
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');

0 commit comments

Comments
 (0)