Skip to content

Commit

Permalink
TRUNK-4137 Added frequency and numberOfRepeats properties to TestOrde…
Browse files Browse the repository at this point in the history
…r class
  • Loading branch information
k-joseph authored and wluyima committed Dec 24, 2013
1 parent b0bfeec commit 9e0f455
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
51 changes: 51 additions & 0 deletions api/src/main/java/org/openmrs/TestOrder.java
Expand Up @@ -34,12 +34,26 @@ public enum Laterality {

private String clinicalHistory;

private OrderFrequency frequency;

private Integer numberOfRepeats;

/**
* Default Constructor
*/
public TestOrder() {
}

protected Order copyHelper(TestOrder target) {
super.copyHelper(target);
this.specimenSource = getSpecimenSource();
this.laterality = getLaterality();
this.clinicalHistory = getClinicalHistory();
this.frequency = getFrequency();
this.numberOfRepeats = getNumberOfRepeats();
return target;
}

/**
* @return the specimenSource
*/
Expand Down Expand Up @@ -90,4 +104,41 @@ public void setClinicalHistory(String clinicalHistory) {
this.clinicalHistory = clinicalHistory;
}

/**
* Gets frequency of test order
*
* @since 1.10
*/
public OrderFrequency getFrequency() {
return frequency;
}

/**
* Sets frequency of test order
*
* @param frequency
* @since 1.10
*/
public void setFrequency(OrderFrequency frequency) {
this.frequency = frequency;
}

/**
* Gets numberOfRepeats of test order
*
* @since 1.10
*/
public Integer getNumberOfRepeats() {
return numberOfRepeats;
}

/**
* Sets numberOfRepeats of test order
*
* @param numberOfRepeats to set
* @since 1.10
*/
public void setNumberOfRepeats(Integer numberOfRepeats) {
this.numberOfRepeats = numberOfRepeats;
}
}
27 changes: 27 additions & 0 deletions api/src/main/resources/liquibase-update-to-latest.xml
Expand Up @@ -6739,4 +6739,31 @@
<dropColumn tableName="drug_order" columnName="units"/>
</changeSet>

<changeSet id="201312181649-TRUNK-4137" author="k-joseph">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="test_order" columnName="frequency" />
</not>
</preConditions>
<comment>Adding frequency column to test_order table</comment>
<addColumn tableName="test_order">
<column name="frequency" type="int" />
</addColumn>
<addForeignKeyConstraint constraintName="test_order_frequency_fk"
baseTableName="test_order" baseColumnNames="frequency"
referencedTableName="order_frequency" referencedColumnNames="order_frequency_id" />
</changeSet>

<changeSet id="201312181649-TRUNK-4137" author="k-joseph">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="test_order" columnName="number_of_repeats" />
</not>
</preConditions>
<comment>Adding number_of_repeats column to test_order table</comment>
<addColumn tableName="test_order">
<column name="number_of_repeats" type="int" />
</addColumn>
</changeSet>

</databaseChangeLog>
Expand Up @@ -137,6 +137,10 @@
</type>
</property>
<property name="clinicalHistory" type="java.lang.String" column="clinical_history" length="65535" />
<property name="frequency" type="int" column="frequency"/>

This comment has been minimized.

Copy link
@wluyima

wluyima Jan 16, 2014

Member

This was supposed to be a many to one mapping referencing order_frequency table, i fixed it in a follow up commit

<many-to-one name="numberOfRepeats" class="org.openmrs.OrderFrequency">

This comment has been minimized.

Copy link
@wluyima

wluyima Jan 16, 2014

Member

These mappings were actually mixed up

<column name="order_frequency"/>
</many-to-one>

</joined-subclass>
</class>
Expand Down

0 comments on commit 9e0f455

Please sign in to comment.