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
Conversation
You would need to also add a hibernate mapping file in addition to a liquibase changeset. |
thanks @dkayiwa,, going to work on it |
@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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
No description provided. |
</column> | ||
</addColumn> | ||
</changeSet> | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
c72e85e
to
14bc7df
Compare
@@ -276,4 +278,18 @@ public void addDrugReferenceMap(DrugReferenceMap drugReferenceMap) { | |||
getDrugReferenceMaps().add(drugReferenceMap); | |||
} | |||
} | |||
|
|||
/** Returns the doseLimitUnits of a particular drug */ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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> | |||
|
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"/> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
eecfb65
to
c10f040
Compare
@@ -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"> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
2efb5f7
to
5d8ee9d
Compare
81d4193
to
c0d81c7
Compare
Did you see the travis build failure? |
bddd950
to
8ff6787
Compare
@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... |
The travis.yml changes are necessary. But not the others as per my inline comments. |
@dkayiwa thank you for the clarification |
} | ||
|
||
/** | ||
* Sets the doseLimitUnits to this drug |
There was a problem hiding this comment.
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?
@dkayiwa i have matched the description to that which is in the ticket,,hope its okay to be merged |
Did you commit? I do not see any changes. |
yes @dkayiwa i did commit the changes |
Is that how the ticket defines that field? |
@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 |
There was a problem hiding this comment.
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?
@dkayiwa i think the value that Drug adds to the description is doseLimitsUnits |
Can you read your description again? |
@dkayiwa i have read the description and made changes again,kindly review |
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. |
@dkayiwa is this new description that i have edited okay?,,,,kindly review |
link:https://issues.openmrs.org/browse/TRUNK-5411?src=confmacro
Trunk-5411:Add doseLimitUnits field to Drug