{"action":"created","comment":{"url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments/53337953","id":53337953,"diff_hunk":"@@ -171,8 +178,11 @@ def self.generate_rows(sheet, records, measure, population_index, population_cat\n \n       # populates the array with expected values for each population\n       population_categories.each do |population_category|\n-        if patient[:expected_values] && patient[:expected_values][population_index] && patient[:expected_values][population_index][population_category]\n-          patient_row.push(patient[:expected_values][population_index][population_category])\n+        # Filter out the expected values that match the measure hqmf_set_id. Return the first object in the array.\n+        expected_values = patient[:expected_values].select{ | expected_values | expected_values[:measure_id] == measure.hqmf_set_id && \n+                                                                                expected_values[:population_index] == population_index.to_i }.compact.try(:first)","path":"lib/patient_export.rb","position":22,"original_position":22,"commit_id":"ba3a887ae5035ed0db027fbb231488f126d3dcaf","original_commit_id":"ba3a887ae5035ed0db027fbb231488f126d3dcaf","user":{"login":"edeyoung","id":11574199,"avatar_url":"https://avatars.githubusercontent.com/u/11574199?v=3","gravatar_id":"","url":"https://api.github.com/users/edeyoung","html_url":"https://github.com/edeyoung","followers_url":"https://api.github.com/users/edeyoung/followers","following_url":"https://api.github.com/users/edeyoung/following{/other_user}","gists_url":"https://api.github.com/users/edeyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/edeyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edeyoung/subscriptions","organizations_url":"https://api.github.com/users/edeyoung/orgs","repos_url":"https://api.github.com/users/edeyoung/repos","events_url":"https://api.github.com/users/edeyoung/events{/privacy}","received_events_url":"https://api.github.com/users/edeyoung/received_events","type":"User","site_admin":false},"body":"`compact` is being used here, which looks like it removes `nil` values from an array. Would a `nil` value ever be added to this array?","created_at":"2016-02-18T16:19:53Z","updated_at":"2016-02-18T16:19:53Z","html_url":"https://github.com/projecttacoma/bonnie/pull/516#discussion_r53337953","pull_request_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516","_links":{"self":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments/53337953"},"html":{"href":"https://github.com/projecttacoma/bonnie/pull/516#discussion_r53337953"},"pull_request":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516"}}},"pull_request":{"url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516","id":59225462,"html_url":"https://github.com/projecttacoma/bonnie/pull/516","diff_url":"https://github.com/projecttacoma/bonnie/pull/516.diff","patch_url":"https://github.com/projecttacoma/bonnie/pull/516.patch","issue_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/516","number":516,"state":"open","locked":false,"title":"Excel export changes","user":{"login":"jbradl11","id":1568999,"avatar_url":"https://avatars.githubusercontent.com/u/1568999?v=3","gravatar_id":"","url":"https://api.github.com/users/jbradl11","html_url":"https://github.com/jbradl11","followers_url":"https://api.github.com/users/jbradl11/followers","following_url":"https://api.github.com/users/jbradl11/following{/other_user}","gists_url":"https://api.github.com/users/jbradl11/gists{/gist_id}","starred_url":"https://api.github.com/users/jbradl11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbradl11/subscriptions","organizations_url":"https://api.github.com/users/jbradl11/orgs","repos_url":"https://api.github.com/users/jbradl11/repos","events_url":"https://api.github.com/users/jbradl11/events{/privacy}","received_events_url":"https://api.github.com/users/jbradl11/received_events","type":"User","site_admin":false},"body":"Fix for BONNIE-140. Expired now is set to \"FALSE\" if the value is \"nil\". \r\n\r\nAlso a small update to remove duplicate clauses in each population type. ","created_at":"2016-02-12T20:18:39Z","updated_at":"2016-02-18T16:19:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ca7f0f6a831046ada6dc3119defcc787c711c9f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516/commits","review_comments_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516/comments","review_comment_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/516/comments","statuses_url":"https://api.github.com/repos/projecttacoma/bonnie/statuses/ba3a887ae5035ed0db027fbb231488f126d3dcaf","head":{"label":"projecttacoma:excel_export_changes","ref":"excel_export_changes","sha":"ba3a887ae5035ed0db027fbb231488f126d3dcaf","user":{"login":"projecttacoma","id":5497023,"avatar_url":"https://avatars.githubusercontent.com/u/5497023?v=3","gravatar_id":"","url":"https://api.github.com/users/projecttacoma","html_url":"https://github.com/projecttacoma","followers_url":"https://api.github.com/users/projecttacoma/followers","following_url":"https://api.github.com/users/projecttacoma/following{/other_user}","gists_url":"https://api.github.com/users/projecttacoma/gists{/gist_id}","starred_url":"https://api.github.com/users/projecttacoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecttacoma/subscriptions","organizations_url":"https://api.github.com/users/projecttacoma/orgs","repos_url":"https://api.github.com/users/projecttacoma/repos","events_url":"https://api.github.com/users/projecttacoma/events{/privacy}","received_events_url":"https://api.github.com/users/projecttacoma/received_events","type":"Organization","site_admin":false},"repo":{"id":12958279,"name":"bonnie","full_name":"projecttacoma/bonnie","owner":{"login":"projecttacoma","id":5497023,"avatar_url":"https://avatars.githubusercontent.com/u/5497023?v=3","gravatar_id":"","url":"https://api.github.com/users/projecttacoma","html_url":"https://github.com/projecttacoma","followers_url":"https://api.github.com/users/projecttacoma/followers","following_url":"https://api.github.com/users/projecttacoma/following{/other_user}","gists_url":"https://api.github.com/users/projecttacoma/gists{/gist_id}","starred_url":"https://api.github.com/users/projecttacoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecttacoma/subscriptions","organizations_url":"https://api.github.com/users/projecttacoma/orgs","repos_url":"https://api.github.com/users/projecttacoma/repos","events_url":"https://api.github.com/users/projecttacoma/events{/privacy}","received_events_url":"https://api.github.com/users/projecttacoma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecttacoma/bonnie","description":"Clinical Quality Measure Testing Tool","fork":false,"url":"https://api.github.com/repos/projecttacoma/bonnie","forks_url":"https://api.github.com/repos/projecttacoma/bonnie/forks","keys_url":"https://api.github.com/repos/projecttacoma/bonnie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecttacoma/bonnie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecttacoma/bonnie/teams","hooks_url":"https://api.github.com/repos/projecttacoma/bonnie/hooks","issue_events_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/events{/number}","events_url":"https://api.github.com/repos/projecttacoma/bonnie/events","assignees_url":"https://api.github.com/repos/projecttacoma/bonnie/assignees{/user}","branches_url":"https://api.github.com/repos/projecttacoma/bonnie/branches{/branch}","tags_url":"https://api.github.com/repos/projecttacoma/bonnie/tags","blobs_url":"https://api.github.com/repos/projecttacoma/bonnie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecttacoma/bonnie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecttacoma/bonnie/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecttacoma/bonnie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecttacoma/bonnie/statuses/{sha}","languages_url":"https://api.github.com/repos/projecttacoma/bonnie/languages","stargazers_url":"https://api.github.com/repos/projecttacoma/bonnie/stargazers","contributors_url":"https://api.github.com/repos/projecttacoma/bonnie/contributors","subscribers_url":"https://api.github.com/repos/projecttacoma/bonnie/subscribers","subscription_url":"https://api.github.com/repos/projecttacoma/bonnie/subscription","commits_url":"https://api.github.com/repos/projecttacoma/bonnie/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecttacoma/bonnie/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecttacoma/bonnie/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecttacoma/bonnie/contents/{+path}","compare_url":"https://api.github.com/repos/projecttacoma/bonnie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecttacoma/bonnie/merges","archive_url":"https://api.github.com/repos/projecttacoma/bonnie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecttacoma/bonnie/downloads","issues_url":"https://api.github.com/repos/projecttacoma/bonnie/issues{/number}","pulls_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls{/number}","milestones_url":"https://api.github.com/repos/projecttacoma/bonnie/milestones{/number}","notifications_url":"https://api.github.com/repos/projecttacoma/bonnie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecttacoma/bonnie/labels{/name}","releases_url":"https://api.github.com/repos/projecttacoma/bonnie/releases{/id}","deployments_url":"https://api.github.com/repos/projecttacoma/bonnie/deployments","created_at":"2013-09-19T20:11:14Z","updated_at":"2016-01-14T22:22:07Z","pushed_at":"2016-02-18T00:34:20Z","git_url":"git://github.com/projecttacoma/bonnie.git","ssh_url":"git@github.com:projecttacoma/bonnie.git","clone_url":"https://github.com/projecttacoma/bonnie.git","svn_url":"https://github.com/projecttacoma/bonnie","homepage":null,"size":48756,"stargazers_count":13,"watchers_count":13,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":4,"forks":17,"open_issues":4,"watchers":13,"default_branch":"master"}},"base":{"label":"projecttacoma:master","ref":"master","sha":"cd23332d94ab52096eabef2be9e07869fa8aa2c2","user":{"login":"projecttacoma","id":5497023,"avatar_url":"https://avatars.githubusercontent.com/u/5497023?v=3","gravatar_id":"","url":"https://api.github.com/users/projecttacoma","html_url":"https://github.com/projecttacoma","followers_url":"https://api.github.com/users/projecttacoma/followers","following_url":"https://api.github.com/users/projecttacoma/following{/other_user}","gists_url":"https://api.github.com/users/projecttacoma/gists{/gist_id}","starred_url":"https://api.github.com/users/projecttacoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecttacoma/subscriptions","organizations_url":"https://api.github.com/users/projecttacoma/orgs","repos_url":"https://api.github.com/users/projecttacoma/repos","events_url":"https://api.github.com/users/projecttacoma/events{/privacy}","received_events_url":"https://api.github.com/users/projecttacoma/received_events","type":"Organization","site_admin":false},"repo":{"id":12958279,"name":"bonnie","full_name":"projecttacoma/bonnie","owner":{"login":"projecttacoma","id":5497023,"avatar_url":"https://avatars.githubusercontent.com/u/5497023?v=3","gravatar_id":"","url":"https://api.github.com/users/projecttacoma","html_url":"https://github.com/projecttacoma","followers_url":"https://api.github.com/users/projecttacoma/followers","following_url":"https://api.github.com/users/projecttacoma/following{/other_user}","gists_url":"https://api.github.com/users/projecttacoma/gists{/gist_id}","starred_url":"https://api.github.com/users/projecttacoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecttacoma/subscriptions","organizations_url":"https://api.github.com/users/projecttacoma/orgs","repos_url":"https://api.github.com/users/projecttacoma/repos","events_url":"https://api.github.com/users/projecttacoma/events{/privacy}","received_events_url":"https://api.github.com/users/projecttacoma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecttacoma/bonnie","description":"Clinical Quality Measure Testing Tool","fork":false,"url":"https://api.github.com/repos/projecttacoma/bonnie","forks_url":"https://api.github.com/repos/projecttacoma/bonnie/forks","keys_url":"https://api.github.com/repos/projecttacoma/bonnie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecttacoma/bonnie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecttacoma/bonnie/teams","hooks_url":"https://api.github.com/repos/projecttacoma/bonnie/hooks","issue_events_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/events{/number}","events_url":"https://api.github.com/repos/projecttacoma/bonnie/events","assignees_url":"https://api.github.com/repos/projecttacoma/bonnie/assignees{/user}","branches_url":"https://api.github.com/repos/projecttacoma/bonnie/branches{/branch}","tags_url":"https://api.github.com/repos/projecttacoma/bonnie/tags","blobs_url":"https://api.github.com/repos/projecttacoma/bonnie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecttacoma/bonnie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecttacoma/bonnie/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecttacoma/bonnie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecttacoma/bonnie/statuses/{sha}","languages_url":"https://api.github.com/repos/projecttacoma/bonnie/languages","stargazers_url":"https://api.github.com/repos/projecttacoma/bonnie/stargazers","contributors_url":"https://api.github.com/repos/projecttacoma/bonnie/contributors","subscribers_url":"https://api.github.com/repos/projecttacoma/bonnie/subscribers","subscription_url":"https://api.github.com/repos/projecttacoma/bonnie/subscription","commits_url":"https://api.github.com/repos/projecttacoma/bonnie/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecttacoma/bonnie/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecttacoma/bonnie/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecttacoma/bonnie/contents/{+path}","compare_url":"https://api.github.com/repos/projecttacoma/bonnie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecttacoma/bonnie/merges","archive_url":"https://api.github.com/repos/projecttacoma/bonnie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecttacoma/bonnie/downloads","issues_url":"https://api.github.com/repos/projecttacoma/bonnie/issues{/number}","pulls_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls{/number}","milestones_url":"https://api.github.com/repos/projecttacoma/bonnie/milestones{/number}","notifications_url":"https://api.github.com/repos/projecttacoma/bonnie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecttacoma/bonnie/labels{/name}","releases_url":"https://api.github.com/repos/projecttacoma/bonnie/releases{/id}","deployments_url":"https://api.github.com/repos/projecttacoma/bonnie/deployments","created_at":"2013-09-19T20:11:14Z","updated_at":"2016-01-14T22:22:07Z","pushed_at":"2016-02-18T00:34:20Z","git_url":"git://github.com/projecttacoma/bonnie.git","ssh_url":"git@github.com:projecttacoma/bonnie.git","clone_url":"https://github.com/projecttacoma/bonnie.git","svn_url":"https://github.com/projecttacoma/bonnie","homepage":null,"size":48756,"stargazers_count":13,"watchers_count":13,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":4,"forks":17,"open_issues":4,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516"},"html":{"href":"https://github.com/projecttacoma/bonnie/pull/516"},"issue":{"href":"https://api.github.com/repos/projecttacoma/bonnie/issues/516"},"comments":{"href":"https://api.github.com/repos/projecttacoma/bonnie/issues/516/comments"},"review_comments":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516/comments"},"review_comment":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/516/commits"},"statuses":{"href":"https://api.github.com/repos/projecttacoma/bonnie/statuses/ba3a887ae5035ed0db027fbb231488f126d3dcaf"}}}}