{"action":"created","comment":{"url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/comments/116460627","pull_request_review_id":38083114,"id":116460627,"diff_hunk":"@@ -0,0 +1,77 @@\n+package org.openmrs.module.aijar.htmlformentry;\n+\n+import static org.mockito.Mockito.mock;\n+import static org.mockito.Mockito.when;\n+\n+import java.util.Date;\n+import java.util.List;\n+\n+import org.junit.Assert;\n+import org.junit.Test;\n+import org.openmrs.Concept;\n+import org.openmrs.Encounter;\n+import org.openmrs.Patient;\n+import org.openmrs.PatientProgram;\n+import org.openmrs.Program;\n+import org.openmrs.api.ProgramWorkflowService;\n+import org.openmrs.api.context.Context;\n+import org.openmrs.module.aijar.metadata.core.Programs;\n+import org.openmrs.module.htmlformentry.FormEntryContext;\n+import org.openmrs.module.htmlformentry.FormEntrySession;\n+import org.openmrs.web.test.BaseModuleWebContextSensitiveTest;\n+\n+/**\n+ * Tests patient enrollment into the MCH program\n+ */\n+public class MCHProgramEnrollmentPostSubmissionActionTest extends BaseModuleWebContextSensitiveTest {\n+\t\n+\t@Test\n+\tpublic void shouldEnrollPatientInMCHProgramOnlyWhenExpectedConditionsAreFullFilled() {\n+\t\t\n+\t\tPatient patient = new Patient(2);\n+\t\tEncounter encounter = new Encounter();\n+\t\tencounter.setEncounterDatetime(new Date());\n+\t\t\n+\t\tMCHProgramEnrollmentPostSubmissionAction postSubmissionAction = new MCHProgramEnrollmentPostSubmissionAction();\n+\t\t\n+\t\tFormEntrySession formEntrySession = mock(FormEntrySession.class);\n+\t\tFormEntryContext formEntryContext = mock(FormEntryContext.class);\n+\t\t\n+\t\twhen(formEntrySession.getContext()).thenReturn(formEntryContext);\n+\t\twhen(formEntrySession.getPatient()).thenReturn(patient);\n+\t\twhen(formEntrySession.getEncounter()).thenReturn(encounter);\n+\t\t\n+\t\tProgramWorkflowService programWorkflowService = Context.getService(ProgramWorkflowService.class);\n+\t\tProgram mchProgram = new Program(Programs.MCH_PROGRAM.name());\n+\t\tmchProgram.setConcept(new Concept(3));","path":"omod/src/test/java/org/openmrs/module/aijar/htmlformentry/MCHProgramEnrollmentPostSubmissionActionTest.java","position":46,"original_position":46,"commit_id":"fabfad1fe51626031a9788bd0ddfae57aeb289c1","original_commit_id":"fabfad1fe51626031a9788bd0ddfae57aeb289c1","user":{"login":"dkayiwa","id":1390773,"avatar_url":"https://avatars2.githubusercontent.com/u/1390773?v=3","gravatar_id":"","url":"https://api.github.com/users/dkayiwa","html_url":"https://github.com/dkayiwa","followers_url":"https://api.github.com/users/dkayiwa/followers","following_url":"https://api.github.com/users/dkayiwa/following{/other_user}","gists_url":"https://api.github.com/users/dkayiwa/gists{/gist_id}","starred_url":"https://api.github.com/users/dkayiwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkayiwa/subscriptions","organizations_url":"https://api.github.com/users/dkayiwa/orgs","repos_url":"https://api.github.com/users/dkayiwa/repos","events_url":"https://api.github.com/users/dkayiwa/events{/privacy}","received_events_url":"https://api.github.com/users/dkayiwa/received_events","type":"User","site_admin":false},"body":"Where are those concepts? Do you have them in some sample dataset somewhere?","created_at":"2017-05-15T10:47:55Z","updated_at":"2017-05-15T10:47:55Z","html_url":"https://github.com/METS-Programme/openmrs-module-aijar/pull/221#discussion_r116460627","pull_request_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221","_links":{"self":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/comments/116460627"},"html":{"href":"https://github.com/METS-Programme/openmrs-module-aijar/pull/221#discussion_r116460627"},"pull_request":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221"}}},"pull_request":{"url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221","id":116862430,"html_url":"https://github.com/METS-Programme/openmrs-module-aijar/pull/221","diff_url":"https://github.com/METS-Programme/openmrs-module-aijar/pull/221.diff","patch_url":"https://github.com/METS-Programme/openmrs-module-aijar/pull/221.patch","issue_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/issues/221","number":221,"state":"open","locked":false,"title":"Enrolling patients into TB and MCH programs","user":{"login":"dkayiwa","id":1390773,"avatar_url":"https://avatars2.githubusercontent.com/u/1390773?v=3","gravatar_id":"","url":"https://api.github.com/users/dkayiwa","html_url":"https://github.com/dkayiwa","followers_url":"https://api.github.com/users/dkayiwa/followers","following_url":"https://api.github.com/users/dkayiwa/following{/other_user}","gists_url":"https://api.github.com/users/dkayiwa/gists{/gist_id}","starred_url":"https://api.github.com/users/dkayiwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkayiwa/subscriptions","organizations_url":"https://api.github.com/users/dkayiwa/orgs","repos_url":"https://api.github.com/users/dkayiwa/repos","events_url":"https://api.github.com/users/dkayiwa/events{/privacy}","received_events_url":"https://api.github.com/users/dkayiwa/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-04-20T20:55:18Z","updated_at":"2017-05-15T10:47:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f769687027cdcecdba305d4d20085456bc9d5ffb","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221/commits","review_comments_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221/comments","review_comment_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/issues/221/comments","statuses_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/statuses/fabfad1fe51626031a9788bd0ddfae57aeb289c1","head":{"label":"dkayiwa:program","ref":"program","sha":"fabfad1fe51626031a9788bd0ddfae57aeb289c1","user":{"login":"dkayiwa","id":1390773,"avatar_url":"https://avatars2.githubusercontent.com/u/1390773?v=3","gravatar_id":"","url":"https://api.github.com/users/dkayiwa","html_url":"https://github.com/dkayiwa","followers_url":"https://api.github.com/users/dkayiwa/followers","following_url":"https://api.github.com/users/dkayiwa/following{/other_user}","gists_url":"https://api.github.com/users/dkayiwa/gists{/gist_id}","starred_url":"https://api.github.com/users/dkayiwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkayiwa/subscriptions","organizations_url":"https://api.github.com/users/dkayiwa/orgs","repos_url":"https://api.github.com/users/dkayiwa/repos","events_url":"https://api.github.com/users/dkayiwa/events{/privacy}","received_events_url":"https://api.github.com/users/dkayiwa/received_events","type":"User","site_admin":false},"repo":{"id":86684634,"name":"openmrs-module-aijar","full_name":"dkayiwa/openmrs-module-aijar","owner":{"login":"dkayiwa","id":1390773,"avatar_url":"https://avatars2.githubusercontent.com/u/1390773?v=3","gravatar_id":"","url":"https://api.github.com/users/dkayiwa","html_url":"https://github.com/dkayiwa","followers_url":"https://api.github.com/users/dkayiwa/followers","following_url":"https://api.github.com/users/dkayiwa/following{/other_user}","gists_url":"https://api.github.com/users/dkayiwa/gists{/gist_id}","starred_url":"https://api.github.com/users/dkayiwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkayiwa/subscriptions","organizations_url":"https://api.github.com/users/dkayiwa/orgs","repos_url":"https://api.github.com/users/dkayiwa/repos","events_url":"https://api.github.com/users/dkayiwa/events{/privacy}","received_events_url":"https://api.github.com/users/dkayiwa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dkayiwa/openmrs-module-aijar","description":"Electronic Medical Records system for Uganda","fork":true,"url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar","forks_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/forks","keys_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/teams","hooks_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/hooks","issue_events_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/issues/events{/number}","events_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/events","assignees_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/assignees{/user}","branches_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/branches{/branch}","tags_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/tags","blobs_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/statuses/{sha}","languages_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/languages","stargazers_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/stargazers","contributors_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/contributors","subscribers_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/subscribers","subscription_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/subscription","commits_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/issues/comments{/number}","contents_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/contents/{+path}","compare_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/merges","archive_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/downloads","issues_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/issues{/number}","pulls_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/pulls{/number}","milestones_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/milestones{/number}","notifications_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/labels{/name}","releases_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/releases{/id}","deployments_url":"https://api.github.com/repos/dkayiwa/openmrs-module-aijar/deployments","created_at":"2017-03-30T09:29:53Z","updated_at":"2017-03-30T09:29:55Z","pushed_at":"2017-04-20T20:54:04Z","git_url":"git://github.com/dkayiwa/openmrs-module-aijar.git","ssh_url":"git@github.com:dkayiwa/openmrs-module-aijar.git","clone_url":"https://github.com/dkayiwa/openmrs-module-aijar.git","svn_url":"https://github.com/dkayiwa/openmrs-module-aijar","homepage":null,"size":32028,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"METS-Programme:master","ref":"master","sha":"593833da589bcf4fb6a7c0b6032bddf20ce7f4e7","user":{"login":"METS-Programme","id":16233272,"avatar_url":"https://avatars1.githubusercontent.com/u/16233272?v=3","gravatar_id":"","url":"https://api.github.com/users/METS-Programme","html_url":"https://github.com/METS-Programme","followers_url":"https://api.github.com/users/METS-Programme/followers","following_url":"https://api.github.com/users/METS-Programme/following{/other_user}","gists_url":"https://api.github.com/users/METS-Programme/gists{/gist_id}","starred_url":"https://api.github.com/users/METS-Programme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/METS-Programme/subscriptions","organizations_url":"https://api.github.com/users/METS-Programme/orgs","repos_url":"https://api.github.com/users/METS-Programme/repos","events_url":"https://api.github.com/users/METS-Programme/events{/privacy}","received_events_url":"https://api.github.com/users/METS-Programme/received_events","type":"Organization","site_admin":false},"repo":{"id":44961517,"name":"openmrs-module-aijar","full_name":"METS-Programme/openmrs-module-aijar","owner":{"login":"METS-Programme","id":16233272,"avatar_url":"https://avatars1.githubusercontent.com/u/16233272?v=3","gravatar_id":"","url":"https://api.github.com/users/METS-Programme","html_url":"https://github.com/METS-Programme","followers_url":"https://api.github.com/users/METS-Programme/followers","following_url":"https://api.github.com/users/METS-Programme/following{/other_user}","gists_url":"https://api.github.com/users/METS-Programme/gists{/gist_id}","starred_url":"https://api.github.com/users/METS-Programme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/METS-Programme/subscriptions","organizations_url":"https://api.github.com/users/METS-Programme/orgs","repos_url":"https://api.github.com/users/METS-Programme/repos","events_url":"https://api.github.com/users/METS-Programme/events{/privacy}","received_events_url":"https://api.github.com/users/METS-Programme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/METS-Programme/openmrs-module-aijar","description":"Electronic Medical Records system for Uganda","fork":false,"url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar","forks_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/forks","keys_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/teams","hooks_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/hooks","issue_events_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/issues/events{/number}","events_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/events","assignees_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/assignees{/user}","branches_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/branches{/branch}","tags_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/tags","blobs_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/git/refs{/sha}","trees_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/statuses/{sha}","languages_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/languages","stargazers_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/stargazers","contributors_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/contributors","subscribers_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/subscribers","subscription_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/subscription","commits_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/commits{/sha}","git_commits_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/git/commits{/sha}","comments_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/comments{/number}","issue_comment_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/issues/comments{/number}","contents_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/contents/{+path}","compare_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/merges","archive_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/downloads","issues_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/issues{/number}","pulls_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls{/number}","milestones_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/milestones{/number}","notifications_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/labels{/name}","releases_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/releases{/id}","deployments_url":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/deployments","created_at":"2015-10-26T10:30:15Z","updated_at":"2017-01-09T11:30:58Z","pushed_at":"2017-05-15T03:58:22Z","git_url":"git://github.com/METS-Programme/openmrs-module-aijar.git","ssh_url":"git@github.com:METS-Programme/openmrs-module-aijar.git","clone_url":"https://github.com/METS-Programme/openmrs-module-aijar.git","svn_url":"https://github.com/METS-Programme/openmrs-module-aijar","homepage":null,"size":32145,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":8,"forks":15,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221"},"html":{"href":"https://github.com/METS-Programme/openmrs-module-aijar/pull/221"},"issue":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/issues/221"},"comments":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/issues/221/comments"},"review_comments":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221/comments"},"review_comment":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/pulls/221/commits"},"statuses":{"href":"https://api.github.com/repos/METS-Programme/openmrs-module-aijar/statuses/fabfad1fe51626031a9788bd0ddfae57aeb289c1"}}}}
{"actor":{"display_login":"dkayiwa"}}