{"action":"created","comment":{"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments/138197081","pull_request_review_id":61961240,"id":138197081,"diff_hunk":"@@ -72,6 +78,23 @@ def load_hearing(pkseq)\n \n     private\n \n+    # An empty docket is a master record with no children\n+    # For a video master record, the hearing_pkseq number becomes the VDKEY that links all\n+    # the child records (veterans scheduled for that video) to the parent record\n+    def video_empty_dockets(records)\n+      ids_with_no_children = master_record_ids_with_no_children(records)\n+      records.select { |p| ids_with_no_children.include?(p.hearing_pkseq) }\n+    end\n+\n+    def master_record_ids_with_no_children(records)\n+      ids = records.map(&:hearing_pkseq)\n+      ids - children_vdkeys_by_parent_id(ids)\n+    end\n+\n+    def children_vdkeys_by_parent_id(ids)\n+      where(vdkey: ids).map(&:vdkey).uniq.map(&:to_i)","path":"app/models/vacols/case_hearing.rb","position":46,"original_position":46,"commit_id":"627c41b6e55e2daf411f25b2ff47c7540b7538af","original_commit_id":"627c41b6e55e2daf411f25b2ff47c7540b7538af","user":{"login":"joofsh","id":2256237,"avatar_url":"https://avatars0.githubusercontent.com/u/2256237?v=4","gravatar_id":"","url":"https://api.github.com/users/joofsh","html_url":"https://github.com/joofsh","followers_url":"https://api.github.com/users/joofsh/followers","following_url":"https://api.github.com/users/joofsh/following{/other_user}","gists_url":"https://api.github.com/users/joofsh/gists{/gist_id}","starred_url":"https://api.github.com/users/joofsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joofsh/subscriptions","organizations_url":"https://api.github.com/users/joofsh/orgs","repos_url":"https://api.github.com/users/joofsh/repos","events_url":"https://api.github.com/users/joofsh/events{/privacy}","received_events_url":"https://api.github.com/users/joofsh/received_events","type":"User","site_admin":false},"body":"This does a 3rd query to VACOLS, right? But we should already have these child records from the `hearings.where(NOT_MASTER_RECORD)` on line 68","created_at":"2017-09-11T21:29:40Z","updated_at":"2017-09-11T21:29:52Z","html_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/3234#discussion_r138197081","pull_request_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments/138197081"},"html":{"href":"https://github.com/department-of-veterans-affairs/caseflow/pull/3234#discussion_r138197081"},"pull_request":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234"}}},"pull_request":{"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234","id":140405724,"html_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/3234","diff_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/3234.diff","patch_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/3234.patch","issue_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/3234","number":3234,"state":"open","locked":false,"title":"Anya/2468 upcoming hearings for judge","user":{"login":"aroltsch","id":3811786,"avatar_url":"https://avatars0.githubusercontent.com/u/3811786?v=4","gravatar_id":"","url":"https://api.github.com/users/aroltsch","html_url":"https://github.com/aroltsch","followers_url":"https://api.github.com/users/aroltsch/followers","following_url":"https://api.github.com/users/aroltsch/following{/other_user}","gists_url":"https://api.github.com/users/aroltsch/gists{/gist_id}","starred_url":"https://api.github.com/users/aroltsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aroltsch/subscriptions","organizations_url":"https://api.github.com/users/aroltsch/orgs","repos_url":"https://api.github.com/users/aroltsch/repos","events_url":"https://api.github.com/users/aroltsch/events{/privacy}","received_events_url":"https://api.github.com/users/aroltsch/received_events","type":"User","site_admin":false},"body":"connects #2468 \r\nFind hearings by css_id that are:\r\n1. children records for all hearing types that have no disposition or disposition `held` for the past 1 week\r\n2. video master records with no children\r\n3. TBD: travel board master records with no children.","created_at":"2017-09-11T18:37:44Z","updated_at":"2017-09-11T21:29:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61e864d0f27177b308fe20aaab7ee41cb605a976","assignee":{"login":"joofsh","id":2256237,"avatar_url":"https://avatars0.githubusercontent.com/u/2256237?v=4","gravatar_id":"","url":"https://api.github.com/users/joofsh","html_url":"https://github.com/joofsh","followers_url":"https://api.github.com/users/joofsh/followers","following_url":"https://api.github.com/users/joofsh/following{/other_user}","gists_url":"https://api.github.com/users/joofsh/gists{/gist_id}","starred_url":"https://api.github.com/users/joofsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joofsh/subscriptions","organizations_url":"https://api.github.com/users/joofsh/orgs","repos_url":"https://api.github.com/users/joofsh/repos","events_url":"https://api.github.com/users/joofsh/events{/privacy}","received_events_url":"https://api.github.com/users/joofsh/received_events","type":"User","site_admin":false},"assignees":[{"login":"joofsh","id":2256237,"avatar_url":"https://avatars0.githubusercontent.com/u/2256237?v=4","gravatar_id":"","url":"https://api.github.com/users/joofsh","html_url":"https://github.com/joofsh","followers_url":"https://api.github.com/users/joofsh/followers","following_url":"https://api.github.com/users/joofsh/following{/other_user}","gists_url":"https://api.github.com/users/joofsh/gists{/gist_id}","starred_url":"https://api.github.com/users/joofsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joofsh/subscriptions","organizations_url":"https://api.github.com/users/joofsh/orgs","repos_url":"https://api.github.com/users/joofsh/repos","events_url":"https://api.github.com/users/joofsh/events{/privacy}","received_events_url":"https://api.github.com/users/joofsh/received_events","type":"User","site_admin":false},{"login":"sharonwarner","id":4306128,"avatar_url":"https://avatars3.githubusercontent.com/u/4306128?v=4","gravatar_id":"","url":"https://api.github.com/users/sharonwarner","html_url":"https://github.com/sharonwarner","followers_url":"https://api.github.com/users/sharonwarner/followers","following_url":"https://api.github.com/users/sharonwarner/following{/other_user}","gists_url":"https://api.github.com/users/sharonwarner/gists{/gist_id}","starred_url":"https://api.github.com/users/sharonwarner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharonwarner/subscriptions","organizations_url":"https://api.github.com/users/sharonwarner/orgs","repos_url":"https://api.github.com/users/sharonwarner/repos","events_url":"https://api.github.com/users/sharonwarner/events{/privacy}","received_events_url":"https://api.github.com/users/sharonwarner/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234/commits","review_comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234/comments","review_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/3234/comments","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/627c41b6e55e2daf411f25b2ff47c7540b7538af","head":{"label":"department-of-veterans-affairs:anya/2468_upcoming_hearings_for_judge","ref":"anya/2468_upcoming_hearings_for_judge","sha":"627c41b6e55e2daf411f25b2ff47c7540b7538af","user":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"repo":{"id":51449239,"name":"caseflow","full_name":"department-of-veterans-affairs/caseflow","owner":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/department-of-veterans-affairs/caseflow","description":"Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans' Appeals.","fork":false,"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow","forks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/forks","keys_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/teams","hooks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/hooks","issue_events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/events{/number}","events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/events","assignees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/assignees{/user}","branches_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/branches{/branch}","tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/tags","blobs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/{sha}","languages_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/languages","stargazers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/stargazers","contributors_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contributors","subscribers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscribers","subscription_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscription","commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contents/{+path}","compare_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/merges","archive_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/downloads","issues_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues{/number}","pulls_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls{/number}","milestones_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/milestones{/number}","notifications_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/labels{/name}","releases_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/releases{/id}","deployments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/deployments","created_at":"2016-02-10T15:20:50Z","updated_at":"2017-08-25T14:00:15Z","pushed_at":"2017-09-11T21:27:35Z","git_url":"git://github.com/department-of-veterans-affairs/caseflow.git","ssh_url":"git@github.com:department-of-veterans-affairs/caseflow.git","clone_url":"https://github.com/department-of-veterans-affairs/caseflow.git","svn_url":"https://github.com/department-of-veterans-affairs/caseflow","homepage":"","size":32399,"stargazers_count":29,"watchers_count":29,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":478,"forks":17,"open_issues":478,"watchers":29,"default_branch":"master"}},"base":{"label":"department-of-veterans-affairs:master","ref":"master","sha":"7fdb77fae99e57738a6e7477bc9f3e17b8ae126f","user":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"repo":{"id":51449239,"name":"caseflow","full_name":"department-of-veterans-affairs/caseflow","owner":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/department-of-veterans-affairs/caseflow","description":"Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans' Appeals.","fork":false,"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow","forks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/forks","keys_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/teams","hooks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/hooks","issue_events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/events{/number}","events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/events","assignees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/assignees{/user}","branches_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/branches{/branch}","tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/tags","blobs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/{sha}","languages_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/languages","stargazers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/stargazers","contributors_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contributors","subscribers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscribers","subscription_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscription","commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contents/{+path}","compare_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/merges","archive_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/downloads","issues_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues{/number}","pulls_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls{/number}","milestones_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/milestones{/number}","notifications_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/labels{/name}","releases_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/releases{/id}","deployments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/deployments","created_at":"2016-02-10T15:20:50Z","updated_at":"2017-08-25T14:00:15Z","pushed_at":"2017-09-11T21:27:35Z","git_url":"git://github.com/department-of-veterans-affairs/caseflow.git","ssh_url":"git@github.com:department-of-veterans-affairs/caseflow.git","clone_url":"https://github.com/department-of-veterans-affairs/caseflow.git","svn_url":"https://github.com/department-of-veterans-affairs/caseflow","homepage":"","size":32399,"stargazers_count":29,"watchers_count":29,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":478,"forks":17,"open_issues":478,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234"},"html":{"href":"https://github.com/department-of-veterans-affairs/caseflow/pull/3234"},"issue":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/3234"},"comments":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/3234/comments"},"review_comments":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234/comments"},"review_comment":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/3234/commits"},"statuses":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/627c41b6e55e2daf411f25b2ff47c7540b7538af"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"joofsh"}}