{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/171867399","pull_request_review_id":100798913,"id":171867399,"diff_hunk":"@@ -0,0 +1,127 @@\n+/**\n+ * This Source Code Form is subject to the terms of the Mozilla Public License,\n+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can\n+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under\n+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.\n+ *\n+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS\n+ * graphic logo is a trademark of OpenMRS Inc.\n+ */\n+package org.openmrs.api.impl;\n+\n+import org.openmrs.Condition;\n+import org.openmrs.Patient;\n+import org.openmrs.api.APIException;\n+import org.openmrs.api.ConditionService;\n+import org.openmrs.api.context.Context;\n+import org.openmrs.api.db.ConditionDAO;\n+import org.springframework.transaction.annotation.Transactional;\n+\n+import java.util.Date;\n+import java.util.List;\n+\n+/**\n+ * This class implements the {@link ConditionService} interface\n+ * It defines the methods to handle the condition domain object\n+ *\n+ * @since 2.2\n+ */\n+@Transactional\n+public class ConditionServiceImpl extends BaseOpenmrsService implements ConditionService{\n+\n+\tprivate ConditionDAO conditionDAO;\n+\n+\tpublic void setConditionDAO(ConditionDAO conditionDAO) {\n+\t\tthis.conditionDAO = conditionDAO;\n+\t}\n+\n+\tpublic ConditionDAO getConditionDAO() {\n+\t\treturn conditionDAO;\n+\t}\n+\n+\t/**\n+\t * Saves a condition\n+\t *\n+\t * @param condition - the condition to be saved\n+\t */\n+\t@Override\n+\tpublic Condition saveCondition(Condition condition) {\n+\t\treturn conditionDAO.saveCondition(condition);\n+\t}\n+\n+\t/**\n+\t * Gets a condition based on the uuid\n+\t *\n+\t * @param uuid - uuid of the condition to be returned\n+\t * @return the condition\n+\t */\n+\t@Override\n+\t@Transactional(readOnly = true)\n+\tpublic Condition getConditionByUuid(String uuid) {\n+\t\treturn conditionDAO.getConditionByUuid(uuid);\n+\t}\n+\n+\t/**\n+\t * Gets a condition by id\n+\t *\n+\t * @param conditionId - the id of the Condition to retrieve\n+\t * @return the Condition with the given id, or null if none exists\n+\t * @throws APIException\n+\t */\n+\t@Override\n+\t@Transactional(readOnly = true)\n+\tpublic Condition getCondition(Integer conditionId) {\n+\t\treturn conditionDAO.getCondition(conditionId);\n+\t}\n+\n+\t/**\n+\t * Gets a patient's active conditions\n+\t *\n+\t * @param patient - the patient to retrieve conditions for\n+\t * @return a list of the patient's active conditions\n+\t */\n+\t@Override\n+\t@Transactional(readOnly = true)\n+\tpublic List<Condition> getActiveConditions(Patient patient) {\n+\t\treturn conditionDAO.getActiveConditions(patient);\n+\t}\n+\n+\t/**\n+\t * Voids a condition\n+\t *\n+\t * @param condition  - the condition to be voided\n+\t * @param voidReason - the reason for voiding the condition","path":"api/src/main/java/org/openmrs/api/impl/ConditionServiceImpl.java","position":93,"original_position":93,"commit_id":"5b7dde435161e4f2f60d8bc33fad6164288f7cb3","original_commit_id":"5b7dde435161e4f2f60d8bc33fad6164288f7cb3","user":{"login":"dkayiwa","id":1390773,"avatar_url":"https://avatars1.githubusercontent.com/u/1390773?v=4","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":"Can you also document the return value?","created_at":"2018-03-02T14:54:08Z","updated_at":"2018-03-02T14:54:08Z","html_url":"https://github.com/openmrs/openmrs-core/pull/2600#discussion_r171867399","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/171867399"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2600#discussion_r171867399"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600","id":171327891,"html_url":"https://github.com/openmrs/openmrs-core/pull/2600","diff_url":"https://github.com/openmrs/openmrs-core/pull/2600.diff","patch_url":"https://github.com/openmrs/openmrs-core/pull/2600.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/2600","number":2600,"state":"open","locked":false,"title":"TRUNK-5354: Add implementation of condition service interface","user":{"login":"paradisekelechi","id":14928334,"avatar_url":"https://avatars3.githubusercontent.com/u/14928334?v=4","gravatar_id":"","url":"https://api.github.com/users/paradisekelechi","html_url":"https://github.com/paradisekelechi","followers_url":"https://api.github.com/users/paradisekelechi/followers","following_url":"https://api.github.com/users/paradisekelechi/following{/other_user}","gists_url":"https://api.github.com/users/paradisekelechi/gists{/gist_id}","starred_url":"https://api.github.com/users/paradisekelechi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paradisekelechi/subscriptions","organizations_url":"https://api.github.com/users/paradisekelechi/orgs","repos_url":"https://api.github.com/users/paradisekelechi/repos","events_url":"https://api.github.com/users/paradisekelechi/events{/privacy}","received_events_url":"https://api.github.com/users/paradisekelechi/received_events","type":"User","site_admin":false},"body":"<!--- Add a pull request title above in this format -->\r\n<!--- real example: 'TRUNK-5111 Replace use of deprecated isVoided' -->\r\n<!--- 'TRUNK-JiraIssueNumber JiraIssueTitle' -->\r\n## Description of what I changed\r\n<!--- Describe your changes in detail -->\r\n<!--- It can simply be your commit message, which you must have -->\r\nImplemented the Condition Service Interface\r\nThe following files were modified\r\n- api/src/main/java/org/openmrs/api/context/Context.java\r\n- api/src/main/java/org/openmrs/api/context/ServiceContext.java\r\n- api/src/main/resources/applicationContext-service.xml\r\n- api/src/main/java/org/openmrs/validator/ConditionValidator.java\r\n- api/src/test/java/org/openmrs/validator/ConditionValidatorTest.java\r\n- api/src/main/resources/messages.properties\r\nThe following files were added\r\n- api/src/main/java/org/openmrs/api/impl/ConditionServiceImpl.java\r\n- api/src/test/java/org/openmrs/api/impl/ConditionServiceImplTest.java\r\n- api/src/test/resources/org/openmrs/api/include/ConditionServiceImplTest-SetupCondition.xml\r\n\r\n## Issue I worked on\r\n<!--- This project only accepts pull requests related to open issues -->\r\n<!--- Want a new feature or change? Discuss it in an issue first -->\r\n<!--- Found a bug? Point us to the issue/or create one so we can reproduce it -->\r\n<!--- Just add the issue number at the end: -->\r\nsee https://issues.openmrs.org/browse/TRUNK-5354\r\n\r\n## Checklist: I completed these to help reviewers :)\r\n<!--- Put an `x` in the box if you did the task -->\r\n<!--- If you forgot a task please follow the instructions below -->\r\n- [x] My pull request only contains **ONE single commit**\r\n(the number above, next to the 'Commits' tab is 1).\r\n\r\n  No? -> [read here](https://wiki.openmrs.org/display/docs/Pull+Request+Tips) on how to squash multiple commits into one\r\n\r\n- [x] My IDE is configured to follow the [**code style**](https://wiki.openmrs.org/display/docs/Java+Conventions) of this project.\r\n\r\n  No? Unsure? -> [configure your IDE](https://wiki.openmrs.org/display/docs/How-To+Setup+And+Use+Your+IDE), format the code and add the changes with `git add . && git commit --amend`\r\n\r\n- [x] I have **added tests** to cover my changes. (If you refactored\r\n  existing code that was well tested you do not have to add tests)\r\n\r\n  No? -> write tests and add them to this commit `git add . && git commit --amend`\r\n\r\n- [x] I ran `mvn clean package` right before creating this pull request and\r\n  added all formatting changes to my commit.\r\n\r\n  No? -> execute above command\r\n\r\n- [x] All new and existing **tests passed**.\r\n\r\n  No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.\r\n\r\n- [x] My pull request is **based on the latest changes** of the master branch.\r\n\r\n  No? Unsure? -> execute command `git pull --rebase upstream master`\r\n\r\n","created_at":"2018-02-26T10:00:13Z","updated_at":"2018-03-02T14:54:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6a2982c47d2b6f25237fbbb135cee31b6dd5d0f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600/comments","review_comment_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/2600/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-core/statuses/5b7dde435161e4f2f60d8bc33fad6164288f7cb3","head":{"label":"paradisekelechi:TRUNK-5354","ref":"TRUNK-5354","sha":"5b7dde435161e4f2f60d8bc33fad6164288f7cb3","user":{"login":"paradisekelechi","id":14928334,"avatar_url":"https://avatars3.githubusercontent.com/u/14928334?v=4","gravatar_id":"","url":"https://api.github.com/users/paradisekelechi","html_url":"https://github.com/paradisekelechi","followers_url":"https://api.github.com/users/paradisekelechi/followers","following_url":"https://api.github.com/users/paradisekelechi/following{/other_user}","gists_url":"https://api.github.com/users/paradisekelechi/gists{/gist_id}","starred_url":"https://api.github.com/users/paradisekelechi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paradisekelechi/subscriptions","organizations_url":"https://api.github.com/users/paradisekelechi/orgs","repos_url":"https://api.github.com/users/paradisekelechi/repos","events_url":"https://api.github.com/users/paradisekelechi/events{/privacy}","received_events_url":"https://api.github.com/users/paradisekelechi/received_events","type":"User","site_admin":false},"repo":{"id":121345652,"name":"openmrs-core","full_name":"paradisekelechi/openmrs-core","owner":{"login":"paradisekelechi","id":14928334,"avatar_url":"https://avatars3.githubusercontent.com/u/14928334?v=4","gravatar_id":"","url":"https://api.github.com/users/paradisekelechi","html_url":"https://github.com/paradisekelechi","followers_url":"https://api.github.com/users/paradisekelechi/followers","following_url":"https://api.github.com/users/paradisekelechi/following{/other_user}","gists_url":"https://api.github.com/users/paradisekelechi/gists{/gist_id}","starred_url":"https://api.github.com/users/paradisekelechi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paradisekelechi/subscriptions","organizations_url":"https://api.github.com/users/paradisekelechi/orgs","repos_url":"https://api.github.com/users/paradisekelechi/repos","events_url":"https://api.github.com/users/paradisekelechi/events{/privacy}","received_events_url":"https://api.github.com/users/paradisekelechi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paradisekelechi/openmrs-core","description":"OpenMRS API and web application code","fork":true,"url":"https://api.github.com/repos/paradisekelechi/openmrs-core","forks_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/forks","keys_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/teams","hooks_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/hooks","issue_events_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/issues/events{/number}","events_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/events","assignees_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/assignees{/user}","branches_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/branches{/branch}","tags_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/tags","blobs_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/statuses/{sha}","languages_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/languages","stargazers_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/stargazers","contributors_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/contributors","subscribers_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/subscribers","subscription_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/subscription","commits_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/contents/{+path}","compare_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/merges","archive_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/downloads","issues_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/issues{/number}","pulls_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/pulls{/number}","milestones_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/milestones{/number}","notifications_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/labels{/name}","releases_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/releases{/id}","deployments_url":"https://api.github.com/repos/paradisekelechi/openmrs-core/deployments","created_at":"2018-02-13T06:08:53Z","updated_at":"2018-02-13T06:09:01Z","pushed_at":"2018-03-02T14:41:04Z","git_url":"git://github.com/paradisekelechi/openmrs-core.git","ssh_url":"git@github.com:paradisekelechi/openmrs-core.git","clone_url":"https://github.com/paradisekelechi/openmrs-core.git","svn_url":"https://github.com/paradisekelechi/openmrs-core","homepage":"http://openmrs.org","size":227400,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openmrs:master","ref":"master","sha":"bb754ce3d4ba8f378125d41a3feaf98966851796","user":{"login":"openmrs","id":860776,"avatar_url":"https://avatars3.githubusercontent.com/u/860776?v=4","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"repo":{"id":5187976,"name":"openmrs-core","full_name":"openmrs/openmrs-core","owner":{"login":"openmrs","id":860776,"avatar_url":"https://avatars3.githubusercontent.com/u/860776?v=4","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmrs/openmrs-core","description":"OpenMRS API and web application code","fork":false,"url":"https://api.github.com/repos/openmrs/openmrs-core","forks_url":"https://api.github.com/repos/openmrs/openmrs-core/forks","keys_url":"https://api.github.com/repos/openmrs/openmrs-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmrs/openmrs-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmrs/openmrs-core/teams","hooks_url":"https://api.github.com/repos/openmrs/openmrs-core/hooks","issue_events_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/events{/number}","events_url":"https://api.github.com/repos/openmrs/openmrs-core/events","assignees_url":"https://api.github.com/repos/openmrs/openmrs-core/assignees{/user}","branches_url":"https://api.github.com/repos/openmrs/openmrs-core/branches{/branch}","tags_url":"https://api.github.com/repos/openmrs/openmrs-core/tags","blobs_url":"https://api.github.com/repos/openmrs/openmrs-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmrs/openmrs-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmrs/openmrs-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmrs/openmrs-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmrs/openmrs-core/statuses/{sha}","languages_url":"https://api.github.com/repos/openmrs/openmrs-core/languages","stargazers_url":"https://api.github.com/repos/openmrs/openmrs-core/stargazers","contributors_url":"https://api.github.com/repos/openmrs/openmrs-core/contributors","subscribers_url":"https://api.github.com/repos/openmrs/openmrs-core/subscribers","subscription_url":"https://api.github.com/repos/openmrs/openmrs-core/subscription","commits_url":"https://api.github.com/repos/openmrs/openmrs-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmrs/openmrs-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmrs/openmrs-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmrs/openmrs-core/contents/{+path}","compare_url":"https://api.github.com/repos/openmrs/openmrs-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmrs/openmrs-core/merges","archive_url":"https://api.github.com/repos/openmrs/openmrs-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmrs/openmrs-core/downloads","issues_url":"https://api.github.com/repos/openmrs/openmrs-core/issues{/number}","pulls_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls{/number}","milestones_url":"https://api.github.com/repos/openmrs/openmrs-core/milestones{/number}","notifications_url":"https://api.github.com/repos/openmrs/openmrs-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmrs/openmrs-core/labels{/name}","releases_url":"https://api.github.com/repos/openmrs/openmrs-core/releases{/id}","deployments_url":"https://api.github.com/repos/openmrs/openmrs-core/deployments","created_at":"2012-07-26T04:54:29Z","updated_at":"2018-03-02T01:52:13Z","pushed_at":"2018-03-02T14:41:06Z","git_url":"git://github.com/openmrs/openmrs-core.git","ssh_url":"git@github.com:openmrs/openmrs-core.git","clone_url":"https://github.com/openmrs/openmrs-core.git","svn_url":"https://github.com/openmrs/openmrs-core","homepage":"http://openmrs.org","size":227395,"stargazers_count":622,"watchers_count":622,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2054,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2054,"open_issues":23,"watchers":622,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2600"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2600"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2600/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600/comments"},"review_comment":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2600/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-core/statuses/5b7dde435161e4f2f60d8bc33fad6164288f7cb3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dkayiwa"}}