{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/189519653","pull_request_review_id":121712676,"id":189519653,"diff_hunk":"@@ -29,6 +31,10 @@\n @Handler(supports = { Visit.class }, order = 50)\n public class VisitValidator extends BaseCustomizableValidator implements Validator {\n \t\n+\tprivate static final double ESTIMATED_BIRTHDATE_ERROR_MARGIN = -0.5;\n+\t\n+\tprivate static final int ESTIMATED_BIRTHDATE_ERROR_MARGIN_MINIMUM = -1;","path":"api/src/main/java/org/openmrs/validator/VisitValidator.java","position":19,"original_position":19,"commit_id":"3badf450250147cbc890e9042b156a942eddd18a","original_commit_id":"3badf450250147cbc890e9042b156a942eddd18a","user":{"login":"teleivo","id":4661144,"avatar_url":"https://avatars0.githubusercontent.com/u/4661144?v=4","gravatar_id":"","url":"https://api.github.com/users/teleivo","html_url":"https://github.com/teleivo","followers_url":"https://api.github.com/users/teleivo/followers","following_url":"https://api.github.com/users/teleivo/following{/other_user}","gists_url":"https://api.github.com/users/teleivo/gists{/gist_id}","starred_url":"https://api.github.com/users/teleivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teleivo/subscriptions","organizations_url":"https://api.github.com/users/teleivo/orgs","repos_url":"https://api.github.com/users/teleivo/repos","events_url":"https://api.github.com/users/teleivo/events{/privacy}","received_events_url":"https://api.github.com/users/teleivo/received_events","type":"User","site_admin":false},"body":"rename to ESTIMATED_BIRTHDATE_ERROR_MARGIN_MINIMUM_YEARS\r\n\r\nso its clear its unit is years","created_at":"2018-05-21T08:05:00Z","updated_at":"2018-05-21T08:29:15Z","html_url":"https://github.com/openmrs/openmrs-core/pull/2667#discussion_r189519653","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2667","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/189519653"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2667#discussion_r189519653"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2667"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2667","id":187651778,"html_url":"https://github.com/openmrs/openmrs-core/pull/2667","diff_url":"https://github.com/openmrs/openmrs-core/pull/2667.diff","patch_url":"https://github.com/openmrs/openmrs-core/pull/2667.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/2667","number":2667,"state":"open","locked":false,"title":"TRUNK-4939 : update visit validator to check startdate is after birthdate","user":{"login":"Ben-Waters","id":932966,"avatar_url":"https://avatars3.githubusercontent.com/u/932966?v=4","gravatar_id":"","url":"https://api.github.com/users/Ben-Waters","html_url":"https://github.com/Ben-Waters","followers_url":"https://api.github.com/users/Ben-Waters/followers","following_url":"https://api.github.com/users/Ben-Waters/following{/other_user}","gists_url":"https://api.github.com/users/Ben-Waters/gists{/gist_id}","starred_url":"https://api.github.com/users/Ben-Waters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ben-Waters/subscriptions","organizations_url":"https://api.github.com/users/Ben-Waters/orgs","repos_url":"https://api.github.com/users/Ben-Waters/repos","events_url":"https://api.github.com/users/Ben-Waters/events{/privacy}","received_events_url":"https://api.github.com/users/Ben-Waters/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\n\r\nAdded validation to visits that the start date can not be before the birthdate of the patient.\r\n\r\nIn cases where the age of a patient was estimated, a 50% margin of error is included.\r\n\r\nI also updated one of the existing person's test data. They had a birthdate of 2007 but in one of the tests they started a visit in 2005. I changed their birthdate so this is no longer an issue.\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-4939\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-05-13T04:21:40Z","updated_at":"2018-05-21T08:29:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b4e0032746b97f707babd3f0fe580e4d952186b","assignee":{"login":"teleivo","id":4661144,"avatar_url":"https://avatars0.githubusercontent.com/u/4661144?v=4","gravatar_id":"","url":"https://api.github.com/users/teleivo","html_url":"https://github.com/teleivo","followers_url":"https://api.github.com/users/teleivo/followers","following_url":"https://api.github.com/users/teleivo/following{/other_user}","gists_url":"https://api.github.com/users/teleivo/gists{/gist_id}","starred_url":"https://api.github.com/users/teleivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teleivo/subscriptions","organizations_url":"https://api.github.com/users/teleivo/orgs","repos_url":"https://api.github.com/users/teleivo/repos","events_url":"https://api.github.com/users/teleivo/events{/privacy}","received_events_url":"https://api.github.com/users/teleivo/received_events","type":"User","site_admin":false},"assignees":[{"login":"teleivo","id":4661144,"avatar_url":"https://avatars0.githubusercontent.com/u/4661144?v=4","gravatar_id":"","url":"https://api.github.com/users/teleivo","html_url":"https://github.com/teleivo","followers_url":"https://api.github.com/users/teleivo/followers","following_url":"https://api.github.com/users/teleivo/following{/other_user}","gists_url":"https://api.github.com/users/teleivo/gists{/gist_id}","starred_url":"https://api.github.com/users/teleivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teleivo/subscriptions","organizations_url":"https://api.github.com/users/teleivo/orgs","repos_url":"https://api.github.com/users/teleivo/repos","events_url":"https://api.github.com/users/teleivo/events{/privacy}","received_events_url":"https://api.github.com/users/teleivo/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"djazayeri","id":1165236,"avatar_url":"https://avatars0.githubusercontent.com/u/1165236?v=4","gravatar_id":"","url":"https://api.github.com/users/djazayeri","html_url":"https://github.com/djazayeri","followers_url":"https://api.github.com/users/djazayeri/followers","following_url":"https://api.github.com/users/djazayeri/following{/other_user}","gists_url":"https://api.github.com/users/djazayeri/gists{/gist_id}","starred_url":"https://api.github.com/users/djazayeri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djazayeri/subscriptions","organizations_url":"https://api.github.com/users/djazayeri/orgs","repos_url":"https://api.github.com/users/djazayeri/repos","events_url":"https://api.github.com/users/djazayeri/events{/privacy}","received_events_url":"https://api.github.com/users/djazayeri/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2667/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2667/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/2667/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-core/statuses/3badf450250147cbc890e9042b156a942eddd18a","head":{"label":"Ben-Waters:TRUNK-4939","ref":"TRUNK-4939","sha":"3badf450250147cbc890e9042b156a942eddd18a","user":{"login":"Ben-Waters","id":932966,"avatar_url":"https://avatars3.githubusercontent.com/u/932966?v=4","gravatar_id":"","url":"https://api.github.com/users/Ben-Waters","html_url":"https://github.com/Ben-Waters","followers_url":"https://api.github.com/users/Ben-Waters/followers","following_url":"https://api.github.com/users/Ben-Waters/following{/other_user}","gists_url":"https://api.github.com/users/Ben-Waters/gists{/gist_id}","starred_url":"https://api.github.com/users/Ben-Waters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ben-Waters/subscriptions","organizations_url":"https://api.github.com/users/Ben-Waters/orgs","repos_url":"https://api.github.com/users/Ben-Waters/repos","events_url":"https://api.github.com/users/Ben-Waters/events{/privacy}","received_events_url":"https://api.github.com/users/Ben-Waters/received_events","type":"User","site_admin":false},"repo":{"id":127594375,"name":"openmrs-core","full_name":"Ben-Waters/openmrs-core","owner":{"login":"Ben-Waters","id":932966,"avatar_url":"https://avatars3.githubusercontent.com/u/932966?v=4","gravatar_id":"","url":"https://api.github.com/users/Ben-Waters","html_url":"https://github.com/Ben-Waters","followers_url":"https://api.github.com/users/Ben-Waters/followers","following_url":"https://api.github.com/users/Ben-Waters/following{/other_user}","gists_url":"https://api.github.com/users/Ben-Waters/gists{/gist_id}","starred_url":"https://api.github.com/users/Ben-Waters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ben-Waters/subscriptions","organizations_url":"https://api.github.com/users/Ben-Waters/orgs","repos_url":"https://api.github.com/users/Ben-Waters/repos","events_url":"https://api.github.com/users/Ben-Waters/events{/privacy}","received_events_url":"https://api.github.com/users/Ben-Waters/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ben-Waters/openmrs-core","description":"OpenMRS API and web application code","fork":true,"url":"https://api.github.com/repos/Ben-Waters/openmrs-core","forks_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/forks","keys_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/teams","hooks_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/hooks","issue_events_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/issues/events{/number}","events_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/events","assignees_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/assignees{/user}","branches_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/branches{/branch}","tags_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/tags","blobs_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/statuses/{sha}","languages_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/languages","stargazers_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/stargazers","contributors_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/contributors","subscribers_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/subscribers","subscription_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/subscription","commits_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/contents/{+path}","compare_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/merges","archive_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/downloads","issues_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/issues{/number}","pulls_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/pulls{/number}","milestones_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/milestones{/number}","notifications_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/labels{/name}","releases_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/releases{/id}","deployments_url":"https://api.github.com/repos/Ben-Waters/openmrs-core/deployments","created_at":"2018-04-01T03:44:41Z","updated_at":"2018-05-15T03:48:51Z","pushed_at":"2018-05-16T04:05:19Z","git_url":"git://github.com/Ben-Waters/openmrs-core.git","ssh_url":"git@github.com:Ben-Waters/openmrs-core.git","clone_url":"https://github.com/Ben-Waters/openmrs-core.git","svn_url":"https://github.com/Ben-Waters/openmrs-core","homepage":"http://openmrs.org","size":227787,"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":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openmrs:master","ref":"master","sha":"d0109e54f503d86323dac1a89eb4395d91ec0218","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-05-20T17:43:12Z","pushed_at":"2018-05-20T18:20:15Z","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":227776,"stargazers_count":652,"watchers_count":652,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2109,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2109,"open_issues":35,"watchers":652,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2667"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2667"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2667"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2667/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2667/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/2667/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-core/statuses/3badf450250147cbc890e9042b156a942eddd18a"}},"author_association":"NONE"}}
{"actor":{"display_login":"teleivo"}}