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, onStartup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onShutdown, onStartup
public void setVisitDAO(VisitDAO dao)
dao
- the visit data access object.public VisitDAO getVisitDAO()
public java.util.List<VisitType> getAllVisitTypes()
VisitService
getAllVisitTypes
in interface VisitService
VisitService.getAllVisitTypes()
public VisitType getVisitType(java.lang.Integer visitTypeId)
VisitService
getVisitType
in interface VisitService
visitTypeId
- the visit type id.VisitService.getVisitType(java.lang.Integer)
public VisitType getVisitTypeByUuid(java.lang.String uuid)
VisitService
getVisitTypeByUuid
in interface VisitService
uuid
- the visit type UUID.VisitService.getVisitTypeByUuid(java.lang.String)
public java.util.List<VisitType> getVisitTypes(java.lang.String fuzzySearchPhrase)
VisitService
getVisitTypes
in interface VisitService
fuzzySearchPhrase
- the search phrase to use.VisitService.getVisitTypes(java.lang.String)
public VisitType saveVisitType(VisitType visitType) throws APIException
VisitService
saveVisitType
in interface VisitService
visitType
- the visit type to create or update.APIException
VisitService.saveVisitType(org.openmrs.VisitType)
public VisitType retireVisitType(VisitType visitType, java.lang.String reason)
VisitService
retireVisitType
in interface VisitService
visitType
- 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)
VisitService
unretireVisitType
in interface VisitService
visitType
- the visit type to unretire.VisitService.unretireVisitType(org.openmrs.VisitType)
public void purgeVisitType(VisitType visitType)
VisitService
purgeVisitType
in interface VisitService
visitType
- the visit type to delete from the database.VisitService.purgeVisitType(org.openmrs.VisitType)
public java.util.List<Visit> getAllVisits() throws APIException
VisitService
getAllVisits
in interface VisitService
APIException
VisitService.getAllVisits()
public Visit getVisit(java.lang.Integer visitId) throws APIException
VisitService
getVisit
in interface VisitService
visitId
- the visit id.APIException
VisitService.getVisit(java.lang.Integer)
public Visit getVisitByUuid(java.lang.String uuid) throws APIException
VisitService
getVisitByUuid
in interface VisitService
uuid
- the visit UUID.APIException
VisitService.getVisitByUuid(java.lang.String)
public Visit saveVisit(Visit visit) throws APIException
VisitService
saveVisit
in interface VisitService
visit
- the visit to create or update.APIException
VisitService.saveVisit(org.openmrs.Visit)
public Visit endVisit(Visit visit, java.util.Date stopDate)
VisitService
endVisit
in interface VisitService
visit
- 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
VisitService
voidVisit
in interface VisitService
visit
- the visit to void.reason
- the reason why the visit is voidedAPIException
VisitService.voidVisit(org.openmrs.Visit, java.lang.String)
public Visit unvoidVisit(Visit visit) throws APIException
VisitService
unvoidVisit
in interface VisitService
visit
- the visit to unvoidAPIException
VisitService.unvoidVisit(org.openmrs.Visit)
public void purgeVisit(Visit visit) throws APIException
VisitService
purgeVisit
in interface VisitService
visit
- the visit to delete from the database.APIException
VisitService.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
VisitService
getVisits
in interface VisitService
visitTypes
- 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 returnedAPIException
org.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
VisitService
getVisitsByPatient
in interface VisitService
patient
- the patient whose visits to getAPIException
VisitService.getVisitsByPatient(org.openmrs.Patient)
public java.util.List<Visit> getActiveVisitsByPatient(Patient patient) throws APIException
VisitService
getActiveVisitsByPatient
in interface VisitService
patient
- the patient whose visits to getAPIException
VisitService.getActiveVisitsByPatient(org.openmrs.Patient)
public java.util.List<Visit> getVisitsByPatient(Patient patient, boolean includeInactive, boolean includeVoided) throws APIException
VisitService
getVisitsByPatient
in interface VisitService
patient
- the patient whose visits to getAPIException
VisitService.getVisitsByPatient(org.openmrs.Patient, boolean, boolean)
public java.util.List<VisitAttributeType> getAllVisitAttributeTypes()
getAllVisitAttributeTypes
in interface VisitService
VisitAttributeType
sVisitService.getAllVisitAttributeTypes()
public VisitAttributeType getVisitAttributeType(java.lang.Integer id)
getVisitAttributeType
in interface VisitService
VisitAttributeType
with the given internal idVisitService.getVisitAttributeType(java.lang.Integer)
public VisitAttributeType getVisitAttributeTypeByUuid(java.lang.String uuid)
getVisitAttributeTypeByUuid
in interface VisitService
VisitAttributeType
with the given uuidVisitService.getVisitAttributeTypeByUuid(java.lang.String)
public VisitAttributeType saveVisitAttributeType(VisitAttributeType visitAttributeType)
VisitService
saveVisitAttributeType
in interface VisitService
VisitService.saveVisitAttributeType(org.openmrs.VisitAttributeType)
public VisitAttributeType retireVisitAttributeType(VisitAttributeType visitAttributeType, java.lang.String reason)
VisitService
retireVisitAttributeType
in interface VisitService
VisitService.retireVisitAttributeType(org.openmrs.VisitAttributeType,
java.lang.String)
public VisitAttributeType unretireVisitAttributeType(VisitAttributeType visitAttributeType)
VisitService
unretireVisitAttributeType
in interface VisitService
VisitService.unretireVisitAttributeType(org.openmrs.VisitAttributeType)
public void purgeVisitAttributeType(VisitAttributeType visitAttributeType)
VisitService
purgeVisitAttributeType
in interface VisitService
VisitService.purgeVisitAttributeType(org.openmrs.VisitAttributeType)
public VisitAttribute getVisitAttributeByUuid(java.lang.String uuid)
getVisitAttributeByUuid
in interface VisitService
VisitAttribute
with the given uuidVisitService.getVisitAttributeByUuid(java.lang.String)
public void stopVisits(java.util.Date maximumStartDate)
VisitService
OpenmrsConstants.GP_VISIT_TYPES_TO_AUTO_CLOSE
global property.
If startDatetime is null, the default will be end of the current day.stopVisits
in interface VisitService
maximumStartDate
- Visits started on or before this date time value will get stoppedVisitService.stopVisits(Date)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.