Interface ReadAccessHelper


public interface ReadAccessHelper
Methods to configure read access for FHIR resources on a DSF FHIR server. Methods add and check resource Meta tags.
  • Method Summary

    Modifier and Type
    Method
    Description
    <R extends org.hl7.fhir.r4.model.Resource>
    R
    addAll(R resource)
    Adds All tag.
    <R extends org.hl7.fhir.r4.model.Resource>
    R
    addLocal(R resource)
    Adds LOCAL tag.
    <R extends org.hl7.fhir.r4.model.Resource>
    R
    addOrganization(R resource, String organizationIdentifier)
    Adds ORGANIZATION tag for the given organization.
    <R extends org.hl7.fhir.r4.model.Resource>
    R
    addOrganization(R resource, org.hl7.fhir.r4.model.Organization organization)
    Adds ORGANIZATION tag for the given organization.
    <R extends org.hl7.fhir.r4.model.Resource>
    R
    addRole(R resource, String consortiumIdentifier, String roleSystem, String roleCode)
    Adds ROLE tag for the given affiliation.
    <R extends org.hl7.fhir.r4.model.Resource>
    R
    addRole(R resource, org.hl7.fhir.r4.model.OrganizationAffiliation affiliation)
    Adds ROLE tag for the given affiliation.
    boolean
    hasAll(org.hl7.fhir.r4.model.Resource resource)
     
    boolean
    hasAnyOrganization(org.hl7.fhir.r4.model.Resource resource)
     
    boolean
    hasAnyRole(org.hl7.fhir.r4.model.Resource resource)
     
    boolean
    hasLocal(org.hl7.fhir.r4.model.Resource resource)
     
    boolean
    hasOrganization(org.hl7.fhir.r4.model.Resource resource, String organizationIdentifier)
     
    boolean
    hasOrganization(org.hl7.fhir.r4.model.Resource resource, org.hl7.fhir.r4.model.Organization organization)
     
    boolean
    hasRole(org.hl7.fhir.r4.model.Resource resource, String consortiumIdentifier, String roleSystem, String roleCode)
     
    boolean
    hasRole(org.hl7.fhir.r4.model.Resource resource, List<org.hl7.fhir.r4.model.OrganizationAffiliation> affiliations)
     
    boolean
    hasRole(org.hl7.fhir.r4.model.Resource resource, org.hl7.fhir.r4.model.OrganizationAffiliation affiliation)
     
    boolean
    isValid(org.hl7.fhir.r4.model.Resource resource)
    Resource with access tags valid if:
    1 LOCAL tag and n {ORGANIZATION, ROLE} tags (n >= 0)
    or
    1 ALL tag

    All tags {LOCAL, ORGANIZATION, ROLE, ALL} valid

    Does not check if referenced organizations or roles exist
    boolean
    isValid(org.hl7.fhir.r4.model.Resource resource, Predicate<org.hl7.fhir.r4.model.Identifier> organizationWithIdentifierExists, Predicate<org.hl7.fhir.r4.model.Coding> roleExists)
    Resource with access tags valid if:
    1 LOCAL tag and n {ORGANIZATION, ROLE} tags (n >= 0)
    or
    1 ALL tag

    All tags {LOCAL, ORGANIZATION, ROLE, ALL} valid
  • Method Details

    • addLocal

      <R extends org.hl7.fhir.r4.model.Resource> R addLocal(R resource)
      Adds LOCAL tag. Removes ALL tag if present.
      Type Parameters:
      R - the resource type
      Parameters:
      resource - may be null
      Returns:
      null if given resource is null
      See Also:
    • addOrganization

      <R extends org.hl7.fhir.r4.model.Resource> R addOrganization(R resource, String organizationIdentifier)
      Adds ORGANIZATION tag for the given organization. Adds LOCAL tag if not present, removes ALL tag if present.
      Type Parameters:
      R - the resource type
      Parameters:
      resource - may be null
      organizationIdentifier - not null
      Returns:
      null if given resource is null
      See Also:
    • addOrganization

      <R extends org.hl7.fhir.r4.model.Resource> R addOrganization(R resource, org.hl7.fhir.r4.model.Organization organization)
      Adds ORGANIZATION tag for the given organization. Adds LOCAL tag if not present, removes ALL tag if present.
      Type Parameters:
      R - the resource type
      Parameters:
      resource - may be null
      organization - not null
      Returns:
      null if given resource is null
      Throws:
      NullPointerException - if given organization is null
      IllegalArgumentException - if given organization does not have valid identifier
      See Also:
    • addRole

      <R extends org.hl7.fhir.r4.model.Resource> R addRole(R resource, String consortiumIdentifier, String roleSystem, String roleCode)
      Adds ROLE tag for the given affiliation. Adds LOCAL tag if not present, removes ALL tag if present.
      Type Parameters:
      R - the resource type
      Parameters:
      resource - may be null
      consortiumIdentifier - not null
      roleSystem - not null
      roleCode - not null
      Returns:
      null if given resource is null
      See Also:
    • addRole

      <R extends org.hl7.fhir.r4.model.Resource> R addRole(R resource, org.hl7.fhir.r4.model.OrganizationAffiliation affiliation)
      Adds ROLE tag for the given affiliation. Adds LOCAL tag if not present, removes ALL tag if present.
      Type Parameters:
      R - the resource type
      Parameters:
      resource - may be null
      affiliation - not null
      Returns:
      null if given resource is null
      Throws:
      NullPointerException - if given affiliation is null
      IllegalArgumentException - if given affiliation does not have valid consortium identifier or organization role (only one role supported)
      See Also:
    • addAll

      <R extends org.hl7.fhir.r4.model.Resource> R addAll(R resource)
      Adds All tag. Removes LOCAL, ORGANIZATION and ROLE tags if present.
      Type Parameters:
      R - the resource type
      Parameters:
      resource - may be null
      Returns:
      null if given resource is null
      See Also:
    • hasLocal

      boolean hasLocal(org.hl7.fhir.r4.model.Resource resource)
    • hasOrganization

      boolean hasOrganization(org.hl7.fhir.r4.model.Resource resource, String organizationIdentifier)
    • hasOrganization

      boolean hasOrganization(org.hl7.fhir.r4.model.Resource resource, org.hl7.fhir.r4.model.Organization organization)
    • hasAnyOrganization

      boolean hasAnyOrganization(org.hl7.fhir.r4.model.Resource resource)
    • hasRole

      boolean hasRole(org.hl7.fhir.r4.model.Resource resource, String consortiumIdentifier, String roleSystem, String roleCode)
    • hasRole

      boolean hasRole(org.hl7.fhir.r4.model.Resource resource, org.hl7.fhir.r4.model.OrganizationAffiliation affiliation)
    • hasRole

      boolean hasRole(org.hl7.fhir.r4.model.Resource resource, List<org.hl7.fhir.r4.model.OrganizationAffiliation> affiliations)
    • hasAnyRole

      boolean hasAnyRole(org.hl7.fhir.r4.model.Resource resource)
    • hasAll

      boolean hasAll(org.hl7.fhir.r4.model.Resource resource)
    • isValid

      boolean isValid(org.hl7.fhir.r4.model.Resource resource)
      Resource with access tags valid if:
      1 LOCAL tag and n {ORGANIZATION, ROLE} tags (n >= 0)
      or
      1 ALL tag

      All tags {LOCAL, ORGANIZATION, ROLE, ALL} valid

      Does not check if referenced organizations or roles exist
      Parameters:
      resource - may be null
      Returns:
      false if given resource is null or resource not valid
    • isValid

      boolean isValid(org.hl7.fhir.r4.model.Resource resource, Predicate<org.hl7.fhir.r4.model.Identifier> organizationWithIdentifierExists, Predicate<org.hl7.fhir.r4.model.Coding> roleExists)
      Resource with access tags valid if:
      1 LOCAL tag and n {ORGANIZATION, ROLE} tags (n >= 0)
      or
      1 ALL tag

      All tags {LOCAL, ORGANIZATION, ROLE, ALL} valid
      Parameters:
      resource - may be null
      organizationWithIdentifierExists - not null
      roleExists - not null
      Returns:
      false if given resource is null or resource not valid