{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/comments/68535854","id":68535854,"diff_hunk":"@@ -8,22 +8,66 @@\n  */\n package org.openmrs.module.radiology.order.web;\n \n+import java.io.File;\n+import java.io.IOException;\n+\n+import javax.servlet.http.HttpServletRequest;\n+\n+import org.openmrs.api.APIException;\n+import org.openmrs.module.radiology.RadiologyProperties;\n+import org.openmrs.module.radiology.report.template.MrrtReportTemplate;\n+import org.openmrs.module.radiology.report.template.MrrtReportTemplateFileParser;\n+import org.openmrs.module.radiology.report.template.MrrtReportTemplateService;\n+import org.openmrs.web.WebUtil;\n+import org.springframework.beans.factory.annotation.Autowired;\n import org.springframework.stereotype.Controller;\n import org.springframework.web.bind.annotation.RequestMapping;\n import org.springframework.web.bind.annotation.RequestMethod;\n+import org.springframework.web.multipart.MultipartFile;\n+import org.springframework.web.multipart.MultipartHttpServletRequest;\n import org.springframework.web.servlet.ModelAndView;\n \n @Controller\n @RequestMapping(RadiologyDashboardFormController.RADIOLOGY_DASHBOARD_FORM_REQUEST_MAPPING)\n public class RadiologyDashboardFormController {\n     \n     \n+    @Autowired\n+    private RadiologyProperties radiologyProperties;\n+    \n+    @Autowired\n+    private MrrtReportTemplateFileParser parser;","path":"omod/src/main/java/org/openmrs/module/radiology/order/web/RadiologyDashboardFormController.java","position":32,"original_position":32,"commit_id":"fdf566fe48a65f3e13bad36ae49b06c6100bd6a6","original_commit_id":"fdf566fe48a65f3e13bad36ae49b06c6100bd6a6","user":{"login":"teleivo","id":4661144,"avatar_url":"https://avatars.githubusercontent.com/u/4661144?v=3","gravatar_id":"","url":"https://api.github.com/users/teleivo","html_url":"https://github.com/teleivo","followers_url":"https://api.github.com/users/teleivo/followers","following_url":"https://api.github.com/users/teleivo/following{/other_user}","gists_url":"https://api.github.com/users/teleivo/gists{/gist_id}","starred_url":"https://api.github.com/users/teleivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teleivo/subscriptions","organizations_url":"https://api.github.com/users/teleivo/orgs","repos_url":"https://api.github.com/users/teleivo/repos","events_url":"https://api.github.com/users/teleivo/events{/privacy}","received_events_url":"https://api.github.com/users/teleivo/received_events","type":"User","site_admin":false},"body":"encapsulate the parser into the MrrtReportTemplateService via composition (the service should have a member of the parser interface, so we are able to inject different implementations of the parser).\r\n\r\nso the client just uses the MrrtReportTemplateService which provides a method like so\r\n\r\n`final MrrtReportTemplate template =  mrrtReportTemplateService.importMrrtReportTemplate(templateFile.getInputStream())`\r\n\r\nthis will do the validation, parsing and ensure we dont import multiple instances of the same report template.\r\n","created_at":"2016-06-27T08:01:50Z","updated_at":"2016-06-27T08:01:50Z","html_url":"https://github.com/openmrs/openmrs-module-radiology/pull/304#discussion_r68535854","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/comments/68535854"},"html":{"href":"https://github.com/openmrs/openmrs-module-radiology/pull/304#discussion_r68535854"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304","id":73813161,"html_url":"https://github.com/openmrs/openmrs-module-radiology/pull/304","diff_url":"https://github.com/openmrs/openmrs-module-radiology/pull/304.diff","patch_url":"https://github.com/openmrs/openmrs-module-radiology/pull/304.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/304","number":304,"state":"open","locked":false,"title":"RAD-272 Support for radiology report templates","user":{"login":"ivange94","id":11330494,"avatar_url":"https://avatars.githubusercontent.com/u/11330494?v=3","gravatar_id":"","url":"https://api.github.com/users/ivange94","html_url":"https://github.com/ivange94","followers_url":"https://api.github.com/users/ivange94/followers","following_url":"https://api.github.com/users/ivange94/following{/other_user}","gists_url":"https://api.github.com/users/ivange94/gists{/gist_id}","starred_url":"https://api.github.com/users/ivange94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivange94/subscriptions","organizations_url":"https://api.github.com/users/ivange94/orgs","repos_url":"https://api.github.com/users/ivange94/repos","events_url":"https://api.github.com/users/ivange94/events{/privacy}","received_events_url":"https://api.github.com/users/ivange94/received_events","type":"User","site_admin":false},"body":"<!--- Provide PR Title above as: 'RAD-JiraIssueNumber JiraIssueTitle' -->\r\nRAD-272 Support for radiology report templates\r\n\r\n## Description\r\nimplemented java pojo to represent templates and also created DAOs and well tested Service methods to save, get and delete templates. Also started with implementation of the templates tab, you can see it a screenshot here, http://picpaste.com/for_github-P2t4gp8a.png\r\n\r\n<!--- Please link to the issue here: -->\r\nsee https://issues.openmrs.org/browse/RAD-272\r\n\r\n","created_at":"2016-06-14T21:02:43Z","updated_at":"2016-06-27T08:01:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8029b105d91629a88292f4c06cdc01a6c2e664f9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304/comments","review_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/304/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/statuses/fdf566fe48a65f3e13bad36ae49b06c6100bd6a6","head":{"label":"ivange94:RAD-272","ref":"RAD-272","sha":"fdf566fe48a65f3e13bad36ae49b06c6100bd6a6","user":{"login":"ivange94","id":11330494,"avatar_url":"https://avatars.githubusercontent.com/u/11330494?v=3","gravatar_id":"","url":"https://api.github.com/users/ivange94","html_url":"https://github.com/ivange94","followers_url":"https://api.github.com/users/ivange94/followers","following_url":"https://api.github.com/users/ivange94/following{/other_user}","gists_url":"https://api.github.com/users/ivange94/gists{/gist_id}","starred_url":"https://api.github.com/users/ivange94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivange94/subscriptions","organizations_url":"https://api.github.com/users/ivange94/orgs","repos_url":"https://api.github.com/users/ivange94/repos","events_url":"https://api.github.com/users/ivange94/events{/privacy}","received_events_url":"https://api.github.com/users/ivange94/received_events","type":"User","site_admin":false},"repo":{"id":53416892,"name":"openmrs-module-radiology","full_name":"ivange94/openmrs-module-radiology","owner":{"login":"ivange94","id":11330494,"avatar_url":"https://avatars.githubusercontent.com/u/11330494?v=3","gravatar_id":"","url":"https://api.github.com/users/ivange94","html_url":"https://github.com/ivange94","followers_url":"https://api.github.com/users/ivange94/followers","following_url":"https://api.github.com/users/ivange94/following{/other_user}","gists_url":"https://api.github.com/users/ivange94/gists{/gist_id}","starred_url":"https://api.github.com/users/ivange94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivange94/subscriptions","organizations_url":"https://api.github.com/users/ivange94/orgs","repos_url":"https://api.github.com/users/ivange94/repos","events_url":"https://api.github.com/users/ivange94/events{/privacy}","received_events_url":"https://api.github.com/users/ivange94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ivange94/openmrs-module-radiology","description":"OpenMRS Radiology Module with dcm4chee","fork":true,"url":"https://api.github.com/repos/ivange94/openmrs-module-radiology","forks_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/forks","keys_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/teams","hooks_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/hooks","issue_events_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/issues/events{/number}","events_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/events","assignees_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/assignees{/user}","branches_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/branches{/branch}","tags_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/tags","blobs_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/git/refs{/sha}","trees_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/statuses/{sha}","languages_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/languages","stargazers_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/stargazers","contributors_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/contributors","subscribers_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/subscribers","subscription_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/subscription","commits_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/commits{/sha}","git_commits_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/git/commits{/sha}","comments_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/comments{/number}","issue_comment_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/issues/comments{/number}","contents_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/contents/{+path}","compare_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/merges","archive_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/downloads","issues_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/issues{/number}","pulls_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/pulls{/number}","milestones_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/milestones{/number}","notifications_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/labels{/name}","releases_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/releases{/id}","deployments_url":"https://api.github.com/repos/ivange94/openmrs-module-radiology/deployments","created_at":"2016-03-08T14:05:49Z","updated_at":"2016-03-08T14:05:50Z","pushed_at":"2016-06-25T20:03:29Z","git_url":"git://github.com/ivange94/openmrs-module-radiology.git","ssh_url":"git@github.com:ivange94/openmrs-module-radiology.git","clone_url":"https://github.com/ivange94/openmrs-module-radiology.git","svn_url":"https://github.com/ivange94/openmrs-module-radiology","homepage":null,"size":71658,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openmrs:master","ref":"master","sha":"7e7b42e51f418ac50eccda9d02f759da2edd893f","user":{"login":"openmrs","id":860776,"avatar_url":"https://avatars.githubusercontent.com/u/860776?v=3","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"repo":{"id":13028147,"name":"openmrs-module-radiology","full_name":"openmrs/openmrs-module-radiology","owner":{"login":"openmrs","id":860776,"avatar_url":"https://avatars.githubusercontent.com/u/860776?v=3","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmrs/openmrs-module-radiology","description":"OpenMRS Radiology Module with dcm4chee","fork":false,"url":"https://api.github.com/repos/openmrs/openmrs-module-radiology","forks_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/forks","keys_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/teams","hooks_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/hooks","issue_events_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/events{/number}","events_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/events","assignees_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/assignees{/user}","branches_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/branches{/branch}","tags_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/tags","blobs_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/statuses/{sha}","languages_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/languages","stargazers_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/stargazers","contributors_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/contributors","subscribers_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/subscribers","subscription_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/subscription","commits_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/contents/{+path}","compare_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/merges","archive_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/downloads","issues_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues{/number}","pulls_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls{/number}","milestones_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/milestones{/number}","notifications_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/labels{/name}","releases_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/releases{/id}","deployments_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/deployments","created_at":"2013-09-23T06:03:47Z","updated_at":"2016-05-06T23:06:59Z","pushed_at":"2016-06-25T20:03:29Z","git_url":"git://github.com/openmrs/openmrs-module-radiology.git","ssh_url":"git@github.com:openmrs/openmrs-module-radiology.git","clone_url":"https://github.com/openmrs/openmrs-module-radiology.git","svn_url":"https://github.com/openmrs/openmrs-module-radiology","homepage":null,"size":72308,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":1,"forks":34,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304"},"html":{"href":"https://github.com/openmrs/openmrs-module-radiology/pull/304"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/304"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/304/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304/comments"},"review_comment":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/304/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/statuses/fdf566fe48a65f3e13bad36ae49b06c6100bd6a6"}}}}
{"actor":{"display_login":"teleivo"}}