Interface IIpsGenerationStrategy

All Known Implementing Classes:
BaseIpsGenerationStrategy, DefaultJpaIpsGenerationStrategy

public interface IIpsGenerationStrategy
This interface is the primary configuration and strategy provider for the HAPI FHIR International Patient Summary (IPS) generator.

Note that this API will almost certainly change as more real-world experience is gained with the IPS generator.

  • Method Summary

    Modifier and Type
    Method
    Description
    org.hl7.fhir.instance.model.api.IBaseResource
    Create and return a new Organization resource representing.
    Create and return a confidentiality code for the composition document.
    createTitle(IpsContext theContext)
    Create and return a title for the composition document.
    org.hl7.fhir.instance.model.api.IBaseResource
    fetchPatient(ca.uhn.fhir.rest.param.TokenParam thePatientIdentifier, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails)
    Fetches and returns the patient to include in the generated IPS for the given patient identifier.
    org.hl7.fhir.instance.model.api.IBaseResource
    fetchPatient(org.hl7.fhir.instance.model.api.IIdType thePatientId, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails)
    Fetches and returns the patient to include in the generated IPS for the given patient ID.
    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.
    Returns the resource supplier for the given section.
    This method should return a list of the sections to include in the generated IPS.
    void
    This method will be called once by the framework.
    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.
    default void
    postManipulateIpsBundle(org.hl7.fhir.instance.model.api.IBaseBundle theBundle)
    This method is called once for each generated IPS document, after all other processing is complete.
  • Method Details

    • getBundleProfile

      This method returns the profile associated with the IPS document generated by this strategy. This URL will be added to generated IPS Bundles in Bundle.meta.profile, and can also be used to support the profile parameter on the $summary operation.
    • initialize

      void initialize()
      This method will be called once by the framework. It can be used to perform any initialization.
    • getSections

      @Nonnull List<Section> getSections()
      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 the Section.getProfile() value.
    • getSectionResourceSupplier

      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.
      Parameters:
      theSection - The section
    • getNarrativePropertyFiles

      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 BaseIpsGenerationStrategy.DEFAULT_IPS_NARRATIVES_PROPERTIES in order to fall back to the default templates for any sections you have not provided an explicit template for.

    • createAuthor

      org.hl7.fhir.instance.model.api.IBaseResource createAuthor()
      Create and return a new Organization resource representing. the author of the IPS document. This method will be called once per IPS in order to
    • createTitle

      Create and return a title for the composition document.
      Parameters:
      theContext - The associated context for the specific IPS document being generated.
    • createConfidentiality

      Create and return a confidentiality code for the composition document. Must be a valid code for the element Composition.confidentiality
      Parameters:
      theIpsContext - The associated context for the specific IPS document being generated.
    • massageResourceId

      @Nullable org.hl7.fhir.instance.model.api.IIdType massageResourceId(@Nullable IpsContext theIpsContext, @Nonnull 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. Implementations will probably either return null 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()

      Parameters:
      theIpsContext - The associated context for the specific IPS document being generated. Note that this will be null 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.
    • fetchPatient

      @Nonnull org.hl7.fhir.instance.model.api.IBaseResource fetchPatient(org.hl7.fhir.instance.model.api.IIdType thePatientId, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) throws ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException
      Fetches and returns the patient to include in the generated IPS for the given patient ID.
      Throws:
      ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException - If the ID is not known.
    • fetchPatient

      @Nonnull org.hl7.fhir.instance.model.api.IBaseResource fetchPatient(ca.uhn.fhir.rest.param.TokenParam thePatientIdentifier, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails)
      Fetches and returns the patient to include in the generated IPS for the given patient identifier.
      Throws:
      ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException - If the ID is not known.
    • postManipulateIpsBundle

      default void postManipulateIpsBundle(org.hl7.fhir.instance.model.api.IBaseBundle theBundle)
      This method is called once for each generated IPS document, after all other processing is complete. It can be used by the strategy to make direct manipulations prior to returning the document.