{"action":"created","comment":{"url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments/82676884","pull_request_review_id":3542201,"id":82676884,"diff_hunk":"@@ -0,0 +1,93 @@\n+class Thorax.Views.PatientBuilderCompare extends Thorax.Views.BonnieView\n+  className: 'patient-compare'\n+\n+  template: JST['patient_builder/patient_version_compare']\n+\n+  options:\n+    serialize: { children: false }\n+    populate: { context: true, children: false }\n+\n+  initialize: ->\n+    @selectedPopulation = @measure.get('displayedPopulation').get('index')\n+    @thePatient = @latestupsum.get('population_summaries')[@measure.get('displayedPopulation').get('index')].patients[@model.id]\n+\n+    if @viaRoute == \"fromEdit\"\n+      @fromEdit = true\n+      if !@thePatient.after_too_big\n+        if @thePatient.after?\n+          @populationPresentBeforeUpload = true\n+          @cachedBeforeResult = new Thorax.Models.CachedResult({\n+            rationale: @thePatient.after.rationale\n+            finalSpecifics: @thePatient.after.finalSpecifics}\n+            , {\n+              population: @measure.get('displayedPopulation')\n+              patient: @model\n+            }\n+          )\n+          @populationLogicViewBefore = new Thorax.Views.ComparePopulationLogic(isCompareView: true)\n+          @populationLogicViewBefore.setPopulation @cachedBeforeResult.population\n+          @populationLogicViewBefore.showRationale @cachedBeforeResult\n+        else\n+          @populationPresentBeforeUpload = false\n+      else\n+        @beforeTooBig = true\n+      \n+\n+    if @viaRoute == \"fromTimeline\"\n+      if !@thePatient.before_too_big\n+        if @beforemeasure.get('populations').at(@selectedPopulation)\n+          @populationPresentBeforeUpload = true\n+          @cachedBeforeResult = new Thorax.Models.CachedResult({\n+            rationale: @thePatient.before.rationale\n+            finalSpecifics: @thePatient.before.finalSpecifics}\n+            , {\n+              population: @beforemeasure.get('populations').at(@selectedPopulation)\n+              patient: @model\n+            }\n+          )\n+          \n+          @populationLogicViewBefore = new Thorax.Views.ComparePopulationLogic(isCompareView: true)\n+          @populationLogicViewBefore.setPopulation @cachedBeforeResult.population\n+          @populationLogicViewBefore.showRationale @cachedBeforeResult\n+        else\n+          @populationPresentBeforeUpload = false\n+      else\n+        @beforeTooBig = true\n+\n+    if @aftermeasure is undefined || @measure.id == @aftermeasure.id\n+      @populationLogicViewAfter = new Thorax.Views.BuilderPopulationLogic(isCompareView: true)\n+      @populationLogicViewAfter.setPopulation @measure.get('displayedPopulation')\n+      @populationLogicViewAfter.showRationale @model\n+      @populationPresentAfterUpload = true\n+    else if @thePatient.after? # is not undefined\n+      @cachedAfterResult = new Thorax.Models.CachedResult({\n+        rationale: @thePatient.after.rationale\n+        finalSpecifics: @thePatient.after.finalSpecifics}\n+        , {\n+          population: @aftermeasure.get('displayedPopulation')\n+          patient: @model\n+        }\n+      )\n+      @populationLogicViewAfter = new Thorax.Views.ComparePopulationLogic\n+      @populationLogicViewAfter.setPopulation @aftermeasure.get('displayedPopulation')\n+      @populationLogicViewAfter.showRationale @cachedAfterResult\n+      @populationPresentAfterUpload = true\n+    else\n+      @populationPresentAfterUpload = false\n+\n+    @render()  \n+  \n+# Modified Thorax.Views.BuilderPopulationLogic that accepts new Thorax.Models.cachedResult\n+class Thorax.Views.ComparePopulationLogic extends Thorax.LayoutView","path":"app/assets/javascripts/views/patient_builder/patient_version_compare.js.coffee","position":81,"original_position":81,"commit_id":"0c984ac38cc5813a02f9f7789fa6ffc332dd008f","original_commit_id":"0c984ac38cc5813a02f9f7789fa6ffc332dd008f","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":"based on the comment above, I'd expect this to subclass `Thorax.Views.BuilderPopulationLogic`. Is there a reason it isn't? It looks like most of the code below is duplicated.","created_at":"2016-10-10T20:28:52Z","updated_at":"2016-10-10T20:31:56Z","html_url":"https://github.com/projecttacoma/bonnie/pull/567#discussion_r82676884","pull_request_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567","_links":{"self":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments/82676884"},"html":{"href":"https://github.com/projecttacoma/bonnie/pull/567#discussion_r82676884"},"pull_request":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567"}}},"pull_request":{"url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567","id":82270636,"html_url":"https://github.com/projecttacoma/bonnie/pull/567","diff_url":"https://github.com/projecttacoma/bonnie/pull/567.diff","patch_url":"https://github.com/projecttacoma/bonnie/pull/567.patch","issue_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/567","number":567,"state":"open","locked":false,"title":"Measure History PR Dry Run","user":{"login":"hossenlopp","id":11613067,"avatar_url":"https://avatars.githubusercontent.com/u/11613067?v=3","gravatar_id":"","url":"https://api.github.com/users/hossenlopp","html_url":"https://github.com/hossenlopp","followers_url":"https://api.github.com/users/hossenlopp/followers","following_url":"https://api.github.com/users/hossenlopp/following{/other_user}","gists_url":"https://api.github.com/users/hossenlopp/gists{/gist_id}","starred_url":"https://api.github.com/users/hossenlopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hossenlopp/subscriptions","organizations_url":"https://api.github.com/users/hossenlopp/orgs","repos_url":"https://api.github.com/users/hossenlopp/repos","events_url":"https://api.github.com/users/hossenlopp/events{/privacy}","received_events_url":"https://api.github.com/users/hossenlopp/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-22T21:56:49Z","updated_at":"2016-10-10T20:31:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"358007edcf3b3925c69a83cf938dabeaf6dc982f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567/commits","review_comments_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567/comments","review_comment_url":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projecttacoma/bonnie/issues/567/comments","statuses_url":"https://api.github.com/repos/projecttacoma/bonnie/statuses/0c984ac38cc5813a02f9f7789fa6ffc332dd008f","head":{"label":"projecttacoma:measure_history","ref":"measure_history","sha":"0c984ac38cc5813a02f9f7789fa6ffc332dd008f","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-09-29T19:07:04Z","pushed_at":"2016-10-10T13:57:14Z","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":79577,"stargazers_count":16,"watchers_count":16,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":9,"forks":20,"open_issues":9,"watchers":16,"default_branch":"master"}},"base":{"label":"projecttacoma:measure_history_base","ref":"measure_history_base","sha":"9bcce328bd64f2984c5fb51e15cd4e0ba3c8630c","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-09-29T19:07:04Z","pushed_at":"2016-10-10T13:57:14Z","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":79577,"stargazers_count":16,"watchers_count":16,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":9,"forks":20,"open_issues":9,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567"},"html":{"href":"https://github.com/projecttacoma/bonnie/pull/567"},"issue":{"href":"https://api.github.com/repos/projecttacoma/bonnie/issues/567"},"comments":{"href":"https://api.github.com/repos/projecttacoma/bonnie/issues/567/comments"},"review_comments":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567/comments"},"review_comment":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projecttacoma/bonnie/pulls/567/commits"},"statuses":{"href":"https://api.github.com/repos/projecttacoma/bonnie/statuses/0c984ac38cc5813a02f9f7789fa6ffc332dd008f"}}}}
{"actor":{"display_login":"edeyoung"}}