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-5225:Get list of OrderGroups by patient or encounter is missing in openmrs… #3084

Merged
merged 1 commit into from
Dec 22, 2019

Conversation

gitcliff
Copy link
Contributor

link:https://issues.openmrs.org/browse/TRUNK-5225
Get list of OrderGroups by patient or encounter is missing in openmrs…

@coveralls
Copy link

coveralls commented Dec 13, 2019

Coverage Status

Coverage increased (+0.009%) to 59.99% when pulling 29bbce5 on gitcliff:Trunk-5225 into 793ff22 on openmrs:master.

@Test
public void getOrderGroupsByEncounter_shouldGetOrderGroupsFrommMultipleEncounters() {
Encounter existingEncounter1 = Context.getEncounterService().getEncounter(3);
Encounter existingEncounter2 = Context.getEncounterService().getEncounter(6);
Copy link
Member

@dkayiwa dkayiwa Dec 13, 2019

Choose a reason for hiding this comment

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

What is the use of this test? Do we have any such tests in the existing code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the purpose of this test is to create instances of multiple encounters and they do exist in the existing code

public void getOrderGroupsByPatient_shouldGetOrderGroupsFromMultiplePatients() {

Patient existingPatient1 = Context.getPatientService().getPatient(7);
Patient existingPatient2 = Context.getPatientService().getPatient(2);
Copy link
Member

@dkayiwa dkayiwa Dec 13, 2019

Choose a reason for hiding this comment

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

What is the use of this test? Do we have any such tests in the existing code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the purpose of this test is to create instances of multiple patients and they do exist in the existing code

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 point me to any tests that you found doing the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

your right @dkayiwa the tests are not there, am going to remove them and only maintain the tests relating to getting order groups from a patient

@dkayiwa
Copy link
Member

dkayiwa commented Dec 19, 2019

Can you include the ticket id in your commit message as recommended at? https://wiki.openmrs.org/display/docs/Pull+Request+Tips

@gitcliff gitcliff changed the title Get list of OrderGroups by patient or encounter is missing in openmrs… Trunk-5225:Get list of OrderGroups by patient or encounter is missing in openmrs… Dec 19, 2019
@gitcliff
Copy link
Contributor Author

oh sorry about this, had forgotten it,,,
have fixed it

@Test
public void getOrderGroupsByEncounter_shouldGetOrderGroupsFromAnEncounter() {
Encounter existingEncounter = Context.getEncounterService().getEncounter(4);
List<OrderGroup> ordergroups1 = Context.getOrderService().getOrderGroupsByEncounter(existingEncounter);
Copy link
Member

Choose a reason for hiding this comment

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

What is the reason for appending 1 to the variable name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have fixed it

public void getOrderGroupsByPatient_shouldGetOrderGroupsGivenPatient() {

Patient existingPatient1 = Context.getPatientService().getPatient(8);
List<OrderGroup> ordergroups1 = Context.getOrderService().getOrderGroupsByPatient(existingPatient1);
Copy link
Member

Choose a reason for hiding this comment

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

What is the reason for appending 1 to the variable name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have fixed it


Patient existingPatient1 = Context.getPatientService().getPatient(8);
List<OrderGroup> ordergroups1 = Context.getOrderService().getOrderGroupsByPatient(existingPatient1);

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 empty line intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, i have fixed it

@Test
public void getOrderGroupsByPatient_shouldGetOrderGroupsGivenPatient() {
Patient existingPatient = Context.getPatientService().getPatient(8);
List<OrderGroup> ordergroups1 = Context.getOrderService().getOrderGroupsByPatient(existingPatient);
Copy link
Member

Choose a reason for hiding this comment

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

Why ordergroups1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have fixed it

@dkayiwa dkayiwa merged commit 94d6517 into openmrs:master Dec 22, 2019
prathamesh-mutkure pushed a commit to prathamesh-mutkure/openmrs-core that referenced this pull request Dec 25, 2019
Devanshk9 pushed a commit to Devanshk9/openmrs-core that referenced this pull request Jan 13, 2020
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