{"action":"created","comment":{"url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/comments/33607649","id":33607649,"diff_hunk":"@@ -0,0 +1,108 @@\n+package gov.va.med.srcalc.web.controller.admin;\n+\n+import static org.junit.Assert.*;\n+import gov.va.med.srcalc.domain.model.Procedure;\n+import gov.va.med.srcalc.util.TabularUploadError;\n+import gov.va.med.srcalc.util.ValidationCodes;\n+import gov.va.med.srcalc.web.controller.admin.ProcedureCsvReader.ParseResult;\n+\n+import java.io.IOException;\n+import java.net.URL;\n+\n+import org.junit.Test;\n+\n+import com.google.common.base.Charsets;\n+import com.google.common.collect.*;\n+import com.google.common.io.CharSource;\n+import com.google.common.io.Resources;\n+\n+public class ProcedureCsvReaderTest\n+{\n+    /**\n+     * Points to a CSV file on the classpath which represents a valid procedures upload.\n+     */\n+    public static final URL VALID_PROCEDURES_RESOURCE = Resources.getResource(\n+            ProcedureCsvReaderTest.class, \"valid_procedures_upload.csv\");\n+    \n+    /**\n+     * These are the procedures in {@link #VALID_PROCEDURES_RESOURCE}.\n+     */\n+    public static final ImmutableList<Procedure> VALID_PROCEDURES = ImmutableList.of(\n+            new Procedure(\"00012\", 1.45f, \"Short Desc One\", \"Procedure Twelve Long Description\", \"NotinSurgCM\", false),\n+            new Procedure(\"10002\", 7.56f, \"Procedure 10002 desc\", \"Procedure Ten Thousand and Two\", \"Complex\", true));\n+\n+    @Test\n+    public final void testReadProceduresValid() throws IOException\n+    {\n+        final CharSource validCsv =\n+                Resources.asCharSource(VALID_PROCEDURES_RESOURCE, Charsets.US_ASCII);\n+        \n+        final ProcedureCsvReader procedureReader = new ProcedureCsvReader();\n+        final ParseResult result =\n+                procedureReader.readProcedures(validCsv.openStream());\n+        \n+        /* Verification */\n+        assertEquals(0, result.getErrors().size());\n+        assertEquals(VALID_PROCEDURES, result.getProcedures());\n+    }\n+    \n+    @Test\n+    public final void testReadCorruptCsv() throws IOException\n+    {\n+        final CharSource corruptCsv = Resources.asCharSource(\n+                Resources.getResource(getClass(), \"invalid.csv\"), Charsets.US_ASCII);","path":"srcalc/src/test/java/gov/va/med/srcalc/web/controller/admin/ProcedureCsvReaderTest.java","position":53,"original_position":53,"commit_id":"96df5002833c4f2fa46c9d46e65273832817e462","original_commit_id":"96df5002833c4f2fa46c9d46e65273832817e462","user":{"login":"jamesbigmac","id":10212113,"avatar_url":"https://avatars.githubusercontent.com/u/10212113?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesbigmac","html_url":"https://github.com/jamesbigmac","followers_url":"https://api.github.com/users/jamesbigmac/followers","following_url":"https://api.github.com/users/jamesbigmac/following{/other_user}","gists_url":"https://api.github.com/users/jamesbigmac/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesbigmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesbigmac/subscriptions","organizations_url":"https://api.github.com/users/jamesbigmac/orgs","repos_url":"https://api.github.com/users/jamesbigmac/repos","events_url":"https://api.github.com/users/jamesbigmac/events{/privacy}","received_events_url":"https://api.github.com/users/jamesbigmac/received_events","type":"User","site_admin":false},"body":"The URL could also be a constant in this class.","created_at":"2015-06-30T18:36:25Z","updated_at":"2015-06-30T18:36:25Z","html_url":"https://github.com/VHAINNOVATIONS/ASRCM/pull/94#discussion_r33607649","pull_request_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/comments/33607649"},"html":{"href":"https://github.com/VHAINNOVATIONS/ASRCM/pull/94#discussion_r33607649"},"pull_request":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94","id":38810338,"html_url":"https://github.com/VHAINNOVATIONS/ASRCM/pull/94","diff_url":"https://github.com/VHAINNOVATIONS/ASRCM/pull/94.diff","patch_url":"https://github.com/VHAINNOVATIONS/ASRCM/pull/94.patch","issue_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/94","number":94,"state":"open","locked":false,"title":"ASRC-10: support uploading new procedure set","user":{"login":"dgtombs","id":5116096,"avatar_url":"https://avatars.githubusercontent.com/u/5116096?v=3","gravatar_id":"","url":"https://api.github.com/users/dgtombs","html_url":"https://github.com/dgtombs","followers_url":"https://api.github.com/users/dgtombs/followers","following_url":"https://api.github.com/users/dgtombs/following{/other_user}","gists_url":"https://api.github.com/users/dgtombs/gists{/gist_id}","starred_url":"https://api.github.com/users/dgtombs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgtombs/subscriptions","organizations_url":"https://api.github.com/users/dgtombs/orgs","repos_url":"https://api.github.com/users/dgtombs/repos","events_url":"https://api.github.com/users/dgtombs/events{/privacy}","received_events_url":"https://api.github.com/users/dgtombs/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-29T19:50:16Z","updated_at":"2015-06-30T18:36:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f6d5edc6664a06ecb17b753eef3905f0d4eb863","assignee":{"login":"jamesbigmac","id":10212113,"avatar_url":"https://avatars.githubusercontent.com/u/10212113?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesbigmac","html_url":"https://github.com/jamesbigmac","followers_url":"https://api.github.com/users/jamesbigmac/followers","following_url":"https://api.github.com/users/jamesbigmac/following{/other_user}","gists_url":"https://api.github.com/users/jamesbigmac/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesbigmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesbigmac/subscriptions","organizations_url":"https://api.github.com/users/jamesbigmac/orgs","repos_url":"https://api.github.com/users/jamesbigmac/repos","events_url":"https://api.github.com/users/jamesbigmac/events{/privacy}","received_events_url":"https://api.github.com/users/jamesbigmac/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94/commits","review_comments_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94/comments","review_comment_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/94/comments","statuses_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/statuses/96df5002833c4f2fa46c9d46e65273832817e462","head":{"label":"VHAINNOVATIONS:ASRC-10","ref":"ASRC-10","sha":"96df5002833c4f2fa46c9d46e65273832817e462","user":{"login":"VHAINNOVATIONS","id":1252476,"avatar_url":"https://avatars.githubusercontent.com/u/1252476?v=3","gravatar_id":"","url":"https://api.github.com/users/VHAINNOVATIONS","html_url":"https://github.com/VHAINNOVATIONS","followers_url":"https://api.github.com/users/VHAINNOVATIONS/followers","following_url":"https://api.github.com/users/VHAINNOVATIONS/following{/other_user}","gists_url":"https://api.github.com/users/VHAINNOVATIONS/gists{/gist_id}","starred_url":"https://api.github.com/users/VHAINNOVATIONS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VHAINNOVATIONS/subscriptions","organizations_url":"https://api.github.com/users/VHAINNOVATIONS/orgs","repos_url":"https://api.github.com/users/VHAINNOVATIONS/repos","events_url":"https://api.github.com/users/VHAINNOVATIONS/events{/privacy}","received_events_url":"https://api.github.com/users/VHAINNOVATIONS/received_events","type":"Organization","site_admin":false},"repo":{"id":26819438,"name":"ASRCM","full_name":"VHAINNOVATIONS/ASRCM","owner":{"login":"VHAINNOVATIONS","id":1252476,"avatar_url":"https://avatars.githubusercontent.com/u/1252476?v=3","gravatar_id":"","url":"https://api.github.com/users/VHAINNOVATIONS","html_url":"https://github.com/VHAINNOVATIONS","followers_url":"https://api.github.com/users/VHAINNOVATIONS/followers","following_url":"https://api.github.com/users/VHAINNOVATIONS/following{/other_user}","gists_url":"https://api.github.com/users/VHAINNOVATIONS/gists{/gist_id}","starred_url":"https://api.github.com/users/VHAINNOVATIONS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VHAINNOVATIONS/subscriptions","organizations_url":"https://api.github.com/users/VHAINNOVATIONS/orgs","repos_url":"https://api.github.com/users/VHAINNOVATIONS/repos","events_url":"https://api.github.com/users/VHAINNOVATIONS/events{/privacy}","received_events_url":"https://api.github.com/users/VHAINNOVATIONS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VHAINNOVATIONS/ASRCM","description":"The Automated Surgical Risk Calculator for Mortality Innovation is a project to develop a tool from CPRS through the “Tools” drop down that will auto-fill pertinent information into the developed risk calculator.  The Automated Risk Calculator will utilize the generated data and allow for the user to manually input required information to support clinical decision-making regarding perioperative risk.  The tool will then allow for information to be written back to the patients file in CPRS.  In addition, a secondary tool will be created to store and develop a repository for research of risk calculations developed.  ","fork":false,"url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM","forks_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/forks","keys_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/teams","hooks_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/hooks","issue_events_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/events{/number}","events_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/events","assignees_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/assignees{/user}","branches_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/branches{/branch}","tags_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/tags","blobs_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/refs{/sha}","trees_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/statuses/{sha}","languages_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/languages","stargazers_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/stargazers","contributors_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/contributors","subscribers_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/subscribers","subscription_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/subscription","commits_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/commits{/sha}","git_commits_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/commits{/sha}","comments_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/comments{/number}","issue_comment_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/comments{/number}","contents_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/contents/{+path}","compare_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/merges","archive_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/downloads","issues_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues{/number}","pulls_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls{/number}","milestones_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/milestones{/number}","notifications_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/labels{/name}","releases_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/releases{/id}","created_at":"2014-11-18T16:48:50Z","updated_at":"2015-05-08T20:09:42Z","pushed_at":"2015-06-30T16:46:28Z","git_url":"git://github.com/VHAINNOVATIONS/ASRCM.git","ssh_url":"git@github.com:VHAINNOVATIONS/ASRCM.git","clone_url":"https://github.com/VHAINNOVATIONS/ASRCM.git","svn_url":"https://github.com/VHAINNOVATIONS/ASRCM","homepage":null,"size":10684,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"VHAINNOVATIONS:master","ref":"master","sha":"0b20216e9b1990af24773332174bfb60b28f7ca1","user":{"login":"VHAINNOVATIONS","id":1252476,"avatar_url":"https://avatars.githubusercontent.com/u/1252476?v=3","gravatar_id":"","url":"https://api.github.com/users/VHAINNOVATIONS","html_url":"https://github.com/VHAINNOVATIONS","followers_url":"https://api.github.com/users/VHAINNOVATIONS/followers","following_url":"https://api.github.com/users/VHAINNOVATIONS/following{/other_user}","gists_url":"https://api.github.com/users/VHAINNOVATIONS/gists{/gist_id}","starred_url":"https://api.github.com/users/VHAINNOVATIONS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VHAINNOVATIONS/subscriptions","organizations_url":"https://api.github.com/users/VHAINNOVATIONS/orgs","repos_url":"https://api.github.com/users/VHAINNOVATIONS/repos","events_url":"https://api.github.com/users/VHAINNOVATIONS/events{/privacy}","received_events_url":"https://api.github.com/users/VHAINNOVATIONS/received_events","type":"Organization","site_admin":false},"repo":{"id":26819438,"name":"ASRCM","full_name":"VHAINNOVATIONS/ASRCM","owner":{"login":"VHAINNOVATIONS","id":1252476,"avatar_url":"https://avatars.githubusercontent.com/u/1252476?v=3","gravatar_id":"","url":"https://api.github.com/users/VHAINNOVATIONS","html_url":"https://github.com/VHAINNOVATIONS","followers_url":"https://api.github.com/users/VHAINNOVATIONS/followers","following_url":"https://api.github.com/users/VHAINNOVATIONS/following{/other_user}","gists_url":"https://api.github.com/users/VHAINNOVATIONS/gists{/gist_id}","starred_url":"https://api.github.com/users/VHAINNOVATIONS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VHAINNOVATIONS/subscriptions","organizations_url":"https://api.github.com/users/VHAINNOVATIONS/orgs","repos_url":"https://api.github.com/users/VHAINNOVATIONS/repos","events_url":"https://api.github.com/users/VHAINNOVATIONS/events{/privacy}","received_events_url":"https://api.github.com/users/VHAINNOVATIONS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VHAINNOVATIONS/ASRCM","description":"The Automated Surgical Risk Calculator for Mortality Innovation is a project to develop a tool from CPRS through the “Tools” drop down that will auto-fill pertinent information into the developed risk calculator.  The Automated Risk Calculator will utilize the generated data and allow for the user to manually input required information to support clinical decision-making regarding perioperative risk.  The tool will then allow for information to be written back to the patients file in CPRS.  In addition, a secondary tool will be created to store and develop a repository for research of risk calculations developed.  ","fork":false,"url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM","forks_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/forks","keys_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/teams","hooks_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/hooks","issue_events_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/events{/number}","events_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/events","assignees_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/assignees{/user}","branches_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/branches{/branch}","tags_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/tags","blobs_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/refs{/sha}","trees_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/statuses/{sha}","languages_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/languages","stargazers_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/stargazers","contributors_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/contributors","subscribers_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/subscribers","subscription_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/subscription","commits_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/commits{/sha}","git_commits_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/git/commits{/sha}","comments_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/comments{/number}","issue_comment_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/comments{/number}","contents_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/contents/{+path}","compare_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/merges","archive_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/downloads","issues_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues{/number}","pulls_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls{/number}","milestones_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/milestones{/number}","notifications_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/labels{/name}","releases_url":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/releases{/id}","created_at":"2014-11-18T16:48:50Z","updated_at":"2015-05-08T20:09:42Z","pushed_at":"2015-06-30T16:46:28Z","git_url":"git://github.com/VHAINNOVATIONS/ASRCM.git","ssh_url":"git@github.com:VHAINNOVATIONS/ASRCM.git","clone_url":"https://github.com/VHAINNOVATIONS/ASRCM.git","svn_url":"https://github.com/VHAINNOVATIONS/ASRCM","homepage":null,"size":10684,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94"},"html":{"href":"https://github.com/VHAINNOVATIONS/ASRCM/pull/94"},"issue":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/94"},"comments":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/VHAINNOVATIONS/ASRCM/statuses/96df5002833c4f2fa46c9d46e65273832817e462"}}}}