Package ca.uhn.fhir.jpa.ips.strategy
Class BaseIpsGenerationStrategy
java.lang.Object
ca.uhn.fhir.jpa.ips.strategy.BaseIpsGenerationStrategy
- All Implemented Interfaces:
IIpsGenerationStrategy
- Direct Known Subclasses:
DefaultJpaIpsGenerationStrategy
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSection
(Section theSection, ISectionResourceSupplier theSectionResourceSupplier) This should be called once per section to add a section for inclusion in generated IPS documents.org.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.This method returns the profile associated with the IPS document generated by this strategy.Provides a list of configuration property files for the IPS narrative generator.getSectionResourceSupplier
(Section theSection) Returns the resource supplier for the given section.This method should return a list of the sections to include in the generated 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.jpa.ips.api.IIpsGenerationStrategy
fetchPatient, fetchPatient, initialize, postManipulateIpsBundle
-
Field Details
-
DEFAULT_IPS_NARRATIVES_PROPERTIES
- See Also:
-
-
Constructor Details
-
BaseIpsGenerationStrategy
public BaseIpsGenerationStrategy()Constructor
-
-
Method Details
-
getBundleProfile
Description copied from interface:IIpsGenerationStrategy
This method returns the profile associated with the IPS document generated by this strategy. This URL will be added to generated IPS Bundles inBundle.meta.profile
, and can also be used to support theprofile
parameter on the$summary
operation.- Specified by:
getBundleProfile
in interfaceIIpsGenerationStrategy
-
getSections
Description copied from interface:IIpsGenerationStrategy
This method should return a list of the sections to include in the generated IPS. Note that each section must have a unique value for theSection.getProfile()
value.- Specified by:
getSections
in interfaceIIpsGenerationStrategy
-
getSectionResourceSupplier
Description copied from interface:IIpsGenerationStrategy
Returns the resource supplier for the given section. The resource supplier is used to supply the resources which will be used for a given section.- Specified by:
getSectionResourceSupplier
in interfaceIIpsGenerationStrategy
- Parameters:
theSection
- The section
-
addSection
This should be called once per section to add a section for inclusion in generated IPS documents. It should include aSection
which contains static details about the section, and aISectionResourceSupplier
which is used to fetch resources for inclusion at runtime.- Parameters:
theSection
- Contains static details about the section, such as the resource types it can contain, and a title.theSectionResourceSupplier
- The strategy object which will be used to supply content for this section at runtime.
-
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 returnnull
to leave the resource ID as-is, or generate a placeholder UUID to replace it with.If you want to replace the native resource ID with a placeholder so as not to leak the server-generated IDs, the recommended way is to return
IdType.newRandomUuid()
- 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, or
null
to leave the existing ID intact, meaning that the server-assigned IDs will be used in the bundle.
-