Skip to content

Commit

Permalink
Rename Appointment to PatientAppointment
Browse files Browse the repository at this point in the history
  • Loading branch information
mseaton committed Sep 14, 2023
1 parent 7261c1e commit 0c2f918
Show file tree
Hide file tree
Showing 52 changed files with 445 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
import java.util.Date;

import org.openmrs.BaseOpenmrsData;
import org.openmrs.module.appointmentscheduling.AppointmentDetail.AppointmentStatus;
import org.openmrs.module.appointmentscheduling.PatientAppointment.AppointmentStatus;

public class AppointmentStatusHistory extends BaseOpenmrsData {

private static final long serialVersionUID = 1L;

private Integer appointmentStatusHistoryId;

private AppointmentDetail appointment;
private PatientAppointment appointment;

private AppointmentStatus status;

Expand All @@ -36,7 +36,7 @@ public AppointmentStatusHistory() {

}

public AppointmentStatusHistory(AppointmentDetail appointment, AppointmentStatus status, Date startDate, Date endDate) {
public AppointmentStatusHistory(PatientAppointment appointment, AppointmentStatus status, Date startDate, Date endDate) {
setAppointment(appointment);
setStatus(status);
setStartDate(startDate);
Expand Down Expand Up @@ -91,11 +91,11 @@ public void setEndDate(Date endDate) {
this.endDate = endDate;
}

public AppointmentDetail getAppointment() {
public PatientAppointment getAppointment() {
return appointment;
}

public void setAppointment(AppointmentDetail appointment) {
public void setAppointment(PatientAppointment appointment) {
this.appointment = appointment;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* It is a model class. It should extend either {@link BaseOpenmrsObject} or
* {@link BaseOpenmrsMetadata}.
*/
public class AppointmentDetail extends BaseOpenmrsData implements Serializable {
public class PatientAppointment extends BaseOpenmrsData implements Serializable {

private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -121,16 +121,16 @@ public static List<AppointmentStatus> getNotCancelledAppointmentStatuses() {

private AppointmentType appointmentType;

public AppointmentDetail() {
public PatientAppointment() {

}

public AppointmentDetail(Integer appointmentId) {
public PatientAppointment(Integer appointmentId) {
setId(appointmentId);
}

public AppointmentDetail(TimeSlot timeSlot, Visit visit, Patient patient,
AppointmentType appointmentType, AppointmentStatus status) {
public PatientAppointment(TimeSlot timeSlot, Visit visit, Patient patient,
AppointmentType appointmentType, AppointmentStatus status) {
setTimeSlot(timeSlot);
setVisit(visit);
setPatient(patient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import org.openmrs.annotation.Authorized;
import org.openmrs.api.APIException;
import org.openmrs.api.OpenmrsService;
import org.openmrs.module.appointmentscheduling.AppointmentDetail;
import org.openmrs.module.appointmentscheduling.AppointmentDetail.AppointmentStatus;
import org.openmrs.module.appointmentscheduling.PatientAppointment;
import org.openmrs.module.appointmentscheduling.PatientAppointment.AppointmentStatus;
import org.openmrs.module.appointmentscheduling.AppointmentBlock;
import org.openmrs.module.appointmentscheduling.AppointmentDailyCount;
import org.openmrs.module.appointmentscheduling.AppointmentRequest;
Expand Down Expand Up @@ -292,7 +292,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> get all appointment
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAllAppointmentDetails();
List<PatientAppointment> getAllPatientAppointments();

/**
* Get all appointments based on includeVoided flag
Expand All @@ -302,7 +302,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> get all appointments based on include voided flag.
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
public List<AppointmentDetail> getAllAppointmentDetails(boolean includeVoided);
public List<PatientAppointment> getAllPatientAppointments(boolean includeVoided);

/**
* Gets an appointment by its appointment id.
Expand All @@ -312,7 +312,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> get correct appointment
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
AppointmentDetail getAppointmentDetail(Integer appointmentId);
PatientAppointment getPatientAppointment(Integer appointmentId);

/**
* Gets an appointment by its UUID.
Expand All @@ -322,7 +322,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> get correct appointment
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
AppointmentDetail getAppointmentDetailByUuid(String uuid);
PatientAppointment getPatientAppointmentByUuid(String uuid);

/**
* Creates or updates the given appointment in the database.
Expand All @@ -333,7 +333,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> save edited appointment
*/
@Authorized(AppointmentUtils.PRIV_SCHEDULE_APPOINTMENTS)
AppointmentDetail saveAppointmentDetail(AppointmentDetail appointment) throws APIException;
PatientAppointment savePatientAppointment(PatientAppointment appointment) throws APIException;

/**
* Voids a given appointment.
Expand All @@ -344,7 +344,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> void given appointment
*/
@Authorized(AppointmentUtils.PRIV_SCHEDULE_APPOINTMENTS)
AppointmentDetail voidAppointmentDetail(AppointmentDetail appointment, String reason);
PatientAppointment voidPatientAppointment(PatientAppointment appointment, String reason);

/**
* Unvoids an appointment.
Expand All @@ -354,7 +354,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> unvoid given appointment
*/
@Authorized(AppointmentUtils.PRIV_SCHEDULE_APPOINTMENTS)
AppointmentDetail unvoidAppointmentDetail(AppointmentDetail appointment);
PatientAppointment unvoidPatientAppointment(PatientAppointment appointment);

/**
* Completely removes an appointment from the database. This is not reversible.
Expand All @@ -363,7 +363,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> delete given appointment
*/
@Authorized(AppointmentUtils.PRIV_SCHEDULE_APPOINTMENTS)
void purgeAppointmentDetail(AppointmentDetail appointment);
void purgePatientAppointment(PatientAppointment appointment);

/**
* Returns all Appointments for a given Patient
Expand All @@ -373,7 +373,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> return all of the appointments for the given patient.
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsOfPatient(Patient patient);
List<PatientAppointment> getAppointmentsOfPatient(Patient patient);

/**
* Returns the appointment corresponding to the given visit.
Expand All @@ -382,7 +382,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* @return the appointment that is related to this visit, null if there isnt any.
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
AppointmentDetail getAppointmentByVisit(Visit visit);
PatientAppointment getAppointmentByVisit(Visit visit);

// TimeSlot

Expand Down Expand Up @@ -474,7 +474,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> not return voided appointments
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsInTimeSlot(TimeSlot timeSlot);
List<PatientAppointment> getAppointmentsInTimeSlot(TimeSlot timeSlot);

/**
* Should retrieve all appointments in the given time slot that do not have a status that means
Expand All @@ -486,7 +486,7 @@ List<AppointmentBlock> getOverlappingAppointmentBlocks(
* <strong>Should</strong> not return voided appointments
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsInTimeSlotThatAreNotCancelled(
List<PatientAppointment> getAppointmentsInTimeSlotThatAreNotCancelled(
TimeSlot timeSlot);

/**
Expand Down Expand Up @@ -670,7 +670,7 @@ List<AppointmentRequest> getAppointmentRequestsByConstraints(Patient patient, Ap
* @return The most recent appointment for the given patient, null if no appointments were set.
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
AppointmentDetail getLastAppointment(Patient patient);
PatientAppointment getLastAppointment(Patient patient);

/**
* Return a list of time slots that stands within the given constraints.
Expand Down Expand Up @@ -791,9 +791,9 @@ Set<Location> getAllLocationDescendants(Location location,
* <strong>Should</strong> sort by associated time slot
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
AppointmentStatus status) throws APIException;
List<PatientAppointment> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
AppointmentStatus status) throws APIException;

/**
* Retrieves Appointments that satisfy the given constraints
Expand All @@ -809,9 +809,9 @@ List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
* <strong>Should</strong> sort by associated time slot
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
Patient patient, AppointmentStatus status) throws APIException;
List<PatientAppointment> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
Patient patient, AppointmentStatus status) throws APIException;

/**
* Retrieves Appointments that satisfy the given constraints
Expand All @@ -827,9 +827,9 @@ List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
* <strong>Should</strong> sort by associated time slot
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
Patient patient, List<AppointmentStatus> appointmentStatuses);
List<PatientAppointment> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
Patient patient, List<AppointmentStatus> appointmentStatuses);

/**
* Retrieves Appointments that satisfy the given constraints
Expand All @@ -847,18 +847,18 @@ List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
* <strong>Should</strong> sort by associated time slot
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
Patient patient, List<AppointmentStatus> appointmentStatuses,
VisitType visitType, Visit visit) throws APIException;
List<PatientAppointment> getAppointmentsByConstraints(Date fromDate, Date toDate,
Location location, Provider provider, AppointmentType type,
Patient patient, List<AppointmentStatus> appointmentStatuses,
VisitType visitType, Visit visit) throws APIException;
/**
* Retrives the start date of the current status of a given appointment.
*
* @param appointment - The appointment.
* @return the start date of the current status of a given appointment.
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
Date getAppointmentCurrentStatusStartDate(AppointmentDetail appointment);
Date getAppointmentCurrentStatusStartDate(PatientAppointment appointment);

/**
* Changes the given appointment status.
Expand All @@ -867,7 +867,7 @@ List<AppointmentDetail> getAppointmentsByConstraints(Date fromDate, Date toDate,
* @param newStatus - The new status
*/
@Authorized(AppointmentUtils.PRIV_SCHEDULE_APPOINTMENTS)
void changeAppointmentStatus(AppointmentDetail appointment,
void changeAppointmentStatus(PatientAppointment appointment,
AppointmentStatus newStatus);

/**
Expand Down Expand Up @@ -945,7 +945,7 @@ public Map<AppointmentType, Integer> getAppointmentTypeDistribution(
* @return list of unvoided appointments that their current status is one of the given states.
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getAppointmentsByStatus(List<AppointmentStatus> states);
List<PatientAppointment> getAppointmentsByStatus(List<AppointmentStatus> states);

/**
* Update the status of PAST appointments according to the following conditions: "SCHEDULED"
Expand All @@ -955,7 +955,7 @@ public Map<AppointmentType, Integer> getAppointmentTypeDistribution(
* @return List of the updated appointments
*/
@Authorized(AppointmentUtils.PRIV_SCHEDULE_APPOINTMENTS)
List<AppointmentDetail> cleanOpenAppointments();
List<PatientAppointment> cleanOpenAppointments();

@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
boolean verifyDuplicatedAppointmentTypeName(AppointmentType appointmentType);
Expand All @@ -967,7 +967,7 @@ public Map<AppointmentType, Integer> getAppointmentTypeDistribution(
* @return
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getScheduledAppointmentsForPatient(Patient patient);
List<PatientAppointment> getScheduledAppointmentsForPatient(Patient patient);

/**
* Books a new appointment
Expand All @@ -980,7 +980,7 @@ public Map<AppointmentType, Integer> getAppointmentTypeDistribution(
* allowOverbook = false
*/
@Authorized(AppointmentUtils.PRIV_SCHEDULE_APPOINTMENTS)
AppointmentDetail bookAppointment(AppointmentDetail appointment, Boolean allowOverbook)
PatientAppointment bookAppointment(PatientAppointment appointment, Boolean allowOverbook)
throws TimeSlotFullException;

/**
Expand All @@ -989,28 +989,28 @@ AppointmentDetail bookAppointment(AppointmentDetail appointment, Boolean allowOv
* @return
*/
@Authorized
List<AppointmentStatusHistory> getAppointmentStatusHistories(AppointmentDetail appointment);
List<AppointmentStatusHistory> getAppointmentStatusHistories(PatientAppointment appointment);

/**
* retrieves the most recent status of an appointment
* @param appointment
* @return
*/
@Authorized()
AppointmentStatusHistory getMostRecentAppointmentStatusHistory(AppointmentDetail appointment);
AppointmentStatusHistory getMostRecentAppointmentStatusHistory(PatientAppointment appointment);
/**
* returns list of early appointments
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getEarlyAppointments(Date fromDate, Date toDate, Location location,
Provider provider, AppointmentType appointmentType) throws APIException;
List<PatientAppointment> getEarlyAppointments(Date fromDate, Date toDate, Location location,
Provider provider, AppointmentType appointmentType) throws APIException;

/**
* returns list of late appointments
*/
@Authorized(AppointmentUtils.PRIV_VIEW_APPOINTMENTS)
List<AppointmentDetail> getLateAppointments(Date fromDate, Date toDate, Location location,
Provider provider, AppointmentType appointmentType) throws APIException;
List<PatientAppointment> getLateAppointments(Date fromDate, Date toDate, Location location,
Provider provider, AppointmentType appointmentType) throws APIException;
/** returns list of appointments aggregated by date
* @param fromDate
* @param toDate
Expand Down
Loading

0 comments on commit 0c2f918

Please sign in to comment.