org.openmrs.api
Interface EncounterService

All Superinterfaces:
OpenmrsService
All Known Implementing Classes:
EncounterServiceImpl

@Transactional
public interface EncounterService
extends OpenmrsService

Services for Encounters and Encounter Types

Version:
1.0

Method Summary
 void createEncounter(Encounter encounter)
          Deprecated. replaced by saveEncounter(Encounter)
 void deleteEncounter(Encounter encounter)
          Deprecated. replaced by #purgeEncounter(encounter)
 java.util.List<EncounterType> findEncounterTypes(java.lang.String name)
          Find Encounter Types with name matching the beginning of the search string.
 java.util.List<Location> findLocations(java.lang.String name)
          Deprecated. replaced by org.openmrs.api.LocationService.findLocations(name)
 java.util.List<EncounterType> getAllEncounterTypes()
          Get all encounter types (not retired)
 java.util.List<EncounterType> getAllEncounterTypes(boolean includeRetired)
          Get all encounter types.
 Encounter getEncounter(java.lang.Integer encounterId)
          Get encounter by internal identifier
 java.util.Collection<Encounter> getEncounters(java.util.Date fromDate, java.util.Date toDate)
          Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)
 java.util.Collection<Encounter> getEncounters(Location loc, java.util.Date fromDate, java.util.Date toDate)
          Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)
 java.util.List<Encounter> getEncounters(Patient who)
          Deprecated. replaced by getEncountersByPatient(Patient)
 java.util.List<Encounter> getEncounters(Patient who, boolean includeVoided)
          Deprecated. replaced by getEncountersByPatient(Patient)
 java.util.List<Encounter> getEncounters(Patient who, java.util.Date fromDate, java.util.Date toDate)
          Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)
 java.util.List<Encounter> getEncounters(Patient who, Location where)
          Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)
 java.util.List<Encounter> getEncounters(Patient who, Location loc, java.util.Date fromDate, java.util.Date toDate, java.util.Collection<Form> enteredViaForms, java.util.Collection<EncounterType> encounterTypes, boolean includeVoided)
          Get all encounters that match a variety of (nullable) criteria
 java.util.List<Encounter> getEncountersByPatient(Patient patient)
          Get all encounters (not voided) for a patient.
 java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId)
          Get encounters for a patientId
 java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId, boolean includeVoided)
          Deprecated. replaced by getEncountersByPatientId(Integer)
 java.util.List<Encounter> getEncountersByPatientIdentifier(java.lang.String identifier)
          Get encounters (not voided) for a patient identifier
 java.util.List<Encounter> getEncountersByPatientIdentifier(java.lang.String identifier, boolean includeVoided)
          Deprecated. replaced by getEncountersByPatientIdentifier(String)
 EncounterType getEncounterType(java.lang.Integer encounterTypeId)
          Get encounterType by internal identifier
 EncounterType getEncounterType(java.lang.String name)
          Get encounterType by name
 java.util.List<EncounterType> getEncounterTypes()
          Deprecated. replaced by getAllEncounterTypes()
 Location getLocation(java.lang.Integer locationId)
          Deprecated. replaced by org.openmrs.api.LocationService.getLocationByLocationId(locationId)
 Location getLocationByName(java.lang.String name)
          Deprecated. replaced by org.openmrs.api.LocationService.getLocationByName(name)
 java.util.List<Location> getLocations()
          Deprecated. replaced by org.openmrs.api.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.
 void retireEncounterType(EncounterType encounterType, java.lang.String reason)
          Retire an EncounterType.
 void saveEncounter(Encounter encounter)
          Saves a new encounter or updates an existing encounter.
 void 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.
 void unretireEncounterType(EncounterType encounterType)
          Unretire an EncounterType
 void unvoidEncounter(Encounter encounter)
          Unvoid encounter record
 void updateEncounter(Encounter encounter)
          Deprecated. replaced by saveEncounter(Encounter)
 void voidEncounter(Encounter encounter, java.lang.String reason)
          Voiding a encounter essentially removes it from circulation
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Method Detail

setEncounterDAO

void setEncounterDAO(EncounterDAO dao)
Set the given dao on this encounter service. The dao will act as the conduit through with all encounter calls get to the database

Parameters:
dao -

saveEncounter

@Authorized(value={"Add Encounters","Edit Encounters"})
void saveEncounter(Encounter encounter)
                   throws APIException
Saves a new encounter or updates an existing encounter. If an existing encounter, this method will automatically apply encounter.patient to all encounter.obs.patient

Parameters:
encounter - to be saved
Throws:
APIException

getEncounter

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
Encounter getEncounter(java.lang.Integer encounterId)
                       throws APIException
Get encounter by internal identifier

Parameters:
encounterId - encounter id
Returns:
encounter with given internal identifier
Throws:
APIException

getEncountersByPatient

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncountersByPatient(Patient patient)
Get all encounters (not voided) for a patient.

Parameters:
patient -
Returns:
List encounters (not voided) for a patient.

getEncountersByPatientId

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId)
                                                   throws APIException
Get encounters for a patientId

Parameters:
patientId -
Returns:
all encounters (not retired) for the given patient identifer
Throws:
APIException

getEncountersByPatientIdentifier

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncountersByPatientIdentifier(java.lang.String identifier)
                                                           throws APIException
Get encounters (not voided) for a patient identifier

Parameters:
identifier -
Returns:
all encounters (not retired) for the given patient identifer
Throws:
APIException

getEncounters

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncounters(Patient who,
                                                                      Location loc,
                                                                      java.util.Date fromDate,
                                                                      java.util.Date toDate,
                                                                      java.util.Collection<Form> enteredViaForms,
                                                                      java.util.Collection<EncounterType> encounterTypes,
                                                                      boolean includeVoided)
Get all encounters that match a variety of (nullable) criteria

Parameters:
who -
loc -
fromDate -
toDate -
enteredViaForms -
encounterTypes -
includeVoided -
Returns:

voidEncounter

@Authorized(value="Edit Encounters")
void voidEncounter(Encounter encounter,
                                   java.lang.String reason)
Voiding a encounter essentially removes it from circulation

Parameters:
Encounter - encounter
String - reason

unvoidEncounter

@Authorized(value="Edit Encounters")
void unvoidEncounter(Encounter encounter)
                     throws APIException
Unvoid encounter record

Parameters:
encounter - encounter to be revived
Throws:
APIException

purgeEncounter

@Authorized(value="Purge Encounters")
void purgeEncounter(Encounter encounter)
                    throws APIException
Completely remove an encounter from database. For super users only. If dereferencing encounters, use voidEncounter(org.openmrs.Encounter)

Parameters:
encounter - encounter object to be purged
Throws:
APIException

purgeEncounter

@Authorized(value="Purge Encounters")
void purgeEncounter(Encounter encounter,
                                    boolean cascade)
                    throws APIException
Completely remove an encounter from database. For super users only. If dereferencing encounters, use voidEncounter(org.openmrs.Encounter)

Parameters:
encounter - encounter object to be purged
cascade - also purge observations
Throws:
APIException

saveEncounterType

@Authorized(value="Manage Encounter Types")
void saveEncounterType(EncounterType encounterType)
Save a new Encounter Type or update an existing Encounter Type.

Parameters:
encounterType -

getEncounterType

@Transactional(readOnly=true)
@Authorized(value="View Encounter Types")
EncounterType getEncounterType(java.lang.Integer encounterTypeId)
                               throws APIException
Get encounterType by internal identifier

Parameters:
encounterType - id
Returns:
encounterType with given internal identifier
Throws:
APIException

getEncounterType

@Transactional(readOnly=true)
@Authorized(value="View Encounter Types")
EncounterType getEncounterType(java.lang.String name)
                               throws APIException
Get encounterType by name

Parameters:
encounterType - string
Returns:
EncounterType
Throws:
APIException

getAllEncounterTypes

@Transactional(readOnly=true)
@Authorized(value="View Encounter Types")
java.util.List<EncounterType> getAllEncounterTypes()
                                                   throws APIException
Get all encounter types (not retired)

Returns:
encounter types list
Throws:
APIException

getAllEncounterTypes

@Transactional(readOnly=true)
@Authorized(value="View Encounter Types")
java.util.List<EncounterType> getAllEncounterTypes(boolean includeRetired)
                                                   throws APIException
Get all encounter types. If includeRetired is true, also get retired encounter types.

Parameters:
includeRetired -
Returns:
encounter types list
Throws:
APIException

findEncounterTypes

@Transactional(readOnly=true)
@Authorized(value="View Encounter Types")
java.util.List<EncounterType> findEncounterTypes(java.lang.String name)
                                                 throws APIException
Find Encounter Types with name matching the beginning of the search string. Search strings are case insensitive so that "NaMe".equals("name") is true. Includes retired EncounterTypes.

Parameters:
name - of the encounter type to find
Returns:
List matching encounters
Throws:
APIException

retireEncounterType

@Authorized(value="Manage Encounter Types")
void retireEncounterType(EncounterType encounterType,
                                         java.lang.String reason)
                         throws APIException
Retire an EncounterType.

Parameters:
encounterType -
reason -
Throws:
APIException

unretireEncounterType

@Authorized(value="Manage Encounter Types")
void unretireEncounterType(EncounterType encounterType)
                           throws APIException
Unretire an EncounterType

Parameters:
encounterType -
Throws:
APIException

purgeEncounterType

@Authorized(value="Purge Encounter Types")
void purgeEncounterType(EncounterType encounterType)
                        throws APIException
Completely remove an encounter type from database.

Parameters:
encounterType -
Throws:
APIException

createEncounter

@Authorized(value="Add Encounters")
void createEncounter(Encounter encounter)
                     throws APIException
Deprecated. replaced by saveEncounter(Encounter)

Creates a new encounter

Parameters:
encounter - to be created
Throws:
APIException

updateEncounter

