@Transactional public class ProviderServiceImpl extends BaseOpenmrsService implements ProviderService
ProviderService
. This class should not be used on its own.
The current OpenMRS implementation should be fetched from the Context.Constructor and Description |
---|
ProviderServiceImpl() |
Modifier and Type | Method and Description |
---|---|
List<ProviderAttributeType> |
getAllProviderAttributeTypes()
Gets all provider attribute types including retired provider attribute types.
|
List<ProviderAttributeType> |
getAllProviderAttributeTypes(boolean includeRetired)
Gets all provider attribute types optionally including retired provider attribute types.
|
List<Provider> |
getAllProviders()
Gets all providers. includes retired Provider.This method delegates to the
#getAllProviders(boolean) method
|
List<Provider> |
getAllProviders(boolean includeRetired)
Gets all providers
|
Integer |
getCountOfProviders(String query) |
Integer |
getCountOfProviders(String query,
boolean includeRetired)
Gets the count of providers with a person name or identifier or name that matches the
specified query
|
Provider |
getProvider(Integer providerId)
Gets a provider by its provider id
|
ProviderAttribute |
getProviderAttribute(Integer providerAttributeID)
Get a provider attribute by it's providerAttributeID
|
ProviderAttribute |
getProviderAttributeByUuid(String uuid)
Get a provider attribute by its providerAttributeUuid
|
ProviderAttributeType |
getProviderAttributeType(Integer providerAttributeTypeId)
Gets a provider attribute type by it's id
|
ProviderAttributeType |
getProviderAttributeTypeByName(String name)
Get a provider attribute type by its name
|
ProviderAttributeType |
getProviderAttributeTypeByUuid(String uuid)
Get a provider attribute type by its uuid
|
Provider |
getProviderByIdentifier(String identifier)
Gets a provider with a matching identifier, this method performs a case insensitive search
|
Provider |
getProviderByUuid(String uuid) |
List<Provider> |
getProviders(String query,
Integer start,
Integer length,
Map<ProviderAttributeType,Object> attributeValues) |
List<Provider> |
getProviders(String query,
Integer start,
Integer length,
Map<ProviderAttributeType,Object> attributeValues,
boolean includeRetired) |
Collection<Provider> |
getProvidersByPerson(Person person)
Gets the Providers for the given person.
|
Collection<Provider> |
getProvidersByPerson(Person person,
boolean includeRetired)
Gets the Providers for the given person including or excluding retired.
|
Provider |
getUnknownProvider()
Gets the unknown provider account, i.e. the provider account that matches the uuid specified
as the value for the global property
OpenmrsConstants.GP_UNKNOWN_PROVIDER_UUID |
boolean |
isProviderIdentifierUnique(Provider provider)
Checks if the identifier for the specified provider is unique
|
void |
purgeProvider(Provider provider)
Deletes a given Provider
|
void |
purgeProviderAttributeType(ProviderAttributeType providerAttributeType)
Deletes a provider attribute type
|
void |
retireProvider(Provider provider,
String reason)
Retires a given Provider
|
ProviderAttributeType |
retireProviderAttributeType(ProviderAttributeType providerAttributeType,
String reason)
Retire a provider attribute type
|
Provider |
saveProvider(Provider provider) |
ProviderAttributeType |
saveProviderAttributeType(ProviderAttributeType providerAttributeType)
Save the provider attribute type
|
void |
setProviderDAO(ProviderDAO dao)
Sets the data access object for Concepts.
|
Provider |
unretireProvider(Provider provider)
Unretire a given Provider
|
ProviderAttributeType |
unretireProviderAttributeType(ProviderAttributeType providerAttributeType)
Un-Retire a provider attribute type
|
onShutdown, onStartup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onShutdown, onStartup
public void setProviderDAO(ProviderDAO dao)
dao
- The data access object to use@Transactional(readOnly=true) public List<Provider> getAllProviders()
ProviderService
getAllProviders
in interface ProviderService
ProviderService.getAllProviders()
@Transactional(readOnly=true) public List<Provider> getAllProviders(boolean includeRetired)
ProviderService
getAllProviders
in interface ProviderService
includeRetired
- - if true, retired providers are also included
Should get all providers that are unretiredProviderService.getAllProviders(boolean)
public void retireProvider(Provider provider, String reason)
ProviderService
retireProvider
in interface ProviderService
provider
- provider to retirereason
- reason why the provider is retired
Should retire a providerProviderService.retireProvider(org.openmrs.Provider, java.lang.String)
public Provider unretireProvider(Provider provider)
ProviderService
unretireProvider
in interface ProviderService
provider
- provider to unretire
Should unretire a providerProviderService.unretireProvider(org.openmrs.Provider)
public void purgeProvider(Provider provider)
ProviderService
purgeProvider
in interface ProviderService
provider
- provider to be deleted
Should delete a providerProviderService.purgeProvider(org.openmrs.Provider)
@Transactional(readOnly=true) public Provider getProvider(Integer providerId)
ProviderService
getProvider
in interface ProviderService
providerId
- the provider idProviderService.getProvider(java.lang.Integer)
public Provider saveProvider(Provider provider)
saveProvider
in interface ProviderService
ProviderService.saveProvider(org.openmrs.Provider)
@Transactional(readOnly=true) public Provider getProviderByUuid(String uuid)
getProviderByUuid
in interface ProviderService
ProviderService.getProviderByUuid(java.lang.String)
@Transactional(readOnly=true) public Collection<Provider> getProvidersByPerson(Person person, boolean includeRetired)
ProviderService
getProvidersByPerson
in interface ProviderService
ProviderService.getProvidersByPerson(org.openmrs.Person, boolean )
@Transactional(readOnly=true) public Collection<Provider> getProvidersByPerson(Person person)
ProviderService
getProvidersByPerson
in interface ProviderService
ProviderService.getProvidersByPerson(org.openmrs.Person)
@Transactional(readOnly=true) public Integer getCountOfProviders(String query)
getCountOfProviders
in interface ProviderService
ProviderService.getCountOfProviders(java.lang.String)
public Integer getCountOfProviders(String query, boolean includeRetired)
ProviderService
getCountOfProviders
in interface ProviderService
query
- the text to matchincludeRetired
- specifies whether retired providers should be include or notProviderService.getCountOfProviders(java.lang.String, boolean)
@Transactional(readOnly=true) public List<Provider> getProviders(String query, Integer start, Integer length, Map<ProviderAttributeType,Object> attributeValues, boolean includeRetired)
getProviders
in interface ProviderService
ProviderService.getProviders(String, Integer, Integer, java.util.Map,
boolean)
@Transactional(readOnly=true) public List<Provider> getProviders(String query, Integer start, Integer length, Map<ProviderAttributeType,Object> attributeValues)
getProviders
in interface ProviderService
ProviderService.getProviders(String, Integer, Integer, java.util.Map)
@Transactional(readOnly=true) public List<ProviderAttributeType> getAllProviderAttributeTypes()
ProviderService
getAllProviderAttributeTypes
in interface ProviderService
ProviderService.getAllProviderAttributeTypes()
@Transactional(readOnly=true) public List<ProviderAttributeType> getAllProviderAttributeTypes(boolean includeRetired)
ProviderService
getAllProviderAttributeTypes
in interface ProviderService
includeRetired
- boolean value to indicate whether to include retired records or notProviderService.getAllProviderAttributeTypes(boolean)
@Transactional(readOnly=true) public ProviderAttributeType getProviderAttributeType(Integer providerAttributeTypeId)
ProviderService
getProviderAttributeType
in interface ProviderService
providerAttributeTypeId
- the provider attribute type idProviderService.getProviderAttributeType(java.lang.Integer)
@Transactional(readOnly=true) public ProviderAttributeType getProviderAttributeTypeByUuid(String uuid)
ProviderService
getProviderAttributeTypeByUuid
in interface ProviderService
uuid
- the uuid of the provider attribute typeProviderService.getProviderAttributeTypeByUuid(java.lang.String)
@Transactional(readOnly=true) public ProviderAttributeType getProviderAttributeTypeByName(String name)
ProviderService
getProviderAttributeTypeByName
in interface ProviderService
name
- the name of the provider attribute typeProviderService.getProviderAttributeTypeByName(String)
@Transactional(readOnly=true) public ProviderAttribute getProviderAttribute(Integer providerAttributeID)
ProviderService
getProviderAttribute
in interface ProviderService
providerAttributeID
- the provider attribute ID of the providerAttributeProviderService.getProviderAttribute(java.lang.Integer)
@Transactional(readOnly=true) public ProviderAttribute getProviderAttributeByUuid(String uuid)
ProviderService
getProviderAttributeByUuid
in interface ProviderService
uuid
- the provider attribute uuid of the providerAttributeProviderService.getProviderAttributeByUuid(String)
public ProviderAttributeType saveProviderAttributeType(ProviderAttributeType providerAttributeType)
ProviderService
saveProviderAttributeType
in interface ProviderService
providerAttributeType
- the provider attribute type to be savedProviderService.saveProviderAttributeType(org.openmrs.ProviderAttributeType)
public ProviderAttributeType retireProviderAttributeType(ProviderAttributeType providerAttributeType, String reason)
ProviderService
retireProviderAttributeType
in interface ProviderService
providerAttributeType
- the provider attribute type to be retiredreason
- for retiring the provider attribute typeProviderService.retireProviderAttributeType(org.openmrs.ProviderAttributeType,
java.lang.String)
public ProviderAttributeType unretireProviderAttributeType(ProviderAttributeType providerAttributeType)
ProviderService
unretireProviderAttributeType
in interface ProviderService
providerAttributeType
- the provider type attribute to unretireProviderService.unretireProviderAttributeType(org.openmrs.ProviderAttributeType)
public void purgeProviderAttributeType(ProviderAttributeType providerAttributeType)
ProviderService
purgeProviderAttributeType
in interface ProviderService
providerAttributeType
- provider attribute type to be deleted
Should delete a provider attribute typeProviderService.purgeProviderAttributeType(org.openmrs.ProviderAttributeType)
@Transactional(readOnly=true) public boolean isProviderIdentifierUnique(Provider provider) throws APIException
ProviderService
isProviderIdentifierUnique
in interface ProviderService
provider
- the provider whose identifier to checkAPIException
- Should return false if the identifier is a duplicate
Should return true if the identifier is null
Should return true if the identifier is a blank stringProviderService.isProviderIdentifierUnique(Provider)
@Transactional(readOnly=true) public Provider getProviderByIdentifier(String identifier)
ProviderService
getProviderByIdentifier
in interface ProviderService
identifier
- the identifier to match againstProvider
Should get a provider matching the specified identifier ignoring caseProviderService.getProviderByIdentifier(java.lang.String)
@Transactional(readOnly=true) public Provider getUnknownProvider()
ProviderService
OpenmrsConstants.GP_UNKNOWN_PROVIDER_UUID
getUnknownProvider
in interface ProviderService
Provider
ProviderService.getUnknownProvider()
Copyright © 2024 OpenMRS Inc.. All rights reserved.