Package dev.dsf.fhir.authorization.read
Interface ReadAccessHelper
public interface ReadAccessHelper
Helper with methods to configure read access to FHIR resources.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<R extends org.hl7.fhir.r4.model.Resource>
RaddAll
(R resource) Adds All tag.<R extends org.hl7.fhir.r4.model.Resource>
RaddLocal
(R resource) Adds LOCAL tag.<R extends org.hl7.fhir.r4.model.Resource>
RaddOrganization
(R resource, String organizationIdentifier) Adds ORGANIZATION tag for the given organization.<R extends org.hl7.fhir.r4.model.Resource>
RaddOrganization
(R resource, org.hl7.fhir.r4.model.Organization organization) Adds ORGANIZATION tag for the given organization.<R extends org.hl7.fhir.r4.model.Resource>
RAdds ROLE tag for the given affiliation.<R extends org.hl7.fhir.r4.model.Resource>
RaddRole
(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 existboolean
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
-
Field Details
-
READ_ACCESS_TAG_SYSTEM
- See Also:
-
READ_ACCESS_TAG_VALUE_LOCAL
- See Also:
-
READ_ACCESS_TAG_VALUE_ORGANIZATION
- See Also:
-
READ_ACCESS_TAG_VALUE_ROLE
- See Also:
-
READ_ACCESS_TAG_VALUE_ALL
- See Also:
-
ORGANIZATION_IDENTIFIER_SYSTEM
- See Also:
-
EXTENSION_READ_ACCESS_ORGANIZATION
- See Also:
-
EXTENSION_READ_ACCESS_PARENT_ORGANIZATION_ROLE
- See Also:
-
EXTENSION_READ_ACCESS_PARENT_ORGANIZATION_ROLE_PARENT_ORGANIZATION
- See Also:
-
EXTENSION_READ_ACCESS_PARENT_ORGANIZATION_ROLE_ORGANIZATION_ROLE
- See Also:
-
-
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 benull
- Returns:
null
if given resource isnull
- 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 benull
organizationIdentifier
- notnull
- Returns:
null
if given resource isnull
- 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 benull
organization
- notnull
- Returns:
null
if given resource isnull
- Throws:
NullPointerException
- if given organization isnull
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 benull
consortiumIdentifier
- notnull
roleSystem
- notnull
roleCode
- notnull
- Returns:
null
if given resource isnull
- 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 benull
affiliation
- notnull
- Returns:
null
if given resource isnull
- Throws:
NullPointerException
- if given affiliation isnull
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 benull
- Returns:
null
if given resource isnull
- See Also:
-
hasLocal
boolean hasLocal(org.hl7.fhir.r4.model.Resource resource) -
hasOrganization
-
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
-
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 benull
- Returns:
false
if given resource isnull
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 benull
organizationWithIdentifierExists
- notnull
roleExists
- notnull
- Returns:
false
if given resource isnull
or resource not valid
-