Class ParserOptions

    • Method Detail

      • setDontStripVersionsFromReferencesAtPaths

        public ParserOptions setDontStripVersionsFromReferencesAtPaths​(String... thePaths)
        If supplied value(s), any resource references at the specified paths will have their resource versions encoded instead of being automatically stripped during the encoding process. This setting has no effect on the parsing process.

        This method provides a finer-grained level of control than setStripVersionsFromReferences(boolean) and any paths specified by this method will be encoded even if setStripVersionsFromReferences(boolean) has been set to true (which is the default)

        Parameters:
        thePaths - A collection of paths for which the resource versions will not be removed automatically when serializing, e.g. "Patient.managingOrganization" or "AuditEvent.object.reference". Note that only resource name and field names with dots separating is allowed here (no repetition indicators, FluentPath expressions, etc.)
        Returns:
        Returns a reference to this parser so that method calls can be chained together
        See Also:
        setStripVersionsFromReferences(boolean)
      • isStripVersionsFromReferences

        public boolean isStripVersionsFromReferences()
        If set to true (which is the default), resource references containing a version will have the version removed when the resource is encoded. This is generally good behaviour because in most situations, references from one resource to another should be to the resource by ID, not by ID and version. In some cases though, it may be desirable to preserve the version in resource links. In that case, this value should be set to false.
        Returns:
        Returns the parser instance's configuration setting for stripping versions from resource references when encoding. Default is true.
      • setStripVersionsFromReferences

        public ParserOptions setStripVersionsFromReferences​(boolean theStripVersionsFromReferences)
        If set to true (which is the default), resource references containing a version will have the version removed when the resource is encoded. This is generally good behaviour because in most situations, references from one resource to another should be to the resource by ID, not by ID and version. In some cases though, it may be desirable to preserve the version in resource links. In that case, this value should be set to false.

        This method provides the ability to globally disable reference encoding. If finer-grained control is needed, use setDontStripVersionsFromReferencesAtPaths(String...)

        Parameters:
        theStripVersionsFromReferences - Set this to false to prevent the parser from removing resource versions from references.
        Returns:
        Returns a reference to this parser so that method calls can be chained together
        See Also:
        setDontStripVersionsFromReferencesAtPaths(String...)
      • setDontStripVersionsFromReferencesAtPaths

        public ParserOptions setDontStripVersionsFromReferencesAtPaths​(Collection<String> thePaths)
        If supplied value(s), any resource references at the specified paths will have their resource versions encoded instead of being automatically stripped during the encoding process. This setting has no effect on the parsing process.

        This method provides a finer-grained level of control than setStripVersionsFromReferences(boolean) and any paths specified by this method will be encoded even if setStripVersionsFromReferences(boolean) has been set to true (which is the default)

        Parameters:
        thePaths - A collection of paths for which the resource versions will not be removed automatically when serializing, e.g. "Patient.managingOrganization" or "AuditEvent.object.reference". Note that only resource name and field names with dots separating is allowed here (no repetition indicators, FluentPath expressions, etc.)
        Returns:
        Returns a reference to this parser so that method calls can be chained together
        See Also:
        setStripVersionsFromReferences(boolean)
      • isOverrideResourceIdWithBundleEntryFullUrl

        public boolean isOverrideResourceIdWithBundleEntryFullUrl()
        If set to true (which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's resource id if the fullUrl is defined. This behavior happens when parsing the source data into a Bundle object. Set this to false if this is not the desired behavior (e.g. the client code wishes to perform additional validation checks between the fullUrl and the resource id).
        Returns:
        Returns the parser instance's configuration setting for overriding resource ids with Bundle.entry.fullUrl when parsing the source data into a Bundle object. Default is true.
      • setOverrideResourceIdWithBundleEntryFullUrl

        public ParserOptions setOverrideResourceIdWithBundleEntryFullUrl​(boolean theOverrideResourceIdWithBundleEntryFullUrl)
        If set to true (which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's resource id if the fullUrl is defined. This behavior happens when parsing the source data into a Bundle object. Set this to false if this is not the desired behavior (e.g. the client code wishes to perform additional validation checks between the fullUrl and the resource id).
        Parameters:
        theOverrideResourceIdWithBundleEntryFullUrl - Set this to false to prevent the parser from overriding resource ids with the Bundle.entry.fullUrl
        Returns:
        Returns a reference to this parser so that method calls can be chained together