Skip to content

Commit 6077ecb

Browse files
committed
docs: refine descriptions and address inaccuracies across multiple guides
1 parent ed45bdd commit 6077ecb

25 files changed

Lines changed: 116 additions & 74 deletions

docs/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ icon: book-medical
66
# Introduction
77

88
PHP FHIR Tools is a PHP 8.3+ library monorepo for working with
9-
[FHIR](https://www.hl7.org/fhir/) (Fast Healthcare Interoperability Resources). It generates PHP
10-
model classes from FHIR Structure Definitions, serializes resources to and from JSON and XML,
11-
validates resources against the specification and Implementation Guides, and evaluates FHIRPath 2.0
12-
expressions.
9+
[FHIR](https://www.hl7.org/fhir/) (Fast Healthcare Interoperability Resources). FHIR is the HL7
10+
standard for exchanging healthcare data as structured resources such as `Patient`, `Observation`,
11+
and `Questionnaire`. This toolkit generates PHP model classes from FHIR Structure Definitions,
12+
serializes resources to and from JSON and XML, validates resources against the specification and
13+
Implementation Guides, and evaluates FHIRPath 2.0 expressions.
1314

1415
{% hint style="info" %}
1516
The packages can be used independently or together. If you only need serialization, install

docs/SUMMARY.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* [Overview](serialization/overview.md)
2727
* [JSON Serialization](serialization/json.md)
2828
* [XML Serialization](serialization/xml.md)
29-
* [Serialization Context & Options](serialization/context.md)
30-
* [IG-Aware Serialization](serialization/ig-aware.md)
29+
* [Configuring Serialization Behavior](serialization/context.md)
30+
* [Serializing IG Extensions & Profiles](serialization/ig-aware.md)
3131

3232
## Validation
3333

@@ -61,9 +61,9 @@
6161

6262
## Symfony Bundle
6363

64-
* [Installation & Configuration](bundle/configuration.md)
65-
* [Services & Dependency Injection](bundle/services.md)
66-
* [Console Commands](bundle/console-commands.md)
64+
* [Install and Configure the Bundle](bundle/configuration.md)
65+
* [Inject and Use FHIR Services](bundle/services.md)
66+
* [Run the Console Commands](bundle/console-commands.md)
6767
* [Flex Recipe](bundle/flex-recipe.md)
6868

6969
## Reference

docs/bundle/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Install and configure the FHIR Symfony bundle.
33
icon: gear
44
---
55

6-
# Installation & Configuration
6+
# Install and configure the bundle
77

88
The bundle (`Ardenexal\FHIRTools\Bundle\FHIRBundle\FHIRBundle`) registers all FHIR Tools services
99
automatically in a Symfony application: serialization, validation, code generation, and FHIRPath.
@@ -57,6 +57,7 @@ fhir:
5757
cache_directory: '%kernel.cache_dir%/fhir'
5858

5959
# Default FHIR version: R4, R4B, or R5
60+
# (the Flex recipe overrides this to R4B via the FHIR_DEFAULT_VERSION env var)
6061
default_version: 'R4'
6162

6263
validation:

docs/bundle/console-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Console commands provided by the FHIR bundle.
33
icon: terminal
44
---
55

6-
# Console Commands
6+
# Run the bundle's console commands
77

88
The bundle adds these commands to a Symfony application:
99

docs/bundle/services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Inject and use FHIR Tools services in a Symfony application.
33
icon: diagram-project
44
---
55

6-
# Services & Dependency Injection
6+
# Inject and use FHIR services
77

88
When the bundle is enabled, it registers the serialization, validation, code-generation, and
99
FHIRPath services in the Symfony container. Each public service is available both by a `fhir.*`

docs/code-generation/base-models.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ composer run generate-models-all # R4 + R4B + R5
6464
composer run generate-models # fhir:generate with default (R4) packages
6565
```
6666

67-
## Core classes
67+
## Advanced: the programmatic API
68+
69+
{% hint style="info" %}
70+
Most integrators only need the `fhir:generate` command above. This section documents the
71+
internal generator classes for people embedding code generation in their own tooling. Skip it if
72+
you are running the command.
73+
{% endhint %}
6874

6975
The command orchestrates these generators (all under
7076
`Ardenexal\FHIRTools\Component\CodeGeneration\`):

docs/code-generation/implementation-guides.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class PatientBirthPlaceExtension extends Extension
4747
}
4848
```
4949

50+
In FHIR, `value[x]` is an extension's polymorphic value element: it can hold one of several types
51+
(`valueString`, `valueAddress`, and so on). A *slice* is a named constraint that pins one entry of a
52+
repeating element to a specific shape.
53+
5054
`FHIRExtensionGenerator` detects simple vs. complex extensions automatically: simple extensions
5155
narrow the `value[x]` type to a concrete PHP type, complex extensions map sub-extension slices to
5256
typed properties.

docs/code-generation/overview.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ icon: gears
66
# Overview
77

88
The Code Generation component loads FHIR packages from the registry and generates strongly-typed PHP
9-
classes — Resources, DataTypes, Primitives, and Enums — from their Structure Definitions and
10-
ValueSets. It is the engine behind the [`fhir:generate`](base-models.md) and
11-
[`fhir:generate-ig`](implementation-guides.md) console commands.
9+
classes from their definitions. A `StructureDefinition` is FHIR's machine-readable description of a
10+
resource or data type, and a `ValueSet` is a named set of permitted codes. The generator turns them
11+
into Resources, DataTypes, Primitives, and Enums. It is the engine behind the
12+
[`fhir:generate`](base-models.md) and [`fhir:generate-ig`](implementation-guides.md) console
13+
commands.
1214

1315
Namespace: `Ardenexal\FHIRTools\Component\CodeGeneration\`.
1416

docs/fhirpath/expressions.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ membership, and type operators.
2626
| **Type** | `is`, `as` | Type testing and casting |
2727

2828
{% hint style="info" %}
29-
Equivalence (`~` / `!~`) is implemented: it is recognised by the lexer, parsed as a binary
30-
operator, and dispatched in the evaluator to the comparison service. (Earlier drafts described
31-
it as unimplemented — that is no longer accurate.)
29+
`~` tests equivalence and `!~` its negation. Equivalence differs from `=` by ignoring collection
30+
order and, for strings, case and whitespace.
3231
{% endhint %}
3332

3433
### Examples
@@ -67,10 +66,9 @@ The parser and evaluator support the core FHIRPath 2.0 syntax:
6766

6867
### Type system
6968

70-
Types are resolved through `FHIRTypeResolver` and exposed as `TypeInfo`. The `is` operator tests
71-
whether an item conforms to a named type; `as` filters the collection to items of that type.
72-
Temporal values use dedicated types (`FHIRPathDate`, `FHIRPathDateTime`, `FHIRPathTime`) and
73-
decimals use `FHIRPathDecimal` to preserve precision.
69+
The `is` operator tests whether an item conforms to a named type, and `as` filters the collection
70+
to items of that type. Temporal values use dedicated types (`FHIRPathDate`, `FHIRPathDateTime`,
71+
`FHIRPathTime`), and decimals use `FHIRPathDecimal` to preserve precision.
7472

7573
See the [Function Reference](functions/README.md) for the full library of built-in functions,
7674
including type-conversion helpers such as `toInteger()`, `toQuantity()`, and `ofType()`.

docs/fhirpath/functions/math.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,17 @@ Math functions operate on numeric values. Single-value functions (`abs()`,
2525
| `min()` | Smallest item in the collection. | `(3 \| 1 \| 2).min()``1` |
2626
| `max()` | Largest item in the collection. | `(3 \| 1 \| 2).max()``3` |
2727
| `avg()` | Arithmetic mean of the collection. | `(2 \| 4 \| 6).avg()``4` |
28+
29+
## Precision & boundaries
30+
31+
These three functions report or derive the precision of a value. They accept a
32+
decimal, integer, date, dateTime, or time, using FHIRPath positional precision
33+
numbers (e.g. `YYYY`=4, `YYYY-MM`=6, `YYYY-MM-DD`=8 for dates; digits after the
34+
decimal point for numbers). `lowBoundary()` and `highBoundary()` take an optional
35+
output-precision argument.
36+
37+
| Function | Description | Example |
38+
|----------|-------------|---------|
39+
| `precision()` | Number of significant positions in the input. Trailing zeros on a decimal are preserved. | `(1.58700).precision()``5` |
40+
| `lowBoundary([precision])` | Lowest value in the natural range the input represents. For numbers, `value - 0.5×10^-precision`; for dates/times, fills unspecified components with their minimum. | `(1.587).lowBoundary()``1.5865...` |
41+
| `highBoundary([precision])` | Highest value in the natural range the input represents. For numbers, `value + 0.5×10^-precision`; for dates/times, fills unspecified components with their maximum. | `(1.587).highBoundary()``1.5875...` |

0 commit comments

Comments
 (0)