@Transactional public interface EncounterService extends OpenmrsService
| Modifier and Type | Method and Description |
|---|---|
void |
checkIfEncounterTypesAreLocked()
Check if the encounter types are locked, and if so, throw exception during manipulation of encounter type
|
void |
createEncounter(Encounter encounter)
Deprecated.
replaced by
saveEncounter(Encounter) |
void |
deleteEncounter(Encounter encounter)
Deprecated.
replaced by
purgeEncounter(Encounter) |
List<EncounterType> |
findEncounterTypes(String name)
Find Encounter Types with name matching the beginning of the search string.
|
List<Location> |
findLocations(String name)
Deprecated.
replaced by
LocationService.getLocations(String) |
Map<Integer,List<Encounter>> |
getAllEncounters(Cohort patients)
Get all encounters for a cohort of patients
|
List<EncounterType> |
getAllEncounterTypes()
Get all encounter types (including retired)
|
List<EncounterType> |
getAllEncounterTypes(boolean includeRetired)
Get all encounter types.
|
Integer |
getCountOfEncounters(String query,
boolean includeVoided)
Return the number of encounters matching a patient name or patient identifier
|
Encounter |
getEncounter(Integer encounterId)
Get encounter by internal identifier
|
Encounter |
getEncounterByUuid(String uuid)
Get Encounter by its UUID
|
Collection<Encounter> |
getEncounters(Date fromDate,
Date toDate)
|
Collection<Encounter> |
getEncounters(Location loc,
Date fromDate,
Date toDate)
|
List<Encounter> |
getEncounters(Patient who)
Deprecated.
replaced by
getEncountersByPatient(Patient) |
List<Encounter> |
getEncounters(Patient who,
boolean includeVoided)
Deprecated.
replaced by
getEncountersByPatient(Patient) |
List<Encounter> |
getEncounters(Patient who,
Date fromDate,
Date toDate)
|
List<Encounter> |
getEncounters(Patient who,
Location where)
|
List<Encounter> |
getEncounters(Patient who,
Location loc,
Date fromDate,
Date toDate,
Collection<Form> enteredViaForms,
Collection<EncounterType> encounterTypes,
boolean includeVoided)
Deprecated.
|
List<Encounter> |
getEncounters(Patient who,
Location loc,
Date fromDate,
Date toDate,
Collection<Form> enteredViaForms,
Collection<EncounterType> encounterTypes,
Collection<User> providers,
boolean includeVoided)
Get all encounters that match a variety of (nullable) criteria.
|
List<Encounter> |
getEncounters(String query,
Integer start,
Integer length,
boolean includeVoided)
Search for encounters by patient name or patient identifier and returns a specific number of
them from the specified starting position.
|
List<Encounter> |
getEncountersByPatient(Patient patient)
Get all encounters (not voided) for a patient, sorted by encounterDatetime ascending.
|
List<Encounter> |
getEncountersByPatient(String query)
Search for encounters by patient name or patient identifier.
|
List<Encounter> |
getEncountersByPatient(String query,
boolean includeVoided)
Search for encounters by patient name or patient identifier.
|
List<Encounter> |
getEncountersByPatientId(Integer patientId)
Get encounters for a patientId
|
List<Encounter> |
getEncountersByPatientId(Integer patientId,
boolean includeVoided)
Deprecated.
replaced by
getEncountersByPatientId(Integer) |
List<Encounter> |
getEncountersByPatientIdentifier(String identifier)
Get encounters (not voided) for a patient identifier
|
List<Encounter> |
getEncountersByPatientIdentifier(String identifier,
boolean includeVoided)
Deprecated.
replaced by
getEncountersByPatientIdentifier(String) |
EncounterType |
getEncounterType(Integer encounterTypeId)
Get encounterType by internal identifier
|
EncounterType |
getEncounterType(String name)
Get encounterType by exact name
|
EncounterType |
getEncounterTypeByUuid(String uuid)
Get EncounterType by its UUID
|
List<EncounterType> |
getEncounterTypes()
Deprecated.
replaced by
getAllEncounterTypes() |
Location |
getLocation(Integer locationId)
Deprecated.
replaced by
LocationService.getLocation(Integer) |
Location |
getLocationByName(String name)
Deprecated.
replaced by
LocationService.getLocation(String) |
List<Location> |
getLocations()
Deprecated.
replaced by
LocationService.getAllLocations() |
void |
purgeEncounter(Encounter encounter)
Completely remove an encounter from database.
|
void |
purgeEncounter(Encounter encounter,
boolean cascade)
Completely remove an encounter from database.
|
void |
purgeEncounterType(EncounterType encounterType)
Completely remove an encounter type from database.
|
EncounterType |
retireEncounterType(EncounterType encounterType,
String reason)
Retire an EncounterType.
|
Encounter |
saveEncounter(Encounter encounter)
Saves a new encounter or updates an existing encounter.
|
EncounterType |
saveEncounterType(EncounterType encounterType)
Save a new Encounter Type or update an existing Encounter Type.
|
void |
setEncounterDAO(EncounterDAO dao)
Set the given
dao on this encounter service. |
EncounterType |
unretireEncounterType(EncounterType encounterType)
Unretire an EncounterType.
|
Encounter |
unvoidEncounter(Encounter encounter)
Unvoid encounter record
|
void |
updateEncounter(Encounter encounter)
Deprecated.
replaced by
saveEncounter(Encounter) |
Encounter |
voidEncounter(Encounter encounter,
String reason)
Voiding a encounter essentially removes it from circulation
|
onShutdown, onStartupvoid setEncounterDAO(EncounterDAO dao)
dao on this encounter service. The dao will act as the conduit
through with all encounter calls get to the databasedao - @Authorized(value={"Add Encounters","Edit Encounters"}) Encounter saveEncounter(Encounter encounter) throws APIException
encounter - to be savedAPIException@Transactional(readOnly=true) @Authorized(value="View Encounters") Encounter getEncounter(Integer encounterId) throws APIException
encounterId - encounter idAPIException@Transactional(readOnly=true) @Authorized(value="View Encounters") Encounter getEncounterByUuid(String uuid) throws APIException
uuid - APIException@Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncountersByPatient(Patient patient)
patient - @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncountersByPatientId(Integer patientId) throws APIException
patientId - APIException@Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncountersByPatientIdentifier(String identifier) throws APIException
identifier - APIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncounters(Patient who, Location loc, Date fromDate, Date toDate, Collection<Form> enteredViaForms, Collection<EncounterType> encounterTypes, boolean includeVoided)
getEncounters(Patient, Location, Date, Date, Collection, Collection, Collection, boolean)@Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncounters(Patient who, Location loc, Date fromDate, Date toDate, Collection<Form> enteredViaForms, Collection<EncounterType> encounterTypes, Collection<User> providers, boolean includeVoided)
who - the patient the encounter is forloc - the location this encounter took placefromDate - the minimum date (inclusive) this encounter took placetoDate - the maximum date (exclusive) this encounter took placeenteredViaForms - the form that entered this encounter must be in this listencounterTypes - the type of encounter must be in this listproviders - the provider of this encounter must be in this listincludeVoided - true/false to include the voided encounters or not@Authorized(value="Edit Encounters") Encounter voidEncounter(Encounter encounter, String reason)
encounter - Encounter object to voidreason - String reason that it's being voided@Authorized(value="Edit Encounters") Encounter unvoidEncounter(Encounter encounter) throws APIException
encounter - Encounter to be revivedAPIException@Authorized(value="Purge Encounters") void purgeEncounter(Encounter encounter) throws APIException
voidEncounter(org.openmrs.Encounter)encounter - encounter object to be purgedAPIException@Authorized(value="Purge Encounters") void purgeEncounter(Encounter encounter, boolean cascade) throws APIException
voidEncounter(org.openmrs.Encounter)encounter - encounter object to be purgedcascade - Purge any related observations as well?APIException@Authorized(value="Manage Encounter Types") EncounterType saveEncounterType(EncounterType encounterType) throws APIException
encounterType - APIException@Transactional(readOnly=true) @Authorized(value="View Encounter Types") EncounterType getEncounterType(Integer encounterTypeId) throws APIException
encounterTypeId - IntegerAPIException@Transactional(readOnly=true) @Authorized(value="View Encounter Types") EncounterType getEncounterTypeByUuid(String uuid) throws APIException
uuid - APIException@Transactional(readOnly=true) @Authorized(value="View Encounter Types") EncounterType getEncounterType(String name) throws APIException
name - string to match to an Encounter.nameAPIException@Transactional(readOnly=true) @Authorized(value="View Encounter Types") List<EncounterType> getAllEncounterTypes() throws APIException
APIException@Transactional(readOnly=true) @Authorized(value="View Encounter Types") List<EncounterType> getAllEncounterTypes(boolean includeRetired) throws APIException
includeRetired - APIException@Transactional(readOnly=true) @Authorized(value="View Encounter Types") List<EncounterType> findEncounterTypes(String name) throws APIException
name - of the encounter type to findAPIException@Authorized(value="Manage Encounter Types") EncounterType retireEncounterType(EncounterType encounterType, String reason) throws APIException
encounterType - the encounter type to retirereason - required non-null purpose for retiring this encounter typeAPIException@Authorized(value="Manage Encounter Types") EncounterType unretireEncounterType(EncounterType encounterType) throws APIException
encounterType - the encounter type to unretireAPIException@Authorized(value="Purge Encounter Types") void purgeEncounterType(EncounterType encounterType) throws APIException
encounterType - APIException@Deprecated @Authorized(value="Add Encounters") void createEncounter(Encounter encounter) throws APIException
saveEncounter(Encounter)encounter - to be createdAPIException@Deprecated @Authorized(value="Edit Encounters") void updateEncounter(Encounter encounter) throws APIException
saveEncounter(Encounter)encounter - APIException@Deprecated @Authorized(value="Delete Encounters") void deleteEncounter(Encounter encounter) throws APIException
purgeEncounter(Encounter)voidEncounter(org.openmrs.Encounter)encounter - encounter object to be deletedAPIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncountersByPatientId(Integer patientId, boolean includeVoided) throws APIException
getEncountersByPatientId(Integer)getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)patientId - includeVoided - No longer supportedAPIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncountersByPatientIdentifier(String identifier, boolean includeVoided) throws APIException
getEncountersByPatientIdentifier(String)getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)identifier - includeVoided - No longer supported.APIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncounters(Patient who)
getEncountersByPatient(Patient)who - @Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncounters(Patient who, boolean includeVoided)
getEncountersByPatient(Patient)getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)who - includeVoided - No longer supported.@Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncounters(Patient who, Location where)
who - where - @Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncounters(Patient who, Date fromDate, Date toDate)
who - fromDate - toDate - @Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") Collection<Encounter> getEncounters(Date fromDate, Date toDate)
fromDate - toDate - @Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounters") Collection<Encounter> getEncounters(Location loc, Date fromDate, Date toDate)
loc - LocationfromDate - toDate - @Deprecated @Transactional(readOnly=true) @Authorized(value="View Encounter Types") List<EncounterType> getEncounterTypes() throws APIException
getAllEncounterTypes()APIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Locations") List<Location> getLocations() throws APIException
LocationService.getAllLocations()APIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Locations") Location getLocation(Integer locationId) throws APIException
LocationService.getLocation(Integer)locationId - APIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Locations") Location getLocationByName(String name) throws APIException
LocationService.getLocation(String)name - location's nameAPIException@Deprecated @Transactional(readOnly=true) @Authorized(value="View Locations") List<Location> findLocations(String name) throws APIException
LocationService.getLocations(String)name - location's nameAPIException@Authorized(value="View Encounters") List<Encounter> getEncountersByPatient(String query) throws APIException
query - patient name or identifierAPIExceptionEncounterService}{@link #getEncountersByPatient(String, boolean)}@Authorized(value="View Encounters") List<Encounter> getEncountersByPatient(String query, boolean includeVoided) throws APIException
query - patient name or identifierincludeVoided - Specifies whether voided encounters should be includedAPIException@Transactional(readOnly=true) @Authorized(value="View Encounters") List<Encounter> getEncounters(String query, Integer start, Integer length, boolean includeVoided) throws APIException
query - patient name or identifierstart - beginning index for the batchlength - number of encounters to return in the batchincludeVoided - Specifies whether voided encounters should be includedAPIException@Transactional(readOnly=true) Map<Integer,List<Encounter>> getAllEncounters(Cohort patients)
patients - Cohort of patients to search@Transactional(readOnly=true) @Authorized(value="View Encounters") Integer getCountOfEncounters(String query, boolean includeVoided)
query - patient name or identifierincludeVoided - Specifies whether voided encounters should be included@Transactional(readOnly=true)
void checkIfEncounterTypesAreLocked()
throws EncounterTypeLockedException
EncounterTypeLockedExceptionCopyright © 2018 OpenMRS LLC.. All Rights Reserved.