Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trunk-5411:Add doseLimitUnits field to Drug #2964

Merged
merged 1 commit into from Jul 26, 2019

Conversation

gitcliff
Copy link
Contributor

@gitcliff gitcliff commented Jun 14, 2019

link:https://issues.openmrs.org/browse/TRUNK-5411?src=confmacro
Trunk-5411:Add doseLimitUnits field to Drug

@coveralls
Copy link

coveralls commented Jun 14, 2019

Coverage Status

Coverage increased (+0.007%) to 59.85% when pulling b0b5b6f on gitcliff:Trunk-5411 into 7755cec on openmrs:master.

@dkayiwa
Copy link
Member

dkayiwa commented Jun 18, 2019

You would need to also add a hibernate mapping file in addition to a liquibase changeset.

@gitcliff
Copy link
Contributor Author

thanks @dkayiwa,, going to work on it

@gitcliff
Copy link
Contributor Author

@dkayiwa i have added the changes you requested in the hibernate mappings and liquibase changeSet

pom.xml Outdated
@@ -531,7 +531,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<version>3.0.0-M3</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change required as part of the ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa initially i was getting test failures in the surefire, failing to execute the maven goal in the plugin untill i decided to upgrade it to the latest version as seen here
https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/3.0.0-M3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not related to the ticket and hence should not be in this pull request.

@gitcliff
Copy link
Contributor Author

No description provided.

</column>
</addColumn>
</changeSet>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa are these changes enough to answer your column names naming conventions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just list a few column names here together with yours.

Copy link
Contributor Author

@gitcliff gitcliff Jun 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

column name="cause_of_death_non_coded" type="varchar(255)"
column name="speciality_id" type="int"

column name="dose_Limit_Unit" type="int"
@dkayiwa i have listed the first two and then mine last

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh thanks @dkayiwa,, i have seen the difference here because of using capital letters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa i have updated the changeSet column name

@gitcliff gitcliff force-pushed the Trunk-5411 branch 2 times, most recently from c72e85e to 14bc7df Compare June 20, 2019 19:29
@@ -276,4 +278,18 @@ public void addDrugReferenceMap(DrugReferenceMap drugReferenceMap) {
getDrugReferenceMaps().add(drugReferenceMap);
}
}

/** Returns the doseLimitUnits of a particular drug */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do proper method javadoc?

}

/**
* @param doseLimitUnits is the doseLimitUnits to be stored in the drug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do proper method javadoc?

@@ -3436,7 +3436,7 @@
<changeSet id="20120529-2231" author="mvorobey">
<addForeignKeyConstraint constraintName="privilege_which_can_edit_encounter_type" baseTableName="encounter_type" baseColumnNames="edit_privilege" referencedTableName="privilege" referencedColumnNames="privilege"/>
</changeSet>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you discard these formatting changes?

<columnExists tableName="drug" columnName="dose_limit_unit"/>
</not>
</preConditions>
<comment>Adding column dose limit unit in table drug</comment>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you also add a foreign key constraint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes @dkayiwa am giong to add it

<comment>Adding column dose limit unit in table drug</comment>
<addColumn tableName="drug">
<column name="dose_limit_unit" type="int">
<constraints nullable="false"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that this column should not allow nulls?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa my thinking on this is that since this column is going to will represent the units of the existing fields of maximumDailyDose and minimumDailyDose of a given drug and a do believe every drug must these fields catered for which necessitates the doselimitunit not to all nulls

@gitcliff gitcliff force-pushed the Trunk-5411 branch 3 times, most recently from eecfb65 to c10f040 Compare June 25, 2019 07:08
@@ -20,5 +20,23 @@
<include file="liquibase-update-to-2.1.xml"/>
<include file="liquibase-update-to-2.2.xml"/>
<include file="liquibase-update-to-2.3.xml"/>
<changeSet id="Trunk-5411:Add dose limit unit field to Drug" author="gitacliff">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make your changeset id be of the same format like the others?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changeset should instead be in the liquibase-update-to-2.3.xml file

@gitcliff gitcliff force-pushed the Trunk-5411 branch 3 times, most recently from 2efb5f7 to 5d8ee9d Compare June 25, 2019 13:48
@gitcliff gitcliff force-pushed the Trunk-5411 branch 3 times, most recently from 81d4193 to c0d81c7 Compare July 24, 2019 14:51
@dkayiwa
Copy link
Member

dkayiwa commented Jul 24, 2019

Did you see the travis build failure?

@gitcliff gitcliff force-pushed the Trunk-5411 branch 3 times, most recently from bddd950 to 8ff6787 Compare July 25, 2019 12:14
@gitcliff
Copy link
Contributor Author

gitcliff commented Jul 25, 2019

@dkayiwa yes i have seen it , am getting build success with "mvn clean install" and when i make changes in the travis.yml file to use openjdk8 instead of oraclejdk8 i get successful travis CI build, the changes in the travis .yml seem to be correcting the travis failure yet the file is not part of the ticket...
Some guidance on how to go about this

@dkayiwa
Copy link
Member

dkayiwa commented Jul 25, 2019

The travis.yml changes are necessary. But not the others as per my inline comments.

@gitcliff
Copy link
Contributor Author

@dkayiwa thank you for the clarification

}

/**
* Sets the doseLimitUnits to this drug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this match the description that is in the ticket?

@gitcliff
Copy link
Contributor Author

@dkayiwa i have matched the description to that which is in the ticket,,hope its okay to be merged

@dkayiwa
Copy link
Member

dkayiwa commented Jul 26, 2019

Did you commit? I do not see any changes.

@gitcliff
Copy link
Contributor Author

yes @dkayiwa i did commit the changes
"Gets the doseLimitUnits field of drug"
"Sets the doseLimitUnits field to drug"

@dkayiwa
Copy link
Member

dkayiwa commented Jul 26, 2019

Is that how the ticket defines that field?

@gitcliff
Copy link
Contributor Author

gitcliff commented Jul 26, 2019

@dkayiwa not really,, i have made some changes and requesting for your review.Thanks

@@ -276,4 +278,26 @@ public void addDrugReferenceMap(DrugReferenceMap drugReferenceMap) {
getDrugReferenceMaps().add(drugReferenceMap);
}
}

/**
* Gets doseLimitUnits field to Drug, which will represent the units of the existing fields of
Copy link
Member

@dkayiwa dkayiwa Jul 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this is already the Dug class, what value does Drug add to the description?

@gitcliff
Copy link
Contributor Author

@dkayiwa i think the value that Drug adds to the description is doseLimitsUnits

@dkayiwa
Copy link
Member

dkayiwa commented Jul 26, 2019

Can you read your description again?

@gitcliff
Copy link
Contributor Author

@dkayiwa i have read the description and made changes again,kindly review

@dkayiwa
Copy link
Member

dkayiwa commented Jul 26, 2019

What you have done is not put the description that is in the ticket. Take a step back and ask yourself that, If you were the user of this API, what kind of description would you like to see to understand what this field is used for.

@gitcliff
Copy link
Contributor Author

@dkayiwa is this new description that i have edited okay?,,,,kindly review

@dkayiwa dkayiwa merged commit 487bcf1 into openmrs:master Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants