public class VisitServiceImpl extends BaseOpenmrsService implements VisitService
VisitService. This class should not be used on its own. The
current OpenMRS implementation should be fetched from the Context.| Constructor and Description |
|---|
VisitServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Visit |
endVisit(Visit visit,
java.util.Date stopDate)
Sets the stopDate of a given visit.
|
java.util.List<Visit> |
getActiveVisitsByPatient(Patient patient)
Convenience method that delegates to getVisitsByPatient(patient, false, false)
|
java.util.List<VisitAttributeType> |
getAllVisitAttributeTypes() |
java.util.List<Visit> |
getAllVisits()
Gets all unvoided visits in the database.
|
java.util.List<VisitType> |
getAllVisitTypes()
Gets all visit types.
|
Visit |
getVisit(java.lang.Integer visitId)
Gets a visit by its visit id.
|
VisitAttribute |
getVisitAttributeByUuid(java.lang.String uuid) |
VisitAttributeType |
getVisitAttributeType(java.lang.Integer id) |
VisitAttributeType |
getVisitAttributeTypeByUuid(java.lang.String uuid) |
Visit |
getVisitByUuid(java.lang.String uuid)
Gets a visit by its UUID.
|
VisitDAO |
getVisitDAO() |
java.util.List<Visit> |
getVisits(java.util.Collection<VisitType> visitTypes,
java.util.Collection<Patient> patients,
java.util.Collection<Location> locations,
java.util.Collection<Concept> indications,
java.util.Date minStartDatetime,
java.util.Date maxStartDatetime,
java.util.Date minEndDatetime,
java.util.Date maxEndDatetime,
java.util.Map<VisitAttributeType,java.lang.Object> attributeValues,
boolean includeInactive,
boolean includeVoided)
Gets the visits matching the specified arguments
|
java.util.List<Visit> |
getVisitsByPatient(Patient patient)
Gets all unvoided visits for the specified patient
|
java.util.List<Visit> |
getVisitsByPatient(Patient patient,
boolean includeInactive,
boolean includeVoided)
Gets all visits for the specified patient
|
VisitType |
getVisitType(java.lang.Integer visitTypeId)
Gets a visit type by its visit type id.
|
VisitType |
getVisitTypeByUuid(java.lang.String uuid)
Gets a visit type by its UUID.
|
java.util.List<VisitType> |
getVisitTypes(java.lang.String fuzzySearchPhrase)
Gets all visit types whose names are similar to or contain the given search phrase.
|
void |
purgeVisit(Visit visit)
Completely erases a visit from the database.
|
void |
purgeVisitAttributeType(VisitAttributeType visitAttributeType)
Completely removes a visit attribute type from the database
|
void |
purgeVisitType(VisitType visitType)
Completely removes a visit type from the database.
|
VisitAttributeType |
retireVisitAttributeType(VisitAttributeType visitAttributeType,
java.lang.String reason)
Retires the given visit attribute type in the database
|
VisitType |
retireVisitType(VisitType visitType,
java.lang.String reason)
Retires a given visit type.
|
Visit |
saveVisit(Visit visit)
Creates or updates the given visit in the database.
|
VisitAttributeType |
saveVisitAttributeType(VisitAttributeType visitAttributeType)
Creates or updates the given visit attribute type in the database
|
VisitType |
saveVisitType(VisitType visitType)
Creates or updates the given visit type in the database.
|
void |
setVisitDAO(VisitDAO dao)
Method used to inject the visit data access object.
|
void |
stopVisits(java.util.Date maximumStartDate)
Stops all active visits started before or on the specified date which match any of the visit
types specified by the
OpenmrsConstants.GP_VISIT_TYPES_TO_AUTO_CLOSE global property. |
VisitAttributeType |
unretireVisitAttributeType(VisitAttributeType visitAttributeType)
Restores a visit attribute type that was previous retired in the database
|
VisitType |
unretireVisitType(VisitType visitType)
Unretires a visit type.
|
Visit |
unvoidVisit(Visit visit)
Unvoids the given visit.
|
Visit |
voidVisit(Visit visit,
java.lang.String reason)
Voids the given visit.
|
onShutdown, onStartupclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonShutdown, onStartuppublic void setVisitDAO(VisitDAO dao)
dao - the visit data access object.public VisitDAO getVisitDAO()
public java.util.List<VisitType> getAllVisitTypes()
VisitServicegetAllVisitTypes in interface VisitServiceVisitService.getAllVisitTypes()public VisitType getVisitType(java.lang.Integer visitTypeId)
VisitServicegetVisitType in interface VisitServicevisitTypeId - the visit type id.VisitService.getVisitType(java.lang.Integer)public VisitType getVisitTypeByUuid(java.lang.String uuid)
VisitServicegetVisitTypeByUuid in interface VisitServiceuuid - the visit type UUID.VisitService.getVisitTypeByUuid(java.lang.String)public java.util.List<VisitType> getVisitTypes(java.lang.String fuzzySearchPhrase)
VisitServicegetVisitTypes in interface VisitServicefuzzySearchPhrase - the search phrase to use.VisitService.getVisitTypes(java.lang.String)public VisitType saveVisitType(VisitType visitType) throws APIException
VisitServicesaveVisitType in interface VisitServicevisitType - the visit type to create or update.APIExceptionVisitService.saveVisitType(org.openmrs.VisitType)public VisitType retireVisitType(VisitType visitType, java.lang.String reason)
VisitServiceretireVisitType in interface VisitServicevisitType - the visit type to retire.reason - the reason why the visit type is retired.VisitService.retireVisitType(org.openmrs.VisitType, java.lang.String)public VisitType unretireVisitType(VisitType visitType)
VisitServiceunretireVisitType in interface VisitServicevisitType - the visit type to unretire.VisitService.unretireVisitType(org.openmrs.VisitType)public void purgeVisitType(VisitType visitType)
VisitServicepurgeVisitType in interface VisitServicevisitType - the visit type to delete from the database.VisitService.purgeVisitType(org.openmrs.VisitType)public java.util.List<Visit> getAllVisits() throws APIException
VisitServicegetAllVisits in interface VisitServiceAPIExceptionVisitService.getAllVisits()public Visit getVisit(java.lang.Integer visitId) throws APIException
VisitServicegetVisit in interface VisitServicevisitId - the visit id.APIExceptionVisitService.getVisit(java.lang.Integer)public Visit getVisitByUuid(java.lang.String uuid) throws APIException
VisitServicegetVisitByUuid in interface VisitServiceuuid - the visit UUID.APIExceptionVisitService.getVisitByUuid(java.lang.String)public Visit saveVisit(Visit visit) throws APIException
VisitServicesaveVisit in interface VisitServicevisit - the visit to create or update.APIExceptionVisitService.saveVisit(org.openmrs.Visit)public Visit endVisit(Visit visit, java.util.Date stopDate)
VisitServiceendVisit in interface VisitServicevisit - the visit whose stopDate is to be setstopDate - the date and time the visit is ending. if null, current date is usedVisitService.endVisit(org.openmrs.Visit,java.util.Date)public Visit voidVisit(Visit visit, java.lang.String reason) throws APIException
VisitServicevoidVisit in interface VisitServicevisit - the visit to void.reason - the reason why the visit is voidedAPIExceptionVisitService.voidVisit(org.openmrs.Visit, java.lang.String)public Visit unvoidVisit(Visit visit) throws APIException
VisitServiceunvoidVisit in interface VisitServicevisit - the visit to unvoidAPIExceptionVisitService.unvoidVisit(org.openmrs.Visit)public void purgeVisit(Visit visit) throws APIException
VisitServicepurgeVisit in interface VisitServicevisit - the visit to delete from the database.APIExceptionVisitService.purgeVisit(org.openmrs.Visit)public java.util.List<Visit> getVisits(java.util.Collection<VisitType> visitTypes, java.util.Collection<Patient> patients, java.util.Collection<Location> locations, java.util.Collection<Concept> indications, java.util.Date minStartDatetime, java.util.Date maxStartDatetime, java.util.Date minEndDatetime, java.util.Date maxEndDatetime, java.util.Map<VisitAttributeType,java.lang.Object> attributeValues, boolean includeInactive, boolean includeVoided) throws APIException
VisitServicegetVisits in interface VisitServicevisitTypes - a list of visit types to match againstlocations - a list of locations to match againstindications - a list of indication concepts to match againstminStartDatetime - the minimum visit start date to match againstmaxStartDatetime - the maximum visit start date to match againstminEndDatetime - the minimum visit end date to match againstmaxEndDatetime - the maximum visit end date to match againstincludeInactive - if false, the min/maxEndDatetime parameters are ignored and only open
visits are returnedincludeVoided - specifies if voided visits should also be returnedAPIExceptionorg.openmrs.api.VisitService#getVisits(java.util.Collection, java.util.Collection,
java.util.Collection, java.util.Collection, java.util.Date, java.util.Date,
java.util.Date, java.util.Date, boolean, boolean)public java.util.List<Visit> getVisitsByPatient(Patient patient) throws APIException
VisitServicegetVisitsByPatient in interface VisitServicepatient - the patient whose visits to getAPIExceptionVisitService.getVisitsByPatient(org.openmrs.Patient)public java.util.List<Visit> getActiveVisitsByPatient(Patient patient) throws APIException
VisitServicegetActiveVisitsByPatient in interface VisitServicepatient - the patient whose visits to getAPIExceptionVisitService.getActiveVisitsByPatient(org.openmrs.Patient)public java.util.List<Visit> getVisitsByPatient(Patient patient, boolean includeInactive, boolean includeVoided) throws APIException
VisitServicegetVisitsByPatient in interface VisitServicepatient - the patient whose visits to getAPIExceptionVisitService.getVisitsByPatient(org.openmrs.Patient, boolean, boolean)public java.util.List<VisitAttributeType> getAllVisitAttributeTypes()
getAllVisitAttributeTypes in interface VisitServiceVisitAttributeTypesVisitService.getAllVisitAttributeTypes()public VisitAttributeType getVisitAttributeType(java.lang.Integer id)
getVisitAttributeType in interface VisitServiceVisitAttributeType with the given internal idVisitService.getVisitAttributeType(java.lang.Integer)public VisitAttributeType getVisitAttributeTypeByUuid(java.lang.String uuid)
getVisitAttributeTypeByUuid in interface VisitServiceVisitAttributeType with the given uuidVisitService.getVisitAttributeTypeByUuid(java.lang.String)public VisitAttributeType saveVisitAttributeType(VisitAttributeType visitAttributeType)
VisitServicesaveVisitAttributeType in interface VisitServiceVisitService.saveVisitAttributeType(org.openmrs.VisitAttributeType)public VisitAttributeType retireVisitAttributeType(VisitAttributeType visitAttributeType, java.lang.String reason)
VisitServiceretireVisitAttributeType in interface VisitServiceVisitService.retireVisitAttributeType(org.openmrs.VisitAttributeType,
java.lang.String)public VisitAttributeType unretireVisitAttributeType(VisitAttributeType visitAttributeType)
VisitServiceunretireVisitAttributeType in interface VisitServiceVisitService.unretireVisitAttributeType(org.openmrs.VisitAttributeType)public void purgeVisitAttributeType(VisitAttributeType visitAttributeType)
VisitServicepurgeVisitAttributeType in interface VisitServiceVisitService.purgeVisitAttributeType(org.openmrs.VisitAttributeType)public VisitAttribute getVisitAttributeByUuid(java.lang.String uuid)
getVisitAttributeByUuid in interface VisitServiceVisitAttribute with the given uuidVisitService.getVisitAttributeByUuid(java.lang.String)public void stopVisits(java.util.Date maximumStartDate)
VisitServiceOpenmrsConstants.GP_VISIT_TYPES_TO_AUTO_CLOSE global property.
If startDatetime is null, the default will be end of the current day.stopVisits in interface VisitServicemaximumStartDate - Visits started on or before this date time value will get stoppedVisitService.stopVisits(Date)Copyright © 2018 OpenMRS Inc.. All Rights Reserved.