Skip to content

Commit

Permalink
add appointment dateAppointmentScheduled property
Browse files Browse the repository at this point in the history
  • Loading branch information
ojwanganto committed May 29, 2024
1 parent c952494 commit c907cf6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class Appointment extends BaseOpenmrsData implements Serializable {
private Integer appointmentId;
private String appointmentNumber;
private Date dateCreated;
private Date dateAppointmentScheduled = new Date();
private Patient patient;
private AppointmentServiceDefinition service;
private AppointmentServiceType serviceType;
Expand Down Expand Up @@ -250,6 +251,14 @@ public Date getDateCreated() {
return dateCreated;
}

public Date getDateAppointmentScheduled() {
return dateAppointmentScheduled;
}

public void setDateAppointmentScheduled(Date dateAppointmentScheduled) {
this.dateAppointmentScheduled = dateAppointmentScheduled;
}

@Override
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
Expand Down
1 change: 1 addition & 0 deletions api/src/main/resources/Appointment.hbm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<property name="comments" type="java.lang.String" column="comments"/>

<property name="dateCreated" type="java.util.Date" column="date_created"/>
<property name="dateAppointmentScheduled" type="java.util.Date" column="date_appointment_scheduled"/>
<property name="dateChanged" type="java.util.Date" column="date_changed"/>
<property name="uuid" type="java.lang.String" column="uuid" length="38" unique="true"/>
<property name="voided" type="java.lang.Boolean" column="voided" length="1" not-null="true" />
Expand Down
11 changes: 11 additions & 0 deletions api/src/main/resources/liquibase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -731,4 +731,15 @@
<addForeignKeyConstraint constraintName="patient_appointment_fulfilling_encounter_map_patient_appointment" baseTableName="patient_appointment_fulfilling_encounter_map" baseColumnNames="patient_appointment_id" referencedTableName="patient_appointment" referencedColumnNames="patient_appointment_id"/>
<addForeignKeyConstraint constraintName="patient_appointment_fulfilling_encounter_map_encounter" baseTableName="patient_appointment_fulfilling_encounter_map" baseColumnNames="fulfilling_encounter_id" referencedTableName="encounter" referencedColumnNames="encounter_id"/>
</changeSet>
<changeSet id="add_date_appointment_scheduled_20240528" author="aojwang">
<preConditions onFail="MARK_RAN">
<not>
<columnExists columnName="date_appointment_scheduled" tableName="patient_appointment"/>
</not>
</preConditions>
<sql>
ALTER TABLE patient_appointment
ADD COLUMN date_appointment_scheduled DATE NULL;
</sql>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class AppointmentDefaultResponse {
private String uuid;
private String appointmentNumber;
private Date dateCreated;
private Date dateAppointmentScheduled;
private Map patient;
private AppointmentServiceDefaultResponse service;
private Map serviceType;
Expand Down Expand Up @@ -194,4 +195,12 @@ public Date getDateCreated() {
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
}

public Date getDateAppointmentScheduled() {
return dateAppointmentScheduled;
}

public void setDateAppointmentScheduled(Date dateAppointmentScheduled) {
this.dateAppointmentScheduled = dateAppointmentScheduled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ private AppointmentDefaultResponse mapToDefaultResponse(Appointment a, Appointme
response.setUuid(a.getUuid());
response.setAppointmentNumber(a.getAppointmentNumber());
response.setDateCreated(a.getDateCreated());
response.setDateAppointmentScheduled(a.getDateAppointmentScheduled());
response.setPatient(createPatientMap(a.getPatient()));
response.setService(appointmentServiceMapper.constructDefaultResponse(a.getService()));
response.setServiceType(createServiceTypeMap(a.getServiceType()));
Expand Down

0 comments on commit c907cf6

Please sign in to comment.