{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments/56972226","id":56972226,"diff_hunk":"@@ -0,0 +1,233 @@\n+package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs2_0;\r\n+\r\n+import java.util.ArrayList;\r\n+import java.util.List;\r\n+\r\n+import org.openmrs.Allergy;\r\n+import org.openmrs.Allergies;\r\n+import org.openmrs.Patient;\r\n+import org.openmrs.api.context.Context;\r\n+import org.openmrs.module.webservices.rest.web.RequestContext;\r\n+import org.openmrs.module.webservices.rest.web.RestConstants;\r\n+import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter;\r\n+import org.openmrs.module.webservices.rest.web.annotation.Resource;\r\n+import org.openmrs.module.webservices.rest.web.annotation.SubResource;\r\n+import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation;\r\n+import org.openmrs.module.webservices.rest.web.representation.FullRepresentation;\r\n+import org.openmrs.module.webservices.rest.web.representation.Representation;\r\n+import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription;\r\n+import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingSubResource;\r\n+import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging;\r\n+import org.openmrs.module.webservices.rest.web.response.ResponseException;\r\n+import org.openmrs.module.webservices.rest.web.response.ObjectNotFoundException;\r\n+import org.openmrs.module.webservices.rest.SimpleObject;\r\n+import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException;\r\n+import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9.PatientResource1_9;\r\n+\r\n+@SubResource(parent = PatientResource1_9.class, path = \"allergy\", supportedClass = Allergy.class, supportedOpenmrsVersions = {\r\n+        \"2.0.*\", \"2.1.*\" })\r\n+public class PatientAllergyResource2_0 extends DelegatingSubResource<Allergy, Patient, PatientResource1_9> {\r\n+\r\n+\t@Override\r\n+\tpublic DelegatingResourceDescription getRepresentationDescription(Representation rep) {\r\n+\t\tif (rep instanceof DefaultRepresentation) {\r\n+\t\t\tDelegatingResourceDescription description = new DelegatingResourceDescription();\r\n+\t\t\t// what should be in default representation\r\n+\t\t\tdescription.addProperty(\"display\");\r\n+\t\t\tdescription.addProperty(\"uuid\"); \r\n+\t\t\tdescription.addProperty(\"allergen\", rep);\r\n+\t\t\tdescription.addProperty(\"severity\", rep);\r\n+\t\t\tdescription.addProperty(\"comment\", rep);\r\n+\t\t\tdescription.addProperty(\"reactions\", rep);\r\n+\t\t\tdescription.addProperty(\"patient\", rep);\r\n+\t\t\tdescription.addSelfLink();\r\n+\t\t\tdescription.addLink(\"full\", \".?v=\" + RestConstants.REPRESENTATION_FULL);\r\n+\t\t\treturn description;\r\n+\t\t} else if (rep instanceof FullRepresentation) {\r\n+\t\t\tDelegatingResourceDescription description = new DelegatingResourceDescription();\r\n+\t\t\t// what should be in full representation\r\n+\t\t\tdescription.addProperty(\"display\");\r\n+\t\t\tdescription.addProperty(\"uuid\"); \r\n+\t\t\tdescription.addProperty(\"allergen\", rep);\r\n+\t\t\tdescription.addProperty(\"severity\", rep);\r\n+\t\t\tdescription.addProperty(\"comment\", rep);\r\n+\t\t\tdescription.addProperty(\"reactions\", rep);\r\n+\t\t\tdescription.addProperty(\"patient\", rep);\r\n+\t\t\tdescription.addProperty(\"voided\");\r\n+\t\t\tdescription.addProperty(\"auditInfo\");\r\n+\t\t\tdescription.addSelfLink();\r\n+\t\t\treturn description;\r\n+\t\t}\r\n+\t\treturn null;\r\n+\t}\r\n+\r\n+\t/**\r\n+\t * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties()\r\n+\t */\r\n+\t@Override\r\n+\tpublic DelegatingResourceDescription getCreatableProperties() {\r\n+\t\tDelegatingResourceDescription description = new DelegatingResourceDescription();\r\n+\t\tdescription.addRequiredProperty(\"allergen\");\r\n+\t\tdescription.addProperty(\"severity\");\r\n+\t\tdescription.addProperty(\"comment\");\r\n+\t\tdescription.addProperty(\"reactions\");\r\n+        return description;\r","path":"omod-2.0/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs2_0/PatientAllergyResource2_0.java","position":74,"original_position":74,"commit_id":"c81703deeeb7c6414e0585c49db9502de30e8781","original_commit_id":"c81703deeeb7c6414e0585c49db9502de30e8781","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":"I don't understand, the formatting looks fine to me.","created_at":"2016-03-22T11:40:52Z","updated_at":"2016-03-22T11:40:52Z","html_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195#discussion_r56972226","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/56972226"},"html":{"href":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/195#discussion_r56972226"},"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-03-22T11:40:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee2080ab2f174af4279f34f63b3e5acce11026a6","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/c81703deeeb7c6414e0585c49db9502de30e8781","head":{"label":"jdegraft:RESTWS-557","ref":"RESTWS-557","sha":"c81703deeeb7c6414e0585c49db9502de30e8781","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-03-21T15:57:28Z","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":4753,"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":"fa58b1631633ae55d7615d01a3ea62f2833118fd","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-02-12T16:52:00Z","pushed_at":"2016-03-22T02:46:56Z","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":5660,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":132,"mirror_url":null,"open_issues_count":6,"forks":132,"open_issues":6,"watchers":10,"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/c81703deeeb7c6414e0585c49db9502de30e8781"}}}}