Skip to content

Commit

Permalink
fix failing test on appointment search due to default value for dateA…
Browse files Browse the repository at this point in the history
…ppointmentScheduled
  • Loading branch information
ojwanganto committed Jun 4, 2024
1 parent eeb3151 commit 64fc4db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Appointment extends BaseOpenmrsData implements Serializable {
* This property is useful for documenting the visit when the patient booked the appointment or when the patient called to book the appointment
* NOTE: This is *not* the date the appointment is scheduled to take place. We use startDateTime for this
*/
private Date dateAppointmentScheduled = new Date();
private Date dateAppointmentScheduled;
private Patient patient;
private AppointmentServiceDefinition service;
private AppointmentServiceType serviceType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -103,6 +104,8 @@ public void mapAppointmentRequestToAppointment(AppointmentRequest appointmentReq

if (appointmentRequest.getDateAppointmentScheduled() != null) {
appointment.setDateAppointmentScheduled(appointmentRequest.getDateAppointmentScheduled());
} else {
appointment.setDateAppointmentScheduled(new Date());
}
appointment.setServiceType(appointmentServiceType);
appointment.setService(appointmentServiceDefinition);
Expand Down

0 comments on commit 64fc4db

Please sign in to comment.