{"action":"created","comment":{"url":"https://api.github.com/repos/motech-implementations/prevac/pulls/comments/168490920","pull_request_review_id":96863263,"id":168490920,"diff_hunk":"@@ -173,41 +174,55 @@ private void setVisitPlannedDate(Visit baseVisit, Visit visit, VisitScheduleOffs\n         }\n     }\n \n-    private void validateDate(LocalDate date, LocalDate screeningDate, Subject subject) {\n+    private void validateDate(LocalDate primeVacDate, Subject subject, boolean ignoreLimits) {\n+        if (!ignoreLimits) {\n+            Map<String, LocalDate> visitDates = getScreeningAndPrimeVacDates(subject);\n \n-        if (screeningDate == null) {\n-            throw new VisitScheduleException(\"Couldn't calculate Planned Dates, because Participant didn't participate in screening visit\");\n-        }\n+            if (!visitDates.containsKey(SCREENING_DATE_KEY)) {\n+                throw new VisitScheduleException(\"Couldn't calculate Planned Dates, because Participant didn't participate in screening visit\");\n+            }\n \n-        LocalDate earliestDate;\n-        LocalDate latestDate = screeningDate.plusDays(PrevacConstants.LATEST_DATE);\n+            LocalDate earliestDate;\n+            LocalDate latestDate = visitDates.get(SCREENING_DATE_KEY).plusDays(PrevacConstants.LATEST_DATE);\n \n-        if (subject.getFemaleChildBearingAge() == null || !subject.getFemaleChildBearingAge()) {\n-            earliestDate = screeningDate;\n-        } else {\n-            earliestDate = screeningDate.plusDays(PrevacConstants.EARLIEST_DATE_IF_FEMALE_CHILD_BEARING_AGE);\n-        }\n+            if (subject.getFemaleChildBearingAge() == null || !subject.getFemaleChildBearingAge()) {","path":"src/main/java/org/motechproject/prevac/service/impl/VisitScheduleServiceImpl.java","position":null,"original_position":101,"commit_id":"3949a119a488c1fa9d5b5c189c47ccab767fd210","original_commit_id":"3650bb5719b3e7f539a7e4e5a04bdbce5adc4283","user":{"login":"pmuchowski","id":8501916,"avatar_url":"https://avatars2.githubusercontent.com/u/8501916?v=4","gravatar_id":"","url":"https://api.github.com/users/pmuchowski","html_url":"https://github.com/pmuchowski","followers_url":"https://api.github.com/users/pmuchowski/followers","following_url":"https://api.github.com/users/pmuchowski/following{/other_user}","gists_url":"https://api.github.com/users/pmuchowski/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuchowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuchowski/subscriptions","organizations_url":"https://api.github.com/users/pmuchowski/orgs","repos_url":"https://api.github.com/users/pmuchowski/repos","events_url":"https://api.github.com/users/pmuchowski/events{/privacy}","received_events_url":"https://api.github.com/users/pmuchowski/received_events","type":"User","site_admin":false},"body":"you should update the validation, according to my previous comments","created_at":"2018-02-15T14:29:56Z","updated_at":"2018-02-15T14:41:12Z","html_url":"https://github.com/motech-implementations/prevac/pull/48#discussion_r168490920","pull_request_url":"https://api.github.com/repos/motech-implementations/prevac/pulls/48","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/motech-implementations/prevac/pulls/comments/168490920"},"html":{"href":"https://github.com/motech-implementations/prevac/pull/48#discussion_r168490920"},"pull_request":{"href":"https://api.github.com/repos/motech-implementations/prevac/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/motech-implementations/prevac/pulls/48","id":169180078,"html_url":"https://github.com/motech-implementations/prevac/pull/48","diff_url":"https://github.com/motech-implementations/prevac/pull/48.diff","patch_url":"https://github.com/motech-implementations/prevac/pull/48.patch","issue_url":"https://api.github.com/repos/motech-implementations/prevac/issues/48","number":48,"state":"open","locked":false,"title":"EBODAC-1189: Add ability to ignore date limits on Clinic Visit Schedule tab","user":{"login":"kcissewski","id":29372665,"avatar_url":"https://avatars2.githubusercontent.com/u/29372665?v=4","gravatar_id":"","url":"https://api.github.com/users/kcissewski","html_url":"https://github.com/kcissewski","followers_url":"https://api.github.com/users/kcissewski/followers","following_url":"https://api.github.com/users/kcissewski/following{/other_user}","gists_url":"https://api.github.com/users/kcissewski/gists{/gist_id}","starred_url":"https://api.github.com/users/kcissewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kcissewski/subscriptions","organizations_url":"https://api.github.com/users/kcissewski/orgs","repos_url":"https://api.github.com/users/kcissewski/repos","events_url":"https://api.github.com/users/kcissewski/events{/privacy}","received_events_url":"https://api.github.com/users/kcissewski/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-14T17:56:44Z","updated_at":"2018-02-15T14:41:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69b3298f093f0fc219af6050e86c0d85cb683c8f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/motech-implementations/prevac/pulls/48/commits","review_comments_url":"https://api.github.com/repos/motech-implementations/prevac/pulls/48/comments","review_comment_url":"https://api.github.com/repos/motech-implementations/prevac/pulls/comments{/number}","comments_url":"https://api.github.com/repos/motech-implementations/prevac/issues/48/comments","statuses_url":"https://api.github.com/repos/motech-implementations/prevac/statuses/3949a119a488c1fa9d5b5c189c47ccab767fd210","head":{"label":"motech-implementations:EBODAC-1189","ref":"EBODAC-1189","sha":"3949a119a488c1fa9d5b5c189c47ccab767fd210","user":{"login":"motech-implementations","id":6608253,"avatar_url":"https://avatars0.githubusercontent.com/u/6608253?v=4","gravatar_id":"","url":"https://api.github.com/users/motech-implementations","html_url":"https://github.com/motech-implementations","followers_url":"https://api.github.com/users/motech-implementations/followers","following_url":"https://api.github.com/users/motech-implementations/following{/other_user}","gists_url":"https://api.github.com/users/motech-implementations/gists{/gist_id}","starred_url":"https://api.github.com/users/motech-implementations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech-implementations/subscriptions","organizations_url":"https://api.github.com/users/motech-implementations/orgs","repos_url":"https://api.github.com/users/motech-implementations/repos","events_url":"https://api.github.com/users/motech-implementations/events{/privacy}","received_events_url":"https://api.github.com/users/motech-implementations/received_events","type":"Organization","site_admin":false},"repo":{"id":113978146,"name":"prevac","full_name":"motech-implementations/prevac","owner":{"login":"motech-implementations","id":6608253,"avatar_url":"https://avatars0.githubusercontent.com/u/6608253?v=4","gravatar_id":"","url":"https://api.github.com/users/motech-implementations","html_url":"https://github.com/motech-implementations","followers_url":"https://api.github.com/users/motech-implementations/followers","following_url":"https://api.github.com/users/motech-implementations/following{/other_user}","gists_url":"https://api.github.com/users/motech-implementations/gists{/gist_id}","starred_url":"https://api.github.com/users/motech-implementations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech-implementations/subscriptions","organizations_url":"https://api.github.com/users/motech-implementations/orgs","repos_url":"https://api.github.com/users/motech-implementations/repos","events_url":"https://api.github.com/users/motech-implementations/events{/privacy}","received_events_url":"https://api.github.com/users/motech-implementations/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/motech-implementations/prevac","description":"PREVAC Registration Module","fork":false,"url":"https://api.github.com/repos/motech-implementations/prevac","forks_url":"https://api.github.com/repos/motech-implementations/prevac/forks","keys_url":"https://api.github.com/repos/motech-implementations/prevac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/motech-implementations/prevac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/motech-implementations/prevac/teams","hooks_url":"https://api.github.com/repos/motech-implementations/prevac/hooks","issue_events_url":"https://api.github.com/repos/motech-implementations/prevac/issues/events{/number}","events_url":"https://api.github.com/repos/motech-implementations/prevac/events","assignees_url":"https://api.github.com/repos/motech-implementations/prevac/assignees{/user}","branches_url":"https://api.github.com/repos/motech-implementations/prevac/branches{/branch}","tags_url":"https://api.github.com/repos/motech-implementations/prevac/tags","blobs_url":"https://api.github.com/repos/motech-implementations/prevac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/motech-implementations/prevac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/motech-implementations/prevac/git/refs{/sha}","trees_url":"https://api.github.com/repos/motech-implementations/prevac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/motech-implementations/prevac/statuses/{sha}","languages_url":"https://api.github.com/repos/motech-implementations/prevac/languages","stargazers_url":"https://api.github.com/repos/motech-implementations/prevac/stargazers","contributors_url":"https://api.github.com/repos/motech-implementations/prevac/contributors","subscribers_url":"https://api.github.com/repos/motech-implementations/prevac/subscribers","subscription_url":"https://api.github.com/repos/motech-implementations/prevac/subscription","commits_url":"https://api.github.com/repos/motech-implementations/prevac/commits{/sha}","git_commits_url":"https://api.github.com/repos/motech-implementations/prevac/git/commits{/sha}","comments_url":"https://api.github.com/repos/motech-implementations/prevac/comments{/number}","issue_comment_url":"https://api.github.com/repos/motech-implementations/prevac/issues/comments{/number}","contents_url":"https://api.github.com/repos/motech-implementations/prevac/contents/{+path}","compare_url":"https://api.github.com/repos/motech-implementations/prevac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/motech-implementations/prevac/merges","archive_url":"https://api.github.com/repos/motech-implementations/prevac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/motech-implementations/prevac/downloads","issues_url":"https://api.github.com/repos/motech-implementations/prevac/issues{/number}","pulls_url":"https://api.github.com/repos/motech-implementations/prevac/pulls{/number}","milestones_url":"https://api.github.com/repos/motech-implementations/prevac/milestones{/number}","notifications_url":"https://api.github.com/repos/motech-implementations/prevac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/motech-implementations/prevac/labels{/name}","releases_url":"https://api.github.com/repos/motech-implementations/prevac/releases{/id}","deployments_url":"https://api.github.com/repos/motech-implementations/prevac/deployments","created_at":"2017-12-12T10:44:57Z","updated_at":"2017-12-14T19:07:08Z","pushed_at":"2018-02-15T13:45:45Z","git_url":"git://github.com/motech-implementations/prevac.git","ssh_url":"git@github.com:motech-implementations/prevac.git","clone_url":"https://github.com/motech-implementations/prevac.git","svn_url":"https://github.com/motech-implementations/prevac","homepage":null,"size":403,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"motech-implementations:master","ref":"master","sha":"e1ca33678bcacb7f79c5cd49983379e86b794e69","user":{"login":"motech-implementations","id":6608253,"avatar_url":"https://avatars0.githubusercontent.com/u/6608253?v=4","gravatar_id":"","url":"https://api.github.com/users/motech-implementations","html_url":"https://github.com/motech-implementations","followers_url":"https://api.github.com/users/motech-implementations/followers","following_url":"https://api.github.com/users/motech-implementations/following{/other_user}","gists_url":"https://api.github.com/users/motech-implementations/gists{/gist_id}","starred_url":"https://api.github.com/users/motech-implementations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech-implementations/subscriptions","organizations_url":"https://api.github.com/users/motech-implementations/orgs","repos_url":"https://api.github.com/users/motech-implementations/repos","events_url":"https://api.github.com/users/motech-implementations/events{/privacy}","received_events_url":"https://api.github.com/users/motech-implementations/received_events","type":"Organization","site_admin":false},"repo":{"id":113978146,"name":"prevac","full_name":"motech-implementations/prevac","owner":{"login":"motech-implementations","id":6608253,"avatar_url":"https://avatars0.githubusercontent.com/u/6608253?v=4","gravatar_id":"","url":"https://api.github.com/users/motech-implementations","html_url":"https://github.com/motech-implementations","followers_url":"https://api.github.com/users/motech-implementations/followers","following_url":"https://api.github.com/users/motech-implementations/following{/other_user}","gists_url":"https://api.github.com/users/motech-implementations/gists{/gist_id}","starred_url":"https://api.github.com/users/motech-implementations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech-implementations/subscriptions","organizations_url":"https://api.github.com/users/motech-implementations/orgs","repos_url":"https://api.github.com/users/motech-implementations/repos","events_url":"https://api.github.com/users/motech-implementations/events{/privacy}","received_events_url":"https://api.github.com/users/motech-implementations/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/motech-implementations/prevac","description":"PREVAC Registration Module","fork":false,"url":"https://api.github.com/repos/motech-implementations/prevac","forks_url":"https://api.github.com/repos/motech-implementations/prevac/forks","keys_url":"https://api.github.com/repos/motech-implementations/prevac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/motech-implementations/prevac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/motech-implementations/prevac/teams","hooks_url":"https://api.github.com/repos/motech-implementations/prevac/hooks","issue_events_url":"https://api.github.com/repos/motech-implementations/prevac/issues/events{/number}","events_url":"https://api.github.com/repos/motech-implementations/prevac/events","assignees_url":"https://api.github.com/repos/motech-implementations/prevac/assignees{/user}","branches_url":"https://api.github.com/repos/motech-implementations/prevac/branches{/branch}","tags_url":"https://api.github.com/repos/motech-implementations/prevac/tags","blobs_url":"https://api.github.com/repos/motech-implementations/prevac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/motech-implementations/prevac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/motech-implementations/prevac/git/refs{/sha}","trees_url":"https://api.github.com/repos/motech-implementations/prevac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/motech-implementations/prevac/statuses/{sha}","languages_url":"https://api.github.com/repos/motech-implementations/prevac/languages","stargazers_url":"https://api.github.com/repos/motech-implementations/prevac/stargazers","contributors_url":"https://api.github.com/repos/motech-implementations/prevac/contributors","subscribers_url":"https://api.github.com/repos/motech-implementations/prevac/subscribers","subscription_url":"https://api.github.com/repos/motech-implementations/prevac/subscription","commits_url":"https://api.github.com/repos/motech-implementations/prevac/commits{/sha}","git_commits_url":"https://api.github.com/repos/motech-implementations/prevac/git/commits{/sha}","comments_url":"https://api.github.com/repos/motech-implementations/prevac/comments{/number}","issue_comment_url":"https://api.github.com/repos/motech-implementations/prevac/issues/comments{/number}","contents_url":"https://api.github.com/repos/motech-implementations/prevac/contents/{+path}","compare_url":"https://api.github.com/repos/motech-implementations/prevac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/motech-implementations/prevac/merges","archive_url":"https://api.github.com/repos/motech-implementations/prevac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/motech-implementations/prevac/downloads","issues_url":"https://api.github.com/repos/motech-implementations/prevac/issues{/number}","pulls_url":"https://api.github.com/repos/motech-implementations/prevac/pulls{/number}","milestones_url":"https://api.github.com/repos/motech-implementations/prevac/milestones{/number}","notifications_url":"https://api.github.com/repos/motech-implementations/prevac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/motech-implementations/prevac/labels{/name}","releases_url":"https://api.github.com/repos/motech-implementations/prevac/releases{/id}","deployments_url":"https://api.github.com/repos/motech-implementations/prevac/deployments","created_at":"2017-12-12T10:44:57Z","updated_at":"2017-12-14T19:07:08Z","pushed_at":"2018-02-15T13:45:45Z","git_url":"git://github.com/motech-implementations/prevac.git","ssh_url":"git@github.com:motech-implementations/prevac.git","clone_url":"https://github.com/motech-implementations/prevac.git","svn_url":"https://github.com/motech-implementations/prevac","homepage":null,"size":403,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/motech-implementations/prevac/pulls/48"},"html":{"href":"https://github.com/motech-implementations/prevac/pull/48"},"issue":{"href":"https://api.github.com/repos/motech-implementations/prevac/issues/48"},"comments":{"href":"https://api.github.com/repos/motech-implementations/prevac/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/motech-implementations/prevac/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/motech-implementations/prevac/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/motech-implementations/prevac/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/motech-implementations/prevac/statuses/3949a119a488c1fa9d5b5c189c47ccab767fd210"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"pmuchowski"}}