{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments/58903797","id":58903797,"diff_hunk":"@@ -0,0 +1,459 @@\n+/**\r\n+ * The contents of this file are subject to the OpenMRS Public License\r\n+ * Version 1.0 (the \"License\"); you may not use this file except in\r\n+ * compliance with the License. You may obtain a copy of the License at\r\n+ * http://license.openmrs.org\r\n+ *\r\n+ * Software distributed under the License is distributed on an \"AS IS\"\r\n+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the\r\n+ * License for the specific language governing rights and limitations\r\n+ * under the License.\r\n+ *\r\n+ * Copyright (C) OpenMRS, LLC.  All Rights Reserved.\r\n+ */\r\n+package org.openmrs.module.webservices.rest.web.v1_0.controller.openmrs2_0;\r\n+\r\n+import java.util.List;\r\n+import java.util.Iterator;\r\n+import java.util.ArrayList;\r\n+import java.util.Locale;\r\n+import java.util.Map;\r\n+import java.util.Collection;\r\n+import java.util.UUID;\r\n+\r\n+import org.openmrs.Allergy;\r\n+import org.openmrs.Allergen;\r\n+import org.openmrs.AllergenType;\r\n+import org.openmrs.Allergies;\r\n+import org.openmrs.AllergyReaction;\r\n+import org.openmrs.Concept;\r\n+import org.openmrs.ConceptDatatype;\r\n+import org.openmrs.ConceptClass;\r\n+import org.openmrs.ConceptName;\r\n+import org.openmrs.ConceptSet;\r\n+import org.openmrs.ConceptDescription;\r\n+import org.openmrs.ConceptMap;\r\n+import org.openmrs.ConceptAnswer;\r\n+import org.openmrs.User;\r\n+import org.openmrs.Patient;\r\n+import org.openmrs.api.context.Context;\r\n+import org.openmrs.module.webservices.rest.web.RestTestConstants2_0;\r\n+import org.junit.Assert;\r\n+import org.junit.Before;\r\n+import org.junit.Test;\r\n+import org.junit.Ignore;\r\n+import org.openmrs.module.webservices.rest.SimpleObject;\r\n+import org.springframework.mock.web.MockHttpServletRequest;\r\n+import org.springframework.web.context.request.WebRequest;\r\n+import org.openmrs.module.webservices.rest.test.Util;\r\n+import org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceControllerTest;\r\n+import org.openmrs.module.webservices.rest.web.response.ObjectNotFoundException;\r\n+import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException;\r\n+import org.openmrs.util.OpenmrsUtil;\r\n+\r\n+import com.fasterxml.jackson.databind.ObjectWriter;\r\n+import com.fasterxml.jackson.databind.ObjectMapper;\r\n+import com.fasterxml.jackson.databind.DeserializationFeature;\r\n+import com.fasterxml.jackson.databind.SerializationFeature;\r\n+import com.fasterxml.jackson.databind.MapperFeature;\r\n+import com.fasterxml.jackson.annotation.JsonIgnore;\r\n+import com.fasterxml.jackson.annotation.JsonView;\r\n+import com.fasterxml.jackson.annotation.JsonIdentityInfo;\r\n+import com.fasterxml.jackson.annotation.ObjectIdGenerators;\r\n+\r\n+public class PatientAllergyController2_0Test extends MainResourceControllerTest {\r\n+\t\r\n+\t/**\r\n+\t * JSON Allergy Json View tag class\r\n+\t */\r\n+\tpublic class JsonAllergyViews {\r","path":"omod-2.0/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/controller/openmrs2_0/PatientAllergyController2_0Test.java","position":69,"original_position":69,"commit_id":"af32da10b1e69601ff83572cffebc2272b5af1a0","original_commit_id":"af32da10b1e69601ff83572cffebc2272b5af1a0","user":{"login":"jdegraft","id":9338294,"avatar_url":"https://avatars.githubusercontent.com/u/9338294?v=3","gravatar_id":"","url":"https://api.github.com/users/jdegraft","html_url":"https://github.com/jdegraft","followers_url":"https://api.github.com/users/jdegraft/followers","following_url":"https://api.github.com/users/jdegraft/following{/other_user}","gists_url":"https://api.github.com/users/jdegraft/gists{/gist_id}","starred_url":"https://api.github.com/users/jdegraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdegraft/subscriptions","organizations_url":"https://api.github.com/users/jdegraft/orgs","repos_url":"https://api.github.com/users/jdegraft/repos","events_url":"https://api.github.com/users/jdegraft/events{/privacy}","received_events_url":"https://api.github.com/users/jdegraft/received_events","type":"User","site_admin":false},"body":"JsonView is supposed to be in the class. Since I did not want to modify Allergy etc in core, Jackson allows mixins. So you create a class AllergyMixin, attach JsonView and othe Jackson annotations, then you use mapper.mixIn to attach that to the class eg mapper.mixIn(Allergy.class, AllergyMixIn.class)","created_at":"2016-04-07T16:39:44Z","updated_at":"2016-04-07T16:39:44Z","html_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195#discussion_r58903797","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments/58903797"},"html":{"href":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195#discussion_r58903797"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195","id":63587750,"html_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195","diff_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195.diff","patch_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/195","number":195,"state":"open","locked":false,"title":"RESTWS-557 Move allergyapi REST into core","user":{"login":"jdegraft","id":9338294,"avatar_url":"https://avatars.githubusercontent.com/u/9338294?v=3","gravatar_id":"","url":"https://api.github.com/users/jdegraft","html_url":"https://github.com/jdegraft","followers_url":"https://api.github.com/users/jdegraft/followers","following_url":"https://api.github.com/users/jdegraft/following{/other_user}","gists_url":"https://api.github.com/users/jdegraft/gists{/gist_id}","starred_url":"https://api.github.com/users/jdegraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdegraft/subscriptions","organizations_url":"https://api.github.com/users/jdegraft/orgs","repos_url":"https://api.github.com/users/jdegraft/repos","events_url":"https://api.github.com/users/jdegraft/events{/privacy}","received_events_url":"https://api.github.com/users/jdegraft/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-21T16:00:40Z","updated_at":"2016-04-07T16:39:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75fb3f3d891c4617a79c9dbc9bb80c7e76f749b7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195/comments","review_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/195/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/statuses/af32da10b1e69601ff83572cffebc2272b5af1a0","head":{"label":"jdegraft:RESTWS-557","ref":"RESTWS-557","sha":"af32da10b1e69601ff83572cffebc2272b5af1a0","user":{"login":"jdegraft","id":9338294,"avatar_url":"https://avatars.githubusercontent.com/u/9338294?v=3","gravatar_id":"","url":"https://api.github.com/users/jdegraft","html_url":"https://github.com/jdegraft","followers_url":"https://api.github.com/users/jdegraft/followers","following_url":"https://api.github.com/users/jdegraft/following{/other_user}","gists_url":"https://api.github.com/users/jdegraft/gists{/gist_id}","starred_url":"https://api.github.com/users/jdegraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdegraft/subscriptions","organizations_url":"https://api.github.com/users/jdegraft/orgs","repos_url":"https://api.github.com/users/jdegraft/repos","events_url":"https://api.github.com/users/jdegraft/events{/privacy}","received_events_url":"https://api.github.com/users/jdegraft/received_events","type":"User","site_admin":false},"repo":{"id":39863327,"name":"openmrs-module-webservices.rest","full_name":"jdegraft/openmrs-module-webservices.rest","owner":{"login":"jdegraft","id":9338294,"avatar_url":"https://avatars.githubusercontent.com/u/9338294?v=3","gravatar_id":"","url":"https://api.github.com/users/jdegraft","html_url":"https://github.com/jdegraft","followers_url":"https://api.github.com/users/jdegraft/followers","following_url":"https://api.github.com/users/jdegraft/following{/other_user}","gists_url":"https://api.github.com/users/jdegraft/gists{/gist_id}","starred_url":"https://api.github.com/users/jdegraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdegraft/subscriptions","organizations_url":"https://api.github.com/users/jdegraft/orgs","repos_url":"https://api.github.com/users/jdegraft/repos","events_url":"https://api.github.com/users/jdegraft/events{/privacy}","received_events_url":"https://api.github.com/users/jdegraft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdegraft/openmrs-module-webservices.rest","description":"Provides RESTful web services for OpenMRS","fork":true,"url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest","forks_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/forks","keys_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/teams","hooks_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/hooks","issue_events_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/issues/events{/number}","events_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/events","assignees_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/assignees{/user}","branches_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/branches{/branch}","tags_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/tags","blobs_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/statuses/{sha}","languages_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/languages","stargazers_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/stargazers","contributors_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/contributors","subscribers_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/subscribers","subscription_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/subscription","commits_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/contents/{+path}","compare_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/merges","archive_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/downloads","issues_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/issues{/number}","pulls_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/pulls{/number}","milestones_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/milestones{/number}","notifications_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/labels{/name}","releases_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/releases{/id}","deployments_url":"https://api.github.com/repos/jdegraft/openmrs-module-webservices.rest/deployments","created_at":"2015-07-28T23:47:56Z","updated_at":"2016-01-22T17:06:24Z","pushed_at":"2016-04-06T22:42:45Z","git_url":"git://github.com/jdegraft/openmrs-module-webservices.rest.git","ssh_url":"git@github.com:jdegraft/openmrs-module-webservices.rest.git","clone_url":"https://github.com/jdegraft/openmrs-module-webservices.rest.git","svn_url":"https://github.com/jdegraft/openmrs-module-webservices.rest","homepage":null,"size":4785,"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":"adab02418bd5ec6352ca8759e094987ffc1958f0","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":6951233,"name":"openmrs-module-webservices.rest","full_name":"openmrs/openmrs-module-webservices.rest","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-webservices.rest","description":"Provides RESTful web services for OpenMRS","fork":false,"url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest","forks_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/forks","keys_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/teams","hooks_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/hooks","issue_events_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/events{/number}","events_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/events","assignees_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/assignees{/user}","branches_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/branches{/branch}","tags_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/tags","blobs_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/statuses/{sha}","languages_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/languages","stargazers_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/stargazers","contributors_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/contributors","subscribers_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/subscribers","subscription_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/subscription","commits_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/contents/{+path}","compare_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/merges","archive_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/downloads","issues_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues{/number}","pulls_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls{/number}","milestones_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/milestones{/number}","notifications_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/labels{/name}","releases_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/releases{/id}","deployments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/deployments","created_at":"2012-12-01T06:50:25Z","updated_at":"2016-04-05T11:22:10Z","pushed_at":"2016-04-06T22:42:46Z","git_url":"git://github.com/openmrs/openmrs-module-webservices.rest.git","ssh_url":"git@github.com:openmrs/openmrs-module-webservices.rest.git","clone_url":"https://github.com/openmrs/openmrs-module-webservices.rest.git","svn_url":"https://github.com/openmrs/openmrs-module-webservices.rest","homepage":null,"size":5748,"stargazers_count":11,"watchers_count":11,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":137,"mirror_url":null,"open_issues_count":7,"forks":137,"open_issues":7,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195"},"html":{"href":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/195"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/statuses/af32da10b1e69601ff83572cffebc2272b5af1a0"}}}}