Skip to content
Merged

v9.1.0 #2520

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
bbbf1ac
feature: Initial implementation of conversion functions with DSL tests.
piotrszul Oct 17, 2025
dc0148c
refactor: streamline conversion logic for STRING, INTEGER, and DECIMA…
piotrszul Oct 17, 2025
3e703f4
fix: enforce singularity constraints for array inputs in conversion f…
piotrszul Oct 20, 2025
6803a24
dev: Adding guidelines for commit messages, and tips for ClaudeCode o…
piotrszul Oct 20, 2025
7eb6087
test: add empty value test coverage for conversion functions
piotrszul Oct 20, 2025
04c0b4d
refactor: resolve code quality warnings in conversion functions
piotrszul Oct 20, 2025
32b0bf5
refactor: simplify conversion logic and strengthen type safety
piotrszul Oct 20, 2025
f7a2351
refactor: implement registry pattern for conversion function dispatch
piotrszul Oct 20, 2025
c1d31e3
feat: implement toQuantity() and convertsToQuantity() conversion func…
piotrszul Oct 21, 2025
74359ea
refactor: add NOTHING type for explicit empty/unknown type handling
piotrszul Oct 21, 2025
61b7ef2
refactor: use FhirpathQuantity consistently in QuantityEncoding
piotrszul Oct 21, 2025
9570ac6
improve: use toPlainString and stripTrailingZeros for cleaner decimal…
piotrszul Oct 21, 2025
b25af4b
docs: add FHIRPath implementation guide and test exclusion policy
piotrszul Oct 21, 2025
352c6da
feat: implement optional unit parameter for toQuantity() and converts…
piotrszul Oct 22, 2025
2348fd4
refactor: centralize Quantity column operations in QuantityValue class
piotrszul Oct 22, 2025
bbc6420
Merge branch 'release/9.0.0' into issue/2391
piotrszul Oct 27, 2025
c6ac4cd
fix: Post-merge fixes: replace cast with try_cast conversions for com…
piotrszul Oct 27, 2025
980f51b
Merge branch 'release/9.0.0' into issue/2391
piotrszul Oct 27, 2025
88e30f4
feat: Implement full UCUM unit conversion for toQuantity(unit) and co…
piotrszul Oct 28, 2025
45aa0ab
refactor: Update unit terminology to use 'unitCode' for consistency a…
piotrszul Oct 29, 2025
54612e6
feat: Introduce CalendarDurationUnit and FhirPathUnit for handling FH…
piotrszul Oct 31, 2025
6b98bd0
feat: Enhance conversion functions to support customizable precision …
piotrszul Oct 31, 2025
bc4ce67
feat: Implement full UCUM to calendar duration conversions and enhanc…
piotrszul Oct 31, 2025
e25e79c
Merge branch 'main' into issue/2391
piotrszul Oct 31, 2025
277f21f
fix: Correct spelling of 'FhirpathQuantity' to 'FhirPathQuantity' in …
piotrszul Nov 1, 2025
a9096b5
refactoring: Add millisecond conversion factors to CalendarDurationUn…
piotrszul Nov 3, 2025
5c70727
refactor: Update FhirPathQuantity and CalendarDurationUnit for improv…
piotrszul Nov 3, 2025
0f25684
refactor: Update comments and documentation for clarity on unit conve…
piotrszul Nov 3, 2025
60d3ecb
cleanup: adding missing annotations and modifiers in functions signat…
piotrszul Nov 4, 2025
12b1dca
feat: Implement repeat directive for recursive traversal of nested st…
piotrszul Nov 4, 2025
a368fcc
Merge branch 'main' into issue/2391
johngrimes Nov 5, 2025
846413f
feat: Add maxNestingLevel to ProjectionContext and SchemaUtils for im…
piotrszul Nov 5, 2025
5d1bb52
feat: Add maxNestingLevel to ProjectionContext and SchemaUtils for im…
piotrszul Nov 5, 2025
a27c9f4
refactor: Add final keywords and fix authorship on ConversionFunctions
johngrimes Nov 5, 2025
b87bede
chore: Update pointer to SQL on FHIR spec
johngrimes Nov 5, 2025
55d4b6b
docs: Improve comments on regexes in ConversionLogic
johngrimes Nov 5, 2025
990ea25
docs: Improve comment on regex in ValidationLogic
johngrimes Nov 5, 2025
b0bd4ed
refactor: Fix typo and missing final keywords in unit classes
johngrimes Nov 5, 2025
9fc8a74
docs: Add Javadoc to CalendarDurationUnit enum values
johngrimes Nov 6, 2025
769b67b
docs: Add Javadoc and reorganise public constants in QuantityEncoding
johngrimes Nov 6, 2025
6678786
refactor: Add final keywords in FhirPathQuantity
johngrimes Nov 6, 2025
4e8a2fd
refactor: Fix formatting of test files
johngrimes Nov 6, 2025
d63045e
feat: Enhance ProjectionContext and Collection with new methods for i…
piotrszul Nov 6, 2025
b068465
refactor: Enhance FhirPathQuantity and Ucum integration with canonica…
piotrszul Nov 6, 2025
45ff9f3
fix: Delegate UCUM unit conversions to ucumate library for additive c…
piotrszul Nov 7, 2025
fc02497
refactor: Introduce ValueWithUnit record for canonical value and unit…
piotrszul Nov 10, 2025
b61986a
chore: update version to 9.1.0-SNAPSHOT in pom.xml files
piotrszul Nov 10, 2025
a46ba2e
Add Bun install to pre-release and release workflows
johngrimes Nov 10, 2025
7b1607e
refactor: Improve documentation for calendar duration units with deta…
piotrszul Nov 10, 2025
e6c69f7
Merge pull request #2514 from aehrc/issue/2391
piotrszul Nov 10, 2025
e214803
feat: Enhance transformTree method with maxDepth parameter for contro…
piotrszul Nov 11, 2025
f4db150
feat: Rename UnresolvedNullIfUnresolved to UnresolvedNullIfMissingFie…
piotrszul Nov 11, 2025
6eaedc6
feat: Refactor projection selection handling to introduce wrapInGroup…
piotrszul Nov 12, 2025
7d5a191
feat: Refactor selection interfaces to introduce UnarySelection and C…
piotrszul Nov 12, 2025
45b4d92
feat: Make repeat traversal depth configurable via QueryConfiguration
piotrszul Nov 13, 2025
34c3a6a
feat: Add QueryConfiguration support to PathlingContext with builder …
piotrszul Nov 13, 2025
e1a28d1
feat: Expose query configuration options in Python API
piotrszul Nov 13, 2025
c897e53
feat: Expose query configuration options in R API
piotrszul Nov 14, 2025
4e86655
feat: Add Configurable interface for type-safe configuration access f…
piotrszul Nov 14, 2025
56fb1c2
refactor: Change QueryConfiguration to use primitive types for consis…
piotrszul Nov 14, 2025
be03de3
Add QuestionnaireResponse test data generator and benchmark
johngrimes Nov 15, 2025
3cb47cc
feat: Add tests for EncodingConfiguration in FhirEncoders and Pathlin…
piotrszul Nov 17, 2025
cb28148
feat: Implement toExpressionTree method in ProjectionClause and add c…
piotrszul Nov 17, 2025
9922a06
test: Add unit tests for UnresolvedExpressions functionality
piotrszul Nov 18, 2025
17dc72a
fix: Fixing the bug in tracking the maximum traversal depth for self-…
piotrszul Nov 18, 2025
a63e047
chore: Fixing minor issues from Co-pilot review.
piotrszul Nov 18, 2025
d298e7a
Merge pull request #2516 from aehrc/issue/2841
johngrimes Nov 20, 2025
98eb765
Add example page about repeat queries over Questionnaires
johngrimes Nov 20, 2025
bafbe71
Update list of views within benchmark
johngrimes Nov 20, 2025
d128e99
chore: Update version of test-data artifact
johngrimes Nov 21, 2025
d8a4262
chore: Update test-data version in benchmark module
johngrimes Nov 21, 2025
8443a52
fix: Change name of QuestionnaireResponseFlat within VIEW_DEFINITIONS
johngrimes Nov 21, 2025
ff7bfdb
fix: Add QuestionnaireResponse to list of benchmark resource types
johngrimes Nov 21, 2025
bd5c0ce
chore: Update pointer to SQL on FHIR spec
johngrimes Nov 21, 2025
b5fb2ec
chore: Update HAPI to 8.6.0
johngrimes Nov 21, 2025
907c77b
chore: Update licenses
johngrimes Nov 24, 2025
bc43a70
chore: Update copyright
johngrimes Nov 24, 2025
aed10b5
docs: Add supported Spark version to installation documentation
johngrimes Nov 24, 2025
4cb8294
test: Add failing test for getResourceKey() versioned ID issue
johngrimes Nov 24, 2025
19e1fbe
fix: Use unversioned ID for getResourceKey() to match getReferenceKey()
johngrimes Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
with:
java-version: 21
distribution: "zulu"

- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Install uv
uses: astral-sh/setup-uv@v6
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
java-version: 21
distribution: "zulu"

- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Install uv
uses: astral-sh/setup-uv@v6

Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "sql-on-fhir"]
path = sql-on-fhir
url = https://github.com/aehrc/sql-on-fhir-v2.git
url = https://github.com/FHIR/sql-on-fhir-v2.git
59 changes: 52 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,54 @@ verified to be green within CI before merging to main. Merging to main
automatically triggers publishing of artifacts and deployment of the software to
production environments such as the Pathling website and sandbox instance.

### Coding conventions

#### Comments
## Commit Message Format

Write commit messages that capture the **objective** of the change, not the specific implementation details that can be obtained from the diff.

**Structure**:
```
<type>: <succinct description of the objective>

<optional body explaining the why and context>
```

**Types**:
- `fix:` - Bug fixes or resolving warnings/errors
- `feat:` - New features or enhancements
- `refactor:` - Code restructuring without changing behavior
- `docs:` - Documentation updates
- `test:` - Test-related changes
- `chore:` - Build, tooling, or dependency updates

**Guidelines**:
- Focus on **why** the change was needed and **what problem** it solves
- Avoid mentioning specific files, line numbers, or implementation details
- Keep the first line concise (under 72 characters when possible)
- Use the body to provide context if the objective isn't obvious

