{"action":"created","comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/196211130","pull_request_review_id":129721968,"id":196211130,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjIxMTEzMA==","diff_hunk":"@@ -54,17 +56,55 @@ function list(req, res, next) {\n  * @method create\n  *\n  * @description\n- * Create a patient group in the database\n+ * Create a patient group in the database.  If the patient group has associated\n+ * subsidies or invoicing fees.\n  */\n function create(req, res, next) {\n   const record = db.convert(req.body, ['price_list_uuid']);\n-  const sql = 'INSERT INTO patient_group SET ?';\n+  const sql = 'INSERT INTO patient_group SET ?;';\n+  const subsidySql = 'INSERT INTO patient_group_subsidy (subsidy_id, patient_group_uuid) VALUES ?;';\n+  const invoicingFeeSql = 'INSERT INTO patient_group_invoicing_fee (invoicing_fee_id, patient_group_uuid) VALUES ?;';","path":"server/controllers/medical/patientGroups.js","position":64,"original_position":64,"commit_id":"ba2254dcb86f0b5f7e2b885523b26507e53b11a2","original_commit_id":"ba2254dcb86f0b5f7e2b885523b26507e53b11a2","user":{"login":"mbayopanda","id":5445251,"node_id":"MDQ6VXNlcjU0NDUyNTE=","avatar_url":"https://avatars1.githubusercontent.com/u/5445251?v=4","gravatar_id":"","url":"https://api.github.com/users/mbayopanda","html_url":"https://github.com/mbayopanda","followers_url":"https://api.github.com/users/mbayopanda/followers","following_url":"https://api.github.com/users/mbayopanda/following{/other_user}","gists_url":"https://api.github.com/users/mbayopanda/gists{/gist_id}","starred_url":"https://api.github.com/users/mbayopanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbayopanda/subscriptions","organizations_url":"https://api.github.com/users/mbayopanda/orgs","repos_url":"https://api.github.com/users/mbayopanda/repos","events_url":"https://api.github.com/users/mbayopanda/events{/privacy}","received_events_url":"https://api.github.com/users/mbayopanda/received_events","type":"User","site_admin":false},"body":":+1 there was all in the database... great job","created_at":"2018-06-18T20:19:41Z","updated_at":"2018-06-18T20:39:56Z","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/2887#discussion_r196211130","pull_request_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/196211130"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/2887#discussion_r196211130"},"pull_request":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887"}}},"pull_request":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887","id":195617068,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NjE3MDY4","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/2887","diff_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/2887.diff","patch_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/2887.patch","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/2887","number":2887,"state":"open","locked":false,"title":"Link patient groups to subsidies and invoicing fees","user":{"login":"jniles","id":896472,"node_id":"MDQ6VXNlcjg5NjQ3Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/896472?v=4","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"body":"This commit is a really quick implementation to link patient groups to subsidies and invoicing fees.  It updates the CREATE and UPDATE server API for the patient groups, as well as the detailed listing of patient groups.\r\n\r\nThis should be tested with IMCK's data to make sure it performs correctly.","created_at":"2018-06-18T18:56:53Z","updated_at":"2018-06-18T20:39:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb99647982abbc513837c0168edd6983489d87a8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":320955790,"node_id":"MDU6TGFiZWwzMjA5NTU3OTA=","url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels/Feature%20Request","name":"Feature Request","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887/commits","review_comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887/comments","review_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/2887/comments","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/ba2254dcb86f0b5f7e2b885523b26507e53b11a2","head":{"label":"jniles:feat-link-patient-groups-to-subsidies-and-invoice-fees","ref":"feat-link-patient-groups-to-subsidies-and-invoice-fees","sha":"ba2254dcb86f0b5f7e2b885523b26507e53b11a2","user":{"login":"jniles","id":896472,"node_id":"MDQ6VXNlcjg5NjQ3Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/896472?v=4","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"repo":{"id":49059888,"node_id":"MDEwOlJlcG9zaXRvcnk0OTA1OTg4OA==","name":"bhima-2.X","full_name":"jniles/bhima-2.X","owner":{"login":"jniles","id":896472,"node_id":"MDQ6VXNlcjg5NjQ3Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/896472?v=4","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jniles/bhima-2.X","description":"A fresh start for bhima to remove large commits","fork":true,"url":"https://api.github.com/repos/jniles/bhima-2.X","forks_url":"https://api.github.com/repos/jniles/bhima-2.X/forks","keys_url":"https://api.github.com/repos/jniles/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jniles/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jniles/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/jniles/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/jniles/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/jniles/bhima-2.X/events","assignees_url":"https://api.github.com/repos/jniles/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/jniles/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/jniles/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/jniles/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jniles/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jniles/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/jniles/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jniles/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/jniles/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/jniles/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/jniles/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/jniles/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/jniles/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/jniles/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/jniles/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/jniles/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/jniles/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/jniles/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/jniles/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jniles/bhima-2.X/merges","archive_url":"https://api.github.com/repos/jniles/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jniles/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/jniles/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/jniles/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/jniles/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/jniles/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jniles/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/jniles/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/jniles/bhima-2.X/deployments","created_at":"2016-01-05T10:44:42Z","updated_at":"2018-05-31T10:32:47Z","pushed_at":"2018-06-18T18:49:53Z","git_url":"git://github.com/jniles/bhima-2.X.git","ssh_url":"git@github.com:jniles/bhima-2.X.git","clone_url":"https://github.com/jniles/bhima-2.X.git","svn_url":"https://github.com/jniles/bhima-2.X","homepage":null,"size":14518,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"IMA-WorldHealth:master","ref":"master","sha":"6fd4b3be228c8284afe35d314a47ac7ac548b3c0","user":{"login":"IMA-WorldHealth","id":5330583,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzMzA1ODM=","avatar_url":"https://avatars1.githubusercontent.com/u/5330583?v=4","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"repo":{"id":49052669,"node_id":"MDEwOlJlcG9zaXRvcnk0OTA1MjY2OQ==","name":"bhima-2.X","full_name":"IMA-WorldHealth/bhima-2.X","owner":{"login":"IMA-WorldHealth","id":5330583,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzMzA1ODM=","avatar_url":"https://avatars1.githubusercontent.com/u/5330583?v=4","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IMA-WorldHealth/bhima-2.X","description":"A hospital information management application for rural Congolese hospitals","fork":false,"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X","forks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/forks","keys_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/events","assignees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/merges","archive_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/deployments","created_at":"2016-01-05T08:30:30Z","updated_at":"2018-06-18T17:17:37Z","pushed_at":"2018-06-18T18:56:54Z","git_url":"git://github.com/IMA-WorldHealth/bhima-2.X.git","ssh_url":"git@github.com:IMA-WorldHealth/bhima-2.X.git","clone_url":"https://github.com/IMA-WorldHealth/bhima-2.X.git","svn_url":"https://github.com/IMA-WorldHealth/bhima-2.X","homepage":"","size":14705,"stargazers_count":74,"watchers_count":74,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":243,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":42,"open_issues":243,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/2887"},"issue":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/2887"},"comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/2887/comments"},"review_comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887/comments"},"review_comment":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/2887/commits"},"statuses":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/ba2254dcb86f0b5f7e2b885523b26507e53b11a2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mbayopanda"}}