Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional argument for making clone of predefined resources #1500

Merged
merged 1 commit into from
Aug 26, 2024

Commits on Aug 11, 2024

  1. Add optional argument for making clone of predefined resources

    The FHIRDefinitions class provides a public method to return all
    predefined resources. Hypothetically, the caller of this method could
    alter the predefined resources, which is why it could be useful to
    return a clone of these resources. However, in all places this method is
    called by SUSHI, the resources are used for a search, not for any
    modifications. By not cloning the resources for the search, significant
    time savings are possible. Just in case someone else is using SUSHI as a
    dependency and calling this method and expecting to receive a clone, the
    default behavior is to return a clone.
    
    When searching for slices, the slice of an element is always a sibling
    of that element. Therefore, it is preferable to search the smaller list
    containing only the element's parent's children, when possible. This
    takes advantage of the underlying ElementDefinition tree. Because the
    root element's parent is undefined, use the full element list when
    working with the root element. This shouldn't be possible in most cases,
    as revealed by the test coverage, but the implementation is defensive
    just in case something unusual has happened to the root element.
    mint-thompson committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    653d151 View commit details
    Browse the repository at this point in the history