**Examples**:

Good:
```
fix: Suppress Mockito dynamic agent loading warnings in Java 21

Added JVM flag to suppress warnings about Mockito's inline mock maker
self-attaching. Updated documentation to record Maven test configuration.
```

Poor:
```
fix: Added -XX:+EnableDynamicAgentLoading to pom.xml line 637

Changed the argLine in maven-surefire-plugin configuration.
Updated CLAUDE.md with new section at lines 102-120.
```


## Coding conventions

### Comments

- All comments must use correct grammar and be written as complete sentences.
- Every comment, including single-line comments, must be terminated with a
Expand All @@ -320,7 +365,7 @@ production environments such as the Pathling website and sandbox instance.
If you have a task that you want to complete in the future, please create an
issue for it.

#### Java
### Java

- Use meaningful and descriptive names for classes, methods, and variables
(avoid abbreviations).
Expand Down Expand Up @@ -359,7 +404,7 @@ production environments such as the Pathling website and sandbox instance.
- Ensure code is free of major bugs, vulnerabilities, and code smells as
reported by SonarQube.

#### Scala
### Scala

- Use meaningful and descriptive names
following [Scala conventions](https://docs.scala-lang.org/style/).
Expand All @@ -376,7 +421,7 @@ production environments such as the Pathling website and sandbox instance.
- Use appropriate collection methods (`map`, `filter`, `fold`) instead of loops.
- Keep methods short and focused on a single responsibility.

#### Python
### Python

- Follow [PEP 8](https://peps.python.org/pep-0008/) style guidelines.
- Use meaningful and descriptive names with snake_case convention.
Expand All @@ -388,7 +433,7 @@ production environments such as the Pathling website and sandbox instance.
- Write unit tests using [pytest framework](https://pytest.org/).
- Keep imports organized: standard library, third-party, local imports.

#### R
### R

- Follow [tidyverse style guide](https://style.tidyverse.org/) conventions.
- Use snake_case for variable and function names.
Expand All @@ -401,7 +446,7 @@ production environments such as the Pathling website and sandbox instance.
- Handle missing values (`NA`) appropriately.
- Use consistent indentation (2 spaces recommended).

#### Formatting
### Formatting

This repository uses multiple code formatters:

Expand Down
16 changes: 8 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ accessing the Software. Other third party software may also be identified in
separate files distributed with the Software.

* (Apache License, Version 2.0) FHIR Bulk Client (au.csiro.fhir:bulk-export:1.0.3 - https://github.com/aehrc/fhir-bulk-java)
* (Apache License, Version 2.0) HAPI FHIR - Core Library (ca.uhn.hapi.fhir:hapi-fhir-base:8.4.0 - http://jamesagnew.github.io/hapi-fhir/)
* (Apache License, Version 2.0) HAPI FHIR - Client Framework (ca.uhn.hapi.fhir:hapi-fhir-client:8.4.0 - https://hapifhir.io/hapi-deployable-pom/hapi-fhir-client)
* (Apache License, Version 2.0) HAPI FHIR Structures - FHIR R4 (ca.uhn.hapi.fhir:hapi-fhir-structures-r4:8.4.0 - https://hapifhir.io/hapi-deployable-pom/hapi-fhir-structures-r4)
* (Apache License, Version 2.0) HAPI FHIR - Core Library (ca.uhn.hapi.fhir:hapi-fhir-base:8.6.0 - https://hapifhir.io/)
* (Apache License, Version 2.0) HAPI FHIR - Client Framework (ca.uhn.hapi.fhir:hapi-fhir-client:8.6.0 - https://hapifhir.io/hapi-deployable-pom/hapi-fhir-client)
* (Apache License, Version 2.0) HAPI FHIR Structures - FHIR R4 (ca.uhn.hapi.fhir:hapi-fhir-structures-r4:8.6.0 - https://hapifhir.io/hapi-deployable-pom/hapi-fhir-structures-r4)
* (Eclipse Public License 1.0) (GNU Lesser General Public License) Logback Classic Module (ch.qos.logback:logback-classic:1.5.18 - http://logback.qos.ch/logback-classic)
* (Apache License, Version 2.0) WireMock (com.github.tomakehurst:wiremock-jre8-standalone:2.35.2 - http://wiremock.org)
* (Apache License, Version 2.0) FindBugs-jsr305 (com.google.code.findbugs:jsr305:3.0.2 - http://findbugs.sourceforge.net/)
Expand Down Expand Up @@ -214,14 +214,14 @@ separate files distributed with the Software.
* (Apache License, Version 2.0) Infinispan Component Annotations (org.infinispan:infinispan-component-annotations:15.0.3.Final - http://www.infinispan.org)
* (Apache License, Version 2.0) Infinispan Core (org.infinispan:infinispan-core:15.0.3.Final - http://www.infinispan.org)
* (Public Domain) JSON in Java (org.json:json:20240303 - https://github.com/douglascrockford/JSON-java)
* (Eclipse Public License v2.0) JUnit Jupiter API (org.junit.jupiter:junit-jupiter-api:5.10.1 - https://junit.org/junit5/)
* (Eclipse Public License v2.0) JUnit Jupiter Engine (org.junit.jupiter:junit-jupiter-engine:5.10.1 - https://junit.org/junit5/)
* (Eclipse Public License v2.0) JUnit Jupiter Params (org.junit.jupiter:junit-jupiter-params:5.10.1 - https://junit.org/junit5/)
* (MIT License) mockito-core (org.mockito:mockito-core:5.17.0 - https://github.com/mockito/mockito)
* (Eclipse Public License v2.0) JUnit Jupiter API (org.junit.jupiter:junit-jupiter-api:5.11.4 - https://junit.org/junit5/)
* (Eclipse Public License v2.0) JUnit Jupiter Engine (org.junit.jupiter:junit-jupiter-engine:5.11.4 - https://junit.org/junit5/)
* (Eclipse Public License v2.0) JUnit Jupiter Params (org.junit.jupiter:junit-jupiter-params:5.11.4 - https://junit.org/junit5/)
* (MIT License) mockito-core (org.mockito:mockito-core:5.18.0 - https://github.com/mockito/mockito)
* (GNU General Public License (GPL), version 2, with the Classpath exception) JMH Core (org.openjdk.jmh:jmh-core:1.37 - http://openjdk.java.net/projects/code-tools/jmh/jmh-core/)
* (GNU General Public License (GPL), version 2, with the Classpath exception) JMH Generators: Annotation Processors (org.openjdk.jmh:jmh-generator-annprocess:1.37 - http://openjdk.java.net/projects/code-tools/jmh/jmh-generator-annprocess/)
* (MIT License) Project Lombok (org.projectlombok:lombok:1.18.38 - https://projectlombok.org)
* (Apache License, Version 2.0) Scala Library (org.scala-lang:scala-library:2.13.15 - https://www.scala-lang.org/)
* (Apache License, Version 2.0) JSONassert (org.skyscreamer:jsonassert:1.5.1 - https://github.com/skyscreamer/JSONassert)
* (MIT License) SLF4J API Module (org.slf4j:slf4j-api:2.0.17 - http://www.slf4j.org)
* (Apache License, Version 2.0) spring-boot-starter-test (org.springframework.boot:spring-boot-starter-test:3.3.11 - https://spring.io/projects/spring-boot)
* (Apache License, Version 2.0) spring-boot-starter-test (org.springframework.boot:spring-boot-starter-test:3.4.11 - https://spring.io/projects/spring-boot)
4 changes: 2 additions & 2 deletions benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>au.csiro.pathling</groupId>
<artifactId>pathling</artifactId>
<version>9.0.1-SNAPSHOT</version>
<version>9.1.0-SNAPSHOT</version>
</parent>
<artifactId>benchmark</artifactId>
<packaging>jar</packaging>
Expand All @@ -31,7 +31,7 @@

<properties>
<pathling.jmhVersion>1.37</pathling.jmhVersion>
<pathling.testDataVersion>1.0.0</pathling.testDataVersion>
<pathling.testDataVersion>1.1.0</pathling.testDataVersion>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/src/license/THIRD-PARTY.properties

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,13 @@ public List<Row> usCoreBloodPressures(@Nonnull final PathlingBenchmarkState stat
.collectAsList();
}

@Benchmark
public List<Row> questionnaireResponseFlat(@Nonnull final PathlingBenchmarkState state) {
return state.getNdjsonSource()
.view("QuestionnaireResponse")
.json(state.getViewDefinitions().get("QuestionnaireResponseFlat"))
.execute()
.collectAsList();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
public class PathlingBenchmarkState {

/**
* Pre-defined view definitions used in benchmarks to test complex query scenarios. These view
* definitions are taken from the SQL on FHIR implementation guide.
* Pre-defined view definitions used in benchmarks to test query scenarios. These view definitions
* are taken from the SQL on FHIR implementation guide.
*/
private static final List<String> VIEW_DEFINITIONS = List.of(
"ConditionFlat", "EncounterFlat", "PatientAddresses", "PatientAndContactAddressUnion",
"PatientDemographics", "UsCoreBloodPressures"
"PatientDemographics", "UsCoreBloodPressures", "QuestionnaireResponseFlat"
);

/**
Expand Down Expand Up @@ -163,7 +163,8 @@ public PathlingBenchmarkState() {
public void setup() {
// Define the FHIR resource types that will be loaded for benchmarking
// These represent core clinical data types commonly used in healthcare analytics
final List<String> resourceTypes = List.of("Patient", "Observation", "Condition", "Encounter");
final List<String> resourceTypes = List.of("Patient", "Observation", "Condition", "Encounter",
"QuestionnaireResponse");

// Initialize the appropriate data source based on the benchmark parameter
if ("ndjson".equals(sourceType)) {
Expand Down
84 changes: 84 additions & 0 deletions benchmark/src/main/resources/QuestionnaireResponseFlat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"resourceType": "ViewDefinition",
"id": "QuestionnaireResponseFlat",
"name": "questionnaire_response_flat",
"description": "Flattened questionnaire response data with recursively unnested items. One row per item at any nesting level. Useful for analysing questionnaire answers across all item types and testing the repeat directive with multiple expressions.",
"status": "draft",
"resource": "QuestionnaireResponse",
"select": [
{
"column": [
{
"path": "getResourceKey()",
"name": "id",
"description": "Unique questionnaire response identifier"
},
{
"path": "questionnaire",
"name": "questionnaire",
"type": "canonical",
"description": "Canonical URL of the questionnaire being answered"
},
{
"path": "status",
"name": "status",
"type": "code",
"description": "Response status: in-progress, completed, amended, entered-in-error, stopped"
},
{
"path": "subject.getReferenceKey(Patient)",
"name": "patient_id",
"description": "Patient identifier for joining with patient views"
},
{
"path": "authored",
"name": "authored",
"type": "dateTime",
"description": "Date and time the response was authored in ISO 8601 format"
}
]
},
{
"repeat": [
"item"
],
"column": [
{
"path": "linkId",
"name": "item_link_id",
"description": "Unique identifier for this item within the questionnaire definition"
},
{
"path": "answer.value.ofType(integer)",
"name": "answer_value_integer",
"description": "Integer answer value; null if answer is not an integer or no answer provided"
},
{
"path": "answer.value.ofType(string)",
"name": "answer_value_string",
"description": "String answer value; null if answer is not a string or no answer provided"
},
{
"path": "answer.value.ofType(boolean)",
"name": "answer_value_boolean",
"description": "Boolean answer value; null if answer is not a boolean or no answer provided"
},
{
"path": "answer.value.ofType(decimal)",
"name": "answer_value_decimal",
"description": "Decimal answer value; null if answer is not a decimal or no answer provided"
},
{
"path": "answer.value.ofType(date)",
"name": "answer_value_date",
"description": "Date answer value in YYYY-MM-DD format; null if answer is not a date or no answer provided"
},
{
"path": "answer.value.ofType(time)",
"name": "answer_value_time",
"description": "Time answer value; null if answer is not a time or no answer provided"
}
]
}
]
}
2 changes: 1 addition & 1 deletion encoders/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>au.csiro.pathling</groupId>
<artifactId>pathling</artifactId>
<version>9.0.1-SNAPSHOT</version>
<version>9.1.0-SNAPSHOT</version>
</parent>
<artifactId>encoders</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion encoders/src/license/THIRD-PARTY.properties

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

package au.csiro.pathling.encoders;

import au.csiro.pathling.config.Configurable;
import au.csiro.pathling.config.EncodingConfiguration;
import au.csiro.pathling.encoders.datatypes.DataTypeMappings;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
Expand All @@ -39,7 +41,7 @@
/**
* Spark Encoders for FHIR Resources. This object is thread safe.
*/
public class FhirEncoders {
public class FhirEncoders implements Configurable<EncodingConfiguration> {

/**
* The reasonable default set of open types to encode with extension values.
Expand Down Expand Up @@ -88,7 +90,7 @@ public class FhirEncoders {
private static final Map<FhirVersionEnum, FhirContext> FHIR_CONTEXTS = new ConcurrentHashMap<>();

/**
* @return the FHIR context used by encoders produced by this instance.
* The FHIR context used by encoders produced by this instance.
*/
@Getter
private final FhirContext context;
Expand Down Expand Up @@ -258,4 +260,21 @@ public FhirVersionEnum getFhirVersion() {
return context.getVersion().getVersion();
}

/**
* Returns the encoding configuration that corresponds to this FhirEncoders instance.
* <p>
* The configuration is constructed on-demand from the current state of this instance.
*
* @return the encoding configuration, never null
*/
@Nonnull
@Override
public EncodingConfiguration getConfiguration() {
return EncodingConfiguration.builder()
.maxNestingLevel(maxNestingLevel)
.enableExtensions(enableExtensions)
.openTypes(openTypes)
.build();
}

}
Loading
Loading