@Authorized(value="Edit Encounters")
void updateEncounter(Encounter encounter)
                     throws APIException
Deprecated. replaced by saveEncounter(Encounter)

Save changes to encounter. Automatically applys encounter.patient to all encounter.obs.patient

Parameters:
encounter -
Throws:
APIException

deleteEncounter

@Authorized(value="Delete Encounters")
void deleteEncounter(Encounter encounter)
                     throws APIException
Deprecated. replaced by #purgeEncounter(encounter)

Delete encounter from database. For super users only. If dereferencing encounters, use voidEncounter(org.openmrs.Encounter)

Parameters:
encounter - encounter object to be deleted
Throws:
APIException

getEncountersByPatientId

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncountersByPatientId(java.lang.Integer patientId,
                                                                                 boolean includeVoided)
                                                   throws APIException
Deprecated. replaced by getEncountersByPatientId(Integer)

Get encounters for a patientId (not voided). To include voided Encounters use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)

Parameters:
patientId -
includeVoided - No longer supported
Returns:
all encounters for the given patient identifer
Throws:
APIException

getEncountersByPatientIdentifier

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncountersByPatientIdentifier(java.lang.String identifier,
                                                                                         boolean includeVoided)
                                                           throws APIException
Deprecated. replaced by getEncountersByPatientIdentifier(String)

Get encounters (not voided) for a patient identifier. To include voided encounters use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)

Parameters:
identifier -
includeVoided - No longer supported.
Returns:
all encounters for the given patient identifer
Throws:
APIException

getEncounters

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncounters(Patient who)
Deprecated. replaced by getEncountersByPatient(Patient)

Get all encounters (not voided) for a patient

Parameters:
who -
Returns:
List encounters (not voided) for a patient

getEncounters

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncounters(Patient who,
                                                                      boolean includeVoided)
Deprecated. replaced by getEncountersByPatient(Patient)

Get all encounters (not voided) for a patient. To include voided encounters, use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)

Parameters:
who -
includeVoided - No longer supported.
Returns:

getEncounters

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncounters(Patient who,
                                                                      Location where)
Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)

Get all encounters for a patient that took place at a specific location

Parameters:
who -
where -
Returns:

getEncounters

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.List<Encounter> getEncounters(Patient who,
                                                                      java.util.Date fromDate,
                                                                      java.util.Date toDate)
Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)

Get all encounters for a patient that took place between fromDate and toDate (both nullable and inclusive)

Parameters:
who -
fromDate -
toDate -
Returns:

getEncounters

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.Collection<Encounter> getEncounters(java.util.Date fromDate,
                                                                            java.util.Date toDate)
Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)

Get all encounters that took place between fromDate and toDate (both nullable and inclusive)

Parameters:
fromDate -
toDate -
Returns:

getEncounters

@Transactional(readOnly=true)
@Authorized(value="View Encounters")
java.util.Collection<Encounter> getEncounters(Location loc,
                                                                            java.util.Date fromDate,
                                                                            java.util.Date toDate)
Deprecated. use getEncounters(Patient, Location, Date, Date, Collection, Collection, boolean)

Get all encounters that took place between fromDate and toDate (both nullable and inclusive) at the given location

Parameters:
loc - Location
fromDate -
toDate -
Returns:

getEncounterTypes

@Transactional(readOnly=true)
@Authorized(value="View Encounter Types")
java.util.List<EncounterType> getEncounterTypes()
                                                throws APIException
Deprecated. replaced by getAllEncounterTypes()

Get all encounter types (not retired)

Returns:
Throws:
APIException

getLocations

@Transactional(readOnly=true)
@Authorized(value="View Locations")
java.util.List<Location> getLocations()
                                      throws APIException
Deprecated. replaced by org.openmrs.api.LocationService.getAllLocations( )

Get all locations

Returns:
location list
Throws:
APIException

getLocation

@Transactional(readOnly=true)
@Authorized(value="View Locations")
Location getLocation(java.lang.Integer locationId)
                     throws APIException
Deprecated. replaced by org.openmrs.api.LocationService.getLocationByLocationId(locationId)

Get location by internal identifier

Parameters:
location - id
Returns:
location with given internal identifier
Throws:
APIException

getLocationByName

@Transactional(readOnly=true)
@Authorized(value="View Locations")
Location getLocationByName(java.lang.String name)
                           throws APIException
Deprecated. replaced by org.openmrs.api.LocationService.getLocationByName(name)

Get location by name

Parameters:
name - location's name
Returns:
location with given name
Throws:
APIException

findLocations

@Transactional(readOnly=true)
@Authorized(value="View Locations")
java.util.List<Location> findLocations(java.lang.String name)
                                       throws APIException
Deprecated. replaced by org.openmrs.api.LocationService.findLocations(name)

Search for locations by name. Matches returned match the given string at the beginning of the name

Parameters:
name - location's name
Returns:
list of locations with similar name
Throws:
APIException

OpenMRS-trunk

Generated May 29 2008 02:01 AM. NOTE - these libraries are in active development and subject to change