{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/comments/72968021","id":72968021,"diff_hunk":"@@ -0,0 +1,74 @@\n+/**\n+ * This Source Code Form is subject to the terms of the Mozilla Public License,\n+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can\n+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under\n+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.\n+ *\n+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS\n+ * graphic logo is a trademark of OpenMRS Inc.\n+ */\n+package org.openmrs.module.radiology.report.template;\n+\n+import java.io.IOException;\n+\n+import javax.servlet.http.HttpServletRequest;\n+\n+import org.openmrs.web.WebConstants;\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.bind.annotation.RequestParam;\n+import org.springframework.web.servlet.ModelAndView;\n+\n+/**\n+ * Controller for the form handling display of {@code MrrtReportTemplate's}.\n+ */\n+@Controller\n+@RequestMapping(MrrtReportTemplateFormController.MRRT_REPORT_TEMPLATE_FORM_REQUEST_MAPPING)\n+public class MrrtReportTemplateFormController {\n+    \n+    \n+    protected static final String MRRT_REPORT_TEMPLATE_FORM_REQUEST_MAPPING = \"/module/radiology/mrrtReportTemplate.form\";\n+    \n+    static final String MRRT_REPORT_TEMPLATE_FORM_VIEW = \"/module/radiology/reports/templates/mrrtReportTemplateForm\";\n+    \n+    @Autowired\n+    private MrrtReportTemplateService mrrtReportTemplateService;\n+    \n+    /**\n+     * Handles request for view an {@code MrrtReportTemplate}.\n+     * \n+     * @param request\n+     *            the the HttpServletRequest to view MrrtReportTemplates\n+     * @param templateId\n+     *            the template uuid of the MrrtReportTemplate being requested\n+     * @return modelAndView of the report template form page containing the body content of template inside a model object\n+     * @should return the model and view of the report template form page containing template body in model object\n+     * @should return the model and view of the radiology dashboard page with error message if io exception is thrown\n+     * @should return the model and view of the radiology dashboard page with error message if illegal argument exception is thrown\n+     */\n+    @RequestMapping(method = RequestMethod.GET, params = \"templateId\")\n+    public ModelAndView displayMrrtReportTemplate(HttpServletRequest request, @RequestParam String templateId) {\n+        final ModelAndView modelAndView = new ModelAndView(MRRT_REPORT_TEMPLATE_FORM_VIEW);\n+        try {\n+            MrrtReportTemplate mrrtReportTemplate = mrrtReportTemplateService.getMrrtReportTemplateByUuid(templateId);\n+            String templateBody = mrrtReportTemplateService.getMrrtReportTemplateHtmlBody(mrrtReportTemplate);\n+            modelAndView.addObject(\"templateBody\", templateBody);\n+            modelAndView.addObject(\"template\", mrrtReportTemplate);\n+        }\n+        catch (IOException exception) {\n+            request.getSession()\n+                    .setAttribute(WebConstants.OPENMRS_ERROR_ATTR,\n+                        \"Error occured while dispaying template => \" + exception.getMessage());\n+            return new ModelAndView(\"/module/radiology/radiologyDashboardForm\");\n+        }\n+        catch (IllegalArgumentException exception) {","path":"omod/src/main/java/org/openmrs/module/radiology/report/template/MrrtReportTemplateFormController.java","position":66,"original_position":66,"commit_id":"986da1eea25dd7fa559269174629ba7bcda01f9c","original_commit_id":"986da1eea25dd7fa559269174629ba7bcda01f9c","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":"@ivange94 of course we need a test for that :)","created_at":"2016-08-01T12:16:45Z","updated_at":"2016-08-01T12:16:45Z","html_url":"https://github.com/openmrs/openmrs-module-radiology/pull/407#discussion_r72968021","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/407","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/comments/72968021"},"html":{"href":"https://github.com/openmrs/openmrs-module-radiology/pull/407#discussion_r72968021"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/407"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/407","id":79543257,"html_url":"https://github.com/openmrs/openmrs-module-radiology/pull/407","diff_url":"https://github.com/openmrs/openmrs-module-radiology/pull/407.diff","patch_url":"https://github.com/openmrs/openmrs-module-radiology/pull/407.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/407","number":407,"state":"open","locked":false,"title":"RAD-307 View report templates from list","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-307 View report templates from list\r\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\n* Modified the report templates tab. Made the dashboard expandable. Added ability to view template structure\r\n\r\n#\r\n\r\n## Related Issue\r\n<!--- This project only accepts pull requests related to open issues -->\r\n<!--- If suggesting a new feature or change, please discuss it in an issue\r\nfirst -->\r\n<!--- If fixing a bug, there should be an issue describing it with steps to\r\nreproduce -->\r\n<!--- Please link to the issue here: -->\r\nsee https://issues.openmrs.org/browse/RAD-307\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that\r\napply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to\r\nhelp! -->\r\n- [x] My pull request only contains one single commit.\r\n- [x] My pull request is based on the latest master branch\r\n  `git pull --rebase upstream master`.\r\n- [x] I ran `mvn clean package` right before creating this pull request and\r\n  added all formatting changes to my commit.\r\n- [x] My code follows the code style of this project.\r\n- [x] I have read the **CONTRIBUTING** document.\r\n- [x] I have added tests to cover my changes.\r\n- [x] All new and existing tests passed.\r\n\r\n\r\n","created_at":"2016-08-01T10:00:26Z","updated_at":"2016-08-01T12:16:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bca198ffbf2d9a9acfe0a24694a150d37c9482fa","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/407/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/407/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/407/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-radiology/statuses/986da1eea25dd7fa559269174629ba7bcda01f9c","head":{"label":"ivange94:RAD-307","ref":"RAD-307","sha":"986da1eea25dd7fa559269174629ba7bcda01f9c","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-08-01T05:33:35Z","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":72902,"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":"b5dd79ca62454f0dc4cdc63a269d4ff13e2e3c9c","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":":hospital: OpenMRS Radiology Module","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-07-29T00:04:51Z","pushed_at":"2016-08-01T11:13:58Z","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":"https://wiki.openmrs.org/display/docs/Radiology+Module","size":73585,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":2,"forks":38,"open_issues":2,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/407"},"html":{"href":"https://github.com/openmrs/openmrs-module-radiology/pull/407"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/407"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/issues/407/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/pulls/407/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/407/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-module-radiology/statuses/986da1eea25dd7fa559269174629ba7bcda01f9c"}}}}
{"actor":{"display_login":"teleivo"}}