{"action":"created","comment":{"url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/comments/180841682","pull_request_review_id":111335531,"id":180841682,"diff_hunk":"@@ -274,31 +274,12 @@ class UserObservation(db.Model):\n         db.ForeignKey('encounters.id', name='user_observation_encounter_id_fk'),\n         nullable=False)\n     audit_id = db.Column(db.ForeignKey('audit.id'), nullable=False)\n-\n     audit = db.relationship('Audit', cascade=\"save-update, delete\")\n-\n     encounter = db.relationship('Encounter', cascade='delete')\n-\n-    __table_args__ = (UniqueConstraint('user_id', 'observation_id',\n-        name='_user_observation'),)\n-\n-    def add_if_not_found(self):\n-        \"\"\"Add self to database, or return existing\n-\n-        Queries for matching, existing UserObservation.\n-        Populates self.id if found, adds to database first if not.\n-\n-        \"\"\"\n-        if self.id:\n-            return self\n-\n-        match = self.query.filter_by(user_id=self.user_id,\n-                observation_id=self.observation_id).first()\n-        if not match:\n-            db.session.add(self)\n-        elif self is not match:\n-            self = db.session.merge(match)\n-        return self\n+    # There was a time when UserObservations were constrained to\n+    # one per (user_id, observation_id).  As history is important\n+    # and the same observation may be made twice, this constraint","path":"portal/models/fhir.py","position":31,"original_position":31,"commit_id":"76f9c9b8d6c12c3a81dba987c1d4f1c20791e3aa","original_commit_id":"76f9c9b8d6c12c3a81dba987c1d4f1c20791e3aa","user":{"login":"pbugni","id":755392,"avatar_url":"https://avatars0.githubusercontent.com/u/755392?v=4","gravatar_id":"","url":"https://api.github.com/users/pbugni","html_url":"https://github.com/pbugni","followers_url":"https://api.github.com/users/pbugni/followers","following_url":"https://api.github.com/users/pbugni/following{/other_user}","gists_url":"https://api.github.com/users/pbugni/gists{/gist_id}","starred_url":"https://api.github.com/users/pbugni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbugni/subscriptions","organizations_url":"https://api.github.com/users/pbugni/orgs","repos_url":"https://api.github.com/users/pbugni/repos","events_url":"https://api.github.com/users/pbugni/events{/privacy}","received_events_url":"https://api.github.com/users/pbugni/received_events","type":"User","site_admin":false},"body":"No - we only generate a new observation IF it's different.","created_at":"2018-04-11T17:48:37Z","updated_at":"2018-04-11T17:48:37Z","html_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/2010#discussion_r180841682","pull_request_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/comments/180841682"},"html":{"href":"https://github.com/uwcirg/true_nth_usa_portal/pull/2010#discussion_r180841682"},"pull_request":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010"}},"in_reply_to_id":179815370},"pull_request":{"url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010","id":179931049,"html_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/2010","diff_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/2010.diff","patch_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/2010.patch","issue_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/2010","number":2010,"state":"open","locked":false,"title":"TN-943, TN-951 Hotfix/duplicate biopsy","user":{"login":"pbugni","id":755392,"avatar_url":"https://avatars0.githubusercontent.com/u/755392?v=4","gravatar_id":"","url":"https://api.github.com/users/pbugni","html_url":"https://github.com/pbugni","followers_url":"https://api.github.com/users/pbugni/followers","following_url":"https://api.github.com/users/pbugni/following{/other_user}","gists_url":"https://api.github.com/users/pbugni/gists{/gist_id}","starred_url":"https://api.github.com/users/pbugni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbugni/subscriptions","organizations_url":"https://api.github.com/users/pbugni/orgs","repos_url":"https://api.github.com/users/pbugni/repos","events_url":"https://api.github.com/users/pbugni/events{/privacy}","received_events_url":"https://api.github.com/users/pbugni/received_events","type":"User","site_admin":false},"body":"Big change for a hotfix, but it is well tested via unit tests, and I ran through the problem scenarios from the original bug, all functional now. ","created_at":"2018-04-06T12:12:12Z","updated_at":"2018-04-11T17:48:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d48ef93af5a1c68a5cf7cfcff3931291dd50b6c2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010/commits","review_comments_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010/comments","review_comment_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/2010/comments","statuses_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/statuses/76f9c9b8d6c12c3a81dba987c1d4f1c20791e3aa","head":{"label":"uwcirg:hotfix/duplicate-biopsy","ref":"hotfix/duplicate-biopsy","sha":"76f9c9b8d6c12c3a81dba987c1d4f1c20791e3aa","user":{"login":"uwcirg","id":4440514,"avatar_url":"https://avatars1.githubusercontent.com/u/4440514?v=4","gravatar_id":"","url":"https://api.github.com/users/uwcirg","html_url":"https://github.com/uwcirg","followers_url":"https://api.github.com/users/uwcirg/followers","following_url":"https://api.github.com/users/uwcirg/following{/other_user}","gists_url":"https://api.github.com/users/uwcirg/gists{/gist_id}","starred_url":"https://api.github.com/users/uwcirg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwcirg/subscriptions","organizations_url":"https://api.github.com/users/uwcirg/orgs","repos_url":"https://api.github.com/users/uwcirg/repos","events_url":"https://api.github.com/users/uwcirg/events{/privacy}","received_events_url":"https://api.github.com/users/uwcirg/received_events","type":"Organization","site_admin":false},"repo":{"id":37150258,"name":"true_nth_usa_portal","full_name":"uwcirg/true_nth_usa_portal","owner":{"login":"uwcirg","id":4440514,"avatar_url":"https://avatars1.githubusercontent.com/u/4440514?v=4","gravatar_id":"","url":"https://api.github.com/users/uwcirg","html_url":"https://github.com/uwcirg","followers_url":"https://api.github.com/users/uwcirg/followers","following_url":"https://api.github.com/users/uwcirg/following{/other_user}","gists_url":"https://api.github.com/users/uwcirg/gists{/gist_id}","starred_url":"https://api.github.com/users/uwcirg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwcirg/subscriptions","organizations_url":"https://api.github.com/users/uwcirg/orgs","repos_url":"https://api.github.com/users/uwcirg/repos","events_url":"https://api.github.com/users/uwcirg/events{/privacy}","received_events_url":"https://api.github.com/users/uwcirg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uwcirg/true_nth_usa_portal","description":"TrueNTH USA Portal / Shared Services, primary codebase","fork":false,"url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal","forks_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/forks","keys_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/teams","hooks_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/hooks","issue_events_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/events{/number}","events_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/events","assignees_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/assignees{/user}","branches_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/branches{/branch}","tags_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/tags","blobs_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/statuses/{sha}","languages_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/languages","stargazers_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/stargazers","contributors_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/contributors","subscribers_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/subscribers","subscription_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/subscription","commits_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/contents/{+path}","compare_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/merges","archive_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/downloads","issues_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues{/number}","pulls_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls{/number}","milestones_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/milestones{/number}","notifications_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/labels{/name}","releases_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/releases{/id}","deployments_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/deployments","created_at":"2015-06-09T18:25:47Z","updated_at":"2018-04-11T17:29:26Z","pushed_at":"2018-04-11T17:30:27Z","git_url":"git://github.com/uwcirg/true_nth_usa_portal.git","ssh_url":"git@github.com:uwcirg/true_nth_usa_portal.git","clone_url":"https://github.com/uwcirg/true_nth_usa_portal.git","svn_url":"https://github.com/uwcirg/true_nth_usa_portal","homepage":"","size":50470,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":3,"open_issues":4,"watchers":1,"default_branch":"develop"}},"base":{"label":"uwcirg:master","ref":"master","sha":"741c18541d6695ae2e48c13ad53c00f469169327","user":{"login":"uwcirg","id":4440514,"avatar_url":"https://avatars1.githubusercontent.com/u/4440514?v=4","gravatar_id":"","url":"https://api.github.com/users/uwcirg","html_url":"https://github.com/uwcirg","followers_url":"https://api.github.com/users/uwcirg/followers","following_url":"https://api.github.com/users/uwcirg/following{/other_user}","gists_url":"https://api.github.com/users/uwcirg/gists{/gist_id}","starred_url":"https://api.github.com/users/uwcirg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwcirg/subscriptions","organizations_url":"https://api.github.com/users/uwcirg/orgs","repos_url":"https://api.github.com/users/uwcirg/repos","events_url":"https://api.github.com/users/uwcirg/events{/privacy}","received_events_url":"https://api.github.com/users/uwcirg/received_events","type":"Organization","site_admin":false},"repo":{"id":37150258,"name":"true_nth_usa_portal","full_name":"uwcirg/true_nth_usa_portal","owner":{"login":"uwcirg","id":4440514,"avatar_url":"https://avatars1.githubusercontent.com/u/4440514?v=4","gravatar_id":"","url":"https://api.github.com/users/uwcirg","html_url":"https://github.com/uwcirg","followers_url":"https://api.github.com/users/uwcirg/followers","following_url":"https://api.github.com/users/uwcirg/following{/other_user}","gists_url":"https://api.github.com/users/uwcirg/gists{/gist_id}","starred_url":"https://api.github.com/users/uwcirg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwcirg/subscriptions","organizations_url":"https://api.github.com/users/uwcirg/orgs","repos_url":"https://api.github.com/users/uwcirg/repos","events_url":"https://api.github.com/users/uwcirg/events{/privacy}","received_events_url":"https://api.github.com/users/uwcirg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uwcirg/true_nth_usa_portal","description":"TrueNTH USA Portal / Shared Services, primary codebase","fork":false,"url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal","forks_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/forks","keys_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/teams","hooks_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/hooks","issue_events_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/events{/number}","events_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/events","assignees_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/assignees{/user}","branches_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/branches{/branch}","tags_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/tags","blobs_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/statuses/{sha}","languages_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/languages","stargazers_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/stargazers","contributors_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/contributors","subscribers_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/subscribers","subscription_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/subscription","commits_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/contents/{+path}","compare_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/merges","archive_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/downloads","issues_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues{/number}","pulls_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls{/number}","milestones_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/milestones{/number}","notifications_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/labels{/name}","releases_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/releases{/id}","deployments_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/deployments","created_at":"2015-06-09T18:25:47Z","updated_at":"2018-04-11T17:29:26Z","pushed_at":"2018-04-11T17:30:27Z","git_url":"git://github.com/uwcirg/true_nth_usa_portal.git","ssh_url":"git@github.com:uwcirg/true_nth_usa_portal.git","clone_url":"https://github.com/uwcirg/true_nth_usa_portal.git","svn_url":"https://github.com/uwcirg/true_nth_usa_portal","homepage":"","size":50470,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":3,"open_issues":4,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010"},"html":{"href":"https://github.com/uwcirg/true_nth_usa_portal/pull/2010"},"issue":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/2010"},"comments":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/2010/comments"},"review_comments":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010/comments"},"review_comment":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/2010/commits"},"statuses":{"href":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/statuses/76f9c9b8d6c12c3a81dba987c1d4f1c20791e3aa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pbugni"}}