Skip to content

Commit

Permalink
[#TRUNK-4130] Add numedRefills and administrationInstructions propert…
Browse files Browse the repository at this point in the history
…ies to DrugOrder

TRUNK-4130 seperated the previous changeset into two for each column and fixed some other small issues
  • Loading branch information
k-joseph authored and wluyima committed Dec 17, 2013
1 parent 6360b0e commit fc41dd2
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
40 changes: 40 additions & 0 deletions api/src/main/java/org/openmrs/DrugOrder.java
Expand Up @@ -50,6 +50,10 @@ public enum DosingType {

private DosingType dosingType = DosingType.SIMPLE;

private Integer numRefills;

private String administrationInstructions;

// Constructors

/** default constructor */
Expand Down Expand Up @@ -275,6 +279,42 @@ public void setDosingType(DosingType dosingType) {
this.dosingType = dosingType;
}

/**
* Gets numRefills
* @since 1.10
*/
public Integer getNumRefills() {
return numRefills;
}

/**
* Sets numRefills
*
* @param numRefills the numRefills to set
* @since 1.10
*/
public void setNumRefills(Integer numRefills) {
this.numRefills = numRefills;
}

/**
* Gets the administrationInstructions
* @since 1.10
*/
public String getAdministrationInstructions() {
return administrationInstructions;
}

/**
* Sets the administrationInstructions
*
* @param administrationInstructions to set
* @since 1.10
*/
public void setAdministrationInstructions(String administrationInstructions) {
this.administrationInstructions = administrationInstructions;
}

public String toString() {
return "DrugOrder(" + getDose() + getUnits() + " of " + (getDrug() != null ? getDrug().getName() : "[no drug]")
+ " from " + getStartDate() + " to " + (getDiscontinued() ? getDiscontinuedDate() : getAutoExpireDate())
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/resources/liquibase-schema-only.xml
Expand Up @@ -519,6 +519,8 @@
<constraints nullable="false"/>
</column>
<column name="quantity" type="int"/>
<column name="num_refills" type="int"/>
<column name="administration_instructions" type="text"/>
</createTable>
</changeSet>
<changeSet author="ben (generated)" id="1227303685425-25">
Expand Down
24 changes: 24 additions & 0 deletions api/src/main/resources/liquibase-update-to-latest.xml
Expand Up @@ -6511,5 +6511,29 @@
<where>dosing_type = '1'</where>
</update>
</changeSet>

<changeSet id="20131210-TRUNK-4130" author="k-joseph">
<preConditions onFail="MARK_RAN">
<not><columnExists tableName="drug_order" columnName="num_refills"/></not>
</preConditions>

<comment>Adding num_refills column to drug_order table</comment>

<addColumn tableName="drug_order">
<column name="num_refills" type="int"/>
</addColumn>
</changeSet>

<changeSet id="20131211-TRUNK-4130" author="k-joseph">
<preConditions onFail="MARK_RAN">
<not><columnExists tableName="drug_order" columnName="administration_instructions"/></not>
</preConditions>

<comment>Adding administration_instructions column to drug_order table</comment>

<addColumn tableName="drug_order">
<column name="administration_instructions" type="text"/>
</addColumn>
</changeSet>

</databaseChangeLog>
Expand Up @@ -108,6 +108,8 @@
<param name="enumClassName">org.openmrs.DrugOrder$DosingType</param>
</type>
</property>
<property name="numRefills" type="int" column="num_refills" />
<property name="administrationInstructions" type="java.lang.String" column="administration_instructions" length="1024"/>

</joined-subclass>

Expand Down

0 comments on commit fc41dd2

Please sign in to comment.