
Package ca.uhn.fhir.jpa.ips.strategy
Class DefaultIpsGenerationStrategy
java.lang.Object
ca.uhn.fhir.jpa.ips.strategy.DefaultIpsGenerationStrategy
- All Implemented Interfaces:
IIpsGenerationStrategy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.hl7.fhir.instance.model.api.IBaseResource
Create and return a newOrganization
resource representing.createConfidentiality
(IpsContext theIpsContext) Create and return a confidentiality code for the composition document.createTitle
(IpsContext theContext) Create and return a title for the composition document.Provides a list of configuration property files for the IPS narrative generator.Provides a registry which defines the various sections that will be included when generating an IPS.org.hl7.fhir.instance.model.api.IIdType
massageResourceId
(IpsContext theIpsContext, org.hl7.fhir.instance.model.api.IBaseResource theResource) This method is used to determine the resource ID to assign to a resource that will be added to the IPS document Bundle.void
massageResourceSearch
(IpsContext.IpsSectionContext theIpsSectionContext, ca.uhn.fhir.jpa.searchparam.SearchParameterMap theSearchParameterMap) This method can manipulate theSearchParameterMap
that will be used to find candidate resources for the given IPS section.Set<ca.uhn.fhir.model.api.Include>
provideResourceSearchIncludes
(IpsContext.IpsSectionContext theIpsSectionContext) Return a set of Include directives to be added to the resource search for resources to include for a given IPS section.void
setSectionRegistry
(SectionRegistry theSectionRegistry) boolean
shouldInclude
(IpsContext.IpsSectionContext theIpsSectionContext, org.hl7.fhir.instance.model.api.IBaseResource theCandidate) This method will be called for each found resource candidate for inclusion in the IPS document.
-
Field Details
-
DEFAULT_IPS_NARRATIVES_PROPERTIES
- See Also:
-
-
Constructor Details
-
DefaultIpsGenerationStrategy
public DefaultIpsGenerationStrategy()Constructor
-
-
Method Details
-
getSectionRegistry
Description copied from interface:IIpsGenerationStrategy
Provides a registry which defines the various sections that will be included when generating an IPS. It can be subclassed and customized as needed in order to add, change, or remove sections.- Specified by:
getSectionRegistry
in interfaceIIpsGenerationStrategy
-
setSectionRegistry
-
getNarrativePropertyFiles
Description copied from interface:IIpsGenerationStrategy
Provides a list of configuration property files for the IPS narrative generator.Entries should be of the format
classpath:path/to/file.properties
If more than one file is provided, the files will be evaluated in order. Therefore you might choose to include a custom file, followed by
DEFAULT_IPS_NARRATIVES_PROPERTIES
in order to fall back to the default templates for any sections you have not provided an explicit template for.- Specified by:
getNarrativePropertyFiles
in interfaceIIpsGenerationStrategy
-
createAuthor
Description copied from interface:IIpsGenerationStrategy
Create and return a newOrganization
resource representing. the author of the IPS document. This method will be called once per IPS in order to- Specified by:
createAuthor
in interfaceIIpsGenerationStrategy
-
createTitle
Description copied from interface:IIpsGenerationStrategy
Create and return a title for the composition document.- Specified by:
createTitle
in interfaceIIpsGenerationStrategy
- Parameters:
theContext
- The associated context for the specific IPS document being generated.
-
createConfidentiality
Description copied from interface:IIpsGenerationStrategy
Create and return a confidentiality code for the composition document. Must be a valid code for the elementComposition.confidentiality
- Specified by:
createConfidentiality
in interfaceIIpsGenerationStrategy
- Parameters:
theIpsContext
- The associated context for the specific IPS document being generated.
-
massageResourceId
public org.hl7.fhir.instance.model.api.IIdType massageResourceId(@Nullable IpsContext theIpsContext, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theResource) Description copied from interface:IIpsGenerationStrategy
This method is used to determine the resource ID to assign to a resource that will be added to the IPS document Bundle. Implementations will probably either return the resource ID as-is, or generate a placeholder UUID to replace it with.- Specified by:
massageResourceId
in interfaceIIpsGenerationStrategy
- Parameters:
theIpsContext
- The associated context for the specific IPS document being generated. Note that this will benull
when massaging the ID of the subject (Patient) resource, but will be populated for all subsequent calls for a given IPS document generation.theResource
- The resource to massage the resource ID for- Returns:
- An ID to assign to the resource
-
massageResourceSearch
public void massageResourceSearch(IpsContext.IpsSectionContext theIpsSectionContext, ca.uhn.fhir.jpa.searchparam.SearchParameterMap theSearchParameterMap) Description copied from interface:IIpsGenerationStrategy
This method can manipulate theSearchParameterMap
that will be used to find candidate resources for the given IPS section. The map will already have a subject/patient parameter added to it. The map provided in theSearchParameterMap will contain a subject/patient reference, but no other parameters. This method can add other parameters.For example, for a Vital Signs section, the implementation might add a parameter indicating the parameter
category=vital-signs
.- Specified by:
massageResourceSearch
in interfaceIIpsGenerationStrategy
- Parameters:
theIpsSectionContext
- The context, which indicates the IPS section and the resource type being searched for.theSearchParameterMap
- The map to manipulate.
-
provideResourceSearchIncludes
@Nonnull public Set<ca.uhn.fhir.model.api.Include> provideResourceSearchIncludes(IpsContext.IpsSectionContext theIpsSectionContext) Description copied from interface:IIpsGenerationStrategy
Return a set of Include directives to be added to the resource search for resources to include for a given IPS section. These include statements will be added to the sameSearchParameterMap
provided toIIpsGenerationStrategy.massageResourceSearch(IpsContext.IpsSectionContext, SearchParameterMap)
. This is a separate method in order to make subclassing easier.- Specified by:
provideResourceSearchIncludes
in interfaceIIpsGenerationStrategy
- Parameters:
theIpsSectionContext
- The context, which indicates the IPS section and the resource type being searched for.
-
shouldInclude
public boolean shouldInclude(IpsContext.IpsSectionContext theIpsSectionContext, org.hl7.fhir.instance.model.api.IBaseResource theCandidate) Description copied from interface:IIpsGenerationStrategy
This method will be called for each found resource candidate for inclusion in the IPS document. The strategy can decide whether to include it or not.- Specified by:
shouldInclude
in interfaceIIpsGenerationStrategy
-