public interface VisitService extends OpenmrsService
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.
|
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 |
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
@Authorized(value="View Visit Types") java.util.List<VisitType> getAllVisitTypes()
@Authorized(value="View Visit Types") VisitType getVisitType(java.lang.Integer visitTypeId)
visitTypeId
- the visit type id.@Authorized(value="View Visit Types") VisitType getVisitTypeByUuid(java.lang.String uuid)
uuid
- the visit type UUID.@Authorized(value="View Visit Types") java.util.List<VisitType> getVisitTypes(java.lang.String fuzzySearchPhrase)
fuzzySearchPhrase
- the search phrase to use.@Authorized(value="Manage Visit Types") VisitType saveVisitType(VisitType visitType) throws APIException
visitType
- the visit type to create or update.APIException
@Authorized(value="Manage Visit Types") VisitType retireVisitType(VisitType visitType, java.lang.String reason)
visitType
- the visit type to retire.reason
- the reason why the visit type is retired.@Authorized(value="Manage Visit Types") VisitType unretireVisitType(VisitType visitType)
visitType
- the visit type to unretire.@Authorized(value="Manage Visit Types") void purgeVisitType(VisitType visitType)
visitType
- the visit type to delete from the database.@Authorized(value="View Visits") java.util.List<Visit> getAllVisits() throws APIException
APIException
@Authorized(value="View Visits") Visit getVisit(java.lang.Integer visitId) throws APIException
visitId
- the visit id.APIException
@Authorized(value="View Visits") Visit getVisitByUuid(java.lang.String uuid) throws APIException
uuid
- the visit UUID.APIException
@Authorized(value={"Add Visits","Edit Visits"}) Visit saveVisit(Visit visit) throws APIException
visit
- the visit to create or update.APIException
@Authorized(value="Edit Visits") Visit endVisit(Visit visit, java.util.Date stopDate) throws APIException
visit
- the visit whose stopDate is to be setstopDate
- the date and time the visit is ending. if null, current date is usedAPIException
@Authorized(value="Delete Visits") Visit voidVisit(Visit visit, java.lang.String reason) throws APIException
visit
- the visit to void.reason
- the reason why the visit is voidedAPIException
@Authorized(value="Delete Visits") Visit unvoidVisit(Visit visit) throws APIException
visit
- the visit to unvoidAPIException
@Authorized(value="Purge Visits") void purgeVisit(Visit visit) throws APIException
visit
- the visit to delete from the database.APIException
@Authorized(value="View Visits") 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
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
getActiveVisitsByPatient(Patient)
@Authorized(value="View Visits") java.util.List<Visit> getVisitsByPatient(Patient patient) throws APIException
patient
- the patient whose visits to getAPIException
@Authorized(value="View Visits") java.util.List<Visit> getActiveVisitsByPatient(Patient patient) throws APIException
patient
- the patient whose visits to getAPIException
@Authorized(value="View Visits") java.util.List<Visit> getVisitsByPatient(Patient patient, boolean includeInactive, boolean includeVoided) throws APIException
patient
- the patient whose visits to getincludeInactive
- includeVoided
- APIException
@Authorized(value="View Visit Attribute Types") java.util.List<VisitAttributeType> getAllVisitAttributeTypes()
VisitAttributeType
s@Authorized(value="View Visit Attribute Types") VisitAttributeType getVisitAttributeType(java.lang.Integer id)
id
- VisitAttributeType
with the given internal id@Authorized(value="View Visit Attribute Types") VisitAttributeType getVisitAttributeTypeByUuid(java.lang.String uuid)
uuid
- VisitAttributeType
with the given uuid@Authorized(value="Manage Visit Attribute Types") VisitAttributeType saveVisitAttributeType(VisitAttributeType visitAttributeType)
visitAttributeType
- @Authorized(value="Manage Visit Attribute Types") VisitAttributeType retireVisitAttributeType(VisitAttributeType visitAttributeType, java.lang.String reason)
visitAttributeType
- @Authorized(value="Manage Visit Attribute Types") VisitAttributeType unretireVisitAttributeType(VisitAttributeType visitAttributeType)
visitAttributeType
- @Authorized(value="Purge Visit Attribute Types") void purgeVisitAttributeType(VisitAttributeType visitAttributeType)
visitAttributeType
- @Authorized(value="View Visits") VisitAttribute getVisitAttributeByUuid(java.lang.String uuid)
uuid
- VisitAttribute
with the given uuid@Authorized(value="Edit Visits") void stopVisits(java.util.Date maximumStartDate)
OpenmrsConstants.GP_VISIT_TYPES_TO_AUTO_CLOSE
global property.
If startDatetime is null, the default will be end of the current day.maximumStartDate
- Visits started on or before this date time value will get stoppedCopyright © 2018 OpenMRS Inc.. All Rights Reserved.