-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* IPS enhancements * API design complete * Work on section registry * Work on external fetch * IPS rewrite * Cleanup * Work * IPS refactor * Add changelog * Changelog updates * Spotless * Compile fix * Address review comments * Address review comments * License header * Revert narrative builder change * Address review comments * Addres review comments * Cleanup
- Loading branch information
1 parent
d71736b
commit 12eb2d6
Showing
69 changed files
with
3,445 additions
and
1,474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/NarrativeGeneratorTemplateUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/*- | ||
* #%L | ||
* HAPI FHIR - Core Library | ||
* %% | ||
* Copyright (C) 2014 - 2024 Smile CDR, Inc. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package ca.uhn.fhir.narrative2; | ||
|
||
import ca.uhn.fhir.context.FhirContext; | ||
import ca.uhn.fhir.util.BundleUtil; | ||
import org.apache.commons.lang3.tuple.Pair; | ||
import org.hl7.fhir.instance.model.api.IBaseBundle; | ||
import org.hl7.fhir.instance.model.api.IBaseResource; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* An instance of this class is added to the Thymeleaf context as a variable with | ||
* name <code>"narrativeUtil"</code> and can be accessed from narrative templates. | ||
* | ||
* @since 7.0.0 | ||
*/ | ||
public class NarrativeGeneratorTemplateUtils { | ||
|
||
public static final NarrativeGeneratorTemplateUtils INSTANCE = new NarrativeGeneratorTemplateUtils(); | ||
|
||
/** | ||
* Given a Bundle as input, are any entries present with a given resource type | ||
*/ | ||
public boolean bundleHasEntriesWithResourceType(IBaseBundle theBaseBundle, String theResourceType) { | ||
FhirContext ctx = theBaseBundle.getStructureFhirVersionEnum().newContextCached(); | ||
List<Pair<String, IBaseResource>> entryResources = | ||
BundleUtil.getBundleEntryUrlsAndResources(ctx, theBaseBundle); | ||
return entryResources.stream() | ||
.map(Pair::getValue) | ||
.filter(Objects::nonNull) | ||
.anyMatch(t -> ctx.getResourceType(t).equals(theResourceType)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...a/uhn/hapi/fhir/changelog/7_2_0/5682-bundlebuilder-doesnt-include-version-in-fullurl.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
type: fix | ||
issue: 5682 | ||
title: "The BundleBuilder utility class will no longer include the `/_version/xxx` portion of the | ||
resource ID in the `Bundle.entry.fullUrl` it generates, as the FHIR specification states that this | ||
should be omitted." |
9 changes: 9 additions & 0 deletions
9
...-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5682-ips-api-refactor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
type: change | ||
issue: 5682 | ||
title: "The IPS $summary generation API has been overhauled to make it more flexible for | ||
future use cases. Specifically, the section registry has been removed and folded into | ||
the generation strategy, and support has been added for non-JPA sources of data. This is | ||
a breaking change to the API, and implementers will need to update their code. This updated | ||
API incorporates community feedback, and should now be considered a stable API for IPS | ||
generation." |
26 changes: 26 additions & 0 deletions
26
...-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5682-ips-enhancements.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
type: add | ||
issue: 5682 | ||
title: "Several enhancements have been made to the International Patient Summary generator based on | ||
feedback from implementers: | ||
<ul> | ||
<li> | ||
New methods have been added to the <code>IIpsGenerationStrategy</code> allowing resources | ||
for any or all sections to be fetched from a source other than the FHIR repository. | ||
</li> | ||
<li> | ||
The <code>IpsSectionEnum</code> class has been removed and replaced in any user-facing APIs | ||
with references to <code>SectionRegistry.Section</code>. This makes it much easier to | ||
extend or replace the section registry with custom sections not defined in the universal | ||
IPS implementation guide. | ||
</li> | ||
<li> | ||
Captions have been removed from narrative section tables, and replaced with H5 tags | ||
directly above the table. This results in an easier to read display since the table | ||
title will appear above the table instead of below it. | ||
</li> | ||
<li> | ||
The IPS narrative generator built in templates will now omit tables when the template | ||
specified multiple tables and the specific table would have no resources. | ||
</li> | ||
</ul>" |
5 changes: 5 additions & 0 deletions
5
...in/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5682-ips-generator-no-uuids-by-default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
type: fix | ||
issue: 5682 | ||
title: "The IPS Generator will no longer replace resource IDs with placeholder IDs in the resulting | ||
bundle by default, although this can be overridden in the generation strategy object." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.