{"action":"created","issue":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/3959","repository_url":"https://api.github.com/repos/medic/medic-webapp","labels_url":"https://api.github.com/repos/medic/medic-webapp/issues/3959/labels{/name}","comments_url":"https://api.github.com/repos/medic/medic-webapp/issues/3959/comments","events_url":"https://api.github.com/repos/medic/medic-webapp/issues/3959/events","html_url":"https://github.com/medic/medic-webapp/issues/3959","id":265091343,"number":3959,"title":"Increase linkages between SMS reports and other docs to streamline analytics queries","user":{"login":"sglangevin","id":1286381,"avatar_url":"https://avatars1.githubusercontent.com/u/1286381?v=4","gravatar_id":"","url":"https://api.github.com/users/sglangevin","html_url":"https://github.com/sglangevin","followers_url":"https://api.github.com/users/sglangevin/followers","following_url":"https://api.github.com/users/sglangevin/following{/other_user}","gists_url":"https://api.github.com/users/sglangevin/gists{/gist_id}","starred_url":"https://api.github.com/users/sglangevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sglangevin/subscriptions","organizations_url":"https://api.github.com/users/sglangevin/orgs","repos_url":"https://api.github.com/users/sglangevin/repos","events_url":"https://api.github.com/users/sglangevin/events{/privacy}","received_events_url":"https://api.github.com/users/sglangevin/received_events","type":"User","site_admin":false},"labels":[{"id":371075150,"url":"https://api.github.com/repos/medic/medic-webapp/labels/Analytics","name":"Analytics","color":"76B0B0","default":false},{"id":679686115,"url":"https://api.github.com/repos/medic/medic-webapp/labels/Priority:%202%20-%20Medium","name":"Priority: 2 - Medium","color":"880000","default":false},{"id":55021840,"url":"https://api.github.com/repos/medic/medic-webapp/labels/Status:%204%20-%20Acceptance%20testing","name":"Status: 4 - Acceptance testing","color":"669966","default":false},{"id":728845851,"url":"https://api.github.com/repos/medic/medic-webapp/labels/Type:%20Improvement","name":"Type: Improvement","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":{"login":"michaelkohn","id":10096985,"avatar_url":"https://avatars1.githubusercontent.com/u/10096985?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelkohn","html_url":"https://github.com/michaelkohn","followers_url":"https://api.github.com/users/michaelkohn/followers","following_url":"https://api.github.com/users/michaelkohn/following{/other_user}","gists_url":"https://api.github.com/users/michaelkohn/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelkohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelkohn/subscriptions","organizations_url":"https://api.github.com/users/michaelkohn/orgs","repos_url":"https://api.github.com/users/michaelkohn/repos","events_url":"https://api.github.com/users/michaelkohn/events{/privacy}","received_events_url":"https://api.github.com/users/michaelkohn/received_events","type":"User","site_admin":false},"assignees":[{"login":"michaelkohn","id":10096985,"avatar_url":"https://avatars1.githubusercontent.com/u/10096985?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelkohn","html_url":"https://github.com/michaelkohn","followers_url":"https://api.github.com/users/michaelkohn/followers","following_url":"https://api.github.com/users/michaelkohn/following{/other_user}","gists_url":"https://api.github.com/users/michaelkohn/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelkohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelkohn/subscriptions","organizations_url":"https://api.github.com/users/michaelkohn/orgs","repos_url":"https://api.github.com/users/michaelkohn/repos","events_url":"https://api.github.com/users/michaelkohn/events{/privacy}","received_events_url":"https://api.github.com/users/michaelkohn/received_events","type":"User","site_admin":false}],"milestone":null,"comments":22,"created_at":"2017-10-12T21:23:47Z","updated_at":"2018-03-19T20:11:39Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently, SMS reports have limited information attached to them as this can't be adjusted using config the way it can be for app forms. This causes challenges on the analytics side of things, resulting in complex queries or the inability to calculate certain metrics. This issue will add some linkages between SMS reports and other reports or docs in the DB to help streamline analytics queries.\r\n\r\nNOTE: I'm using ANC examples here to illustrate the requests but this should be implemented in a generic way so that it can be used for any use case.\r\n\r\nAssumptions:\r\n- N forms are the forms that create new people in the web app\r\n- P forms register pregnancies\r\n- V forms can be any type of visit\r\n- D forms are delivery reports\r\n\r\nLinkages to add:\r\n- [x] When an N form is submitted, the person doc that is created should have a `source_id` field with the uuid of the N form that triggered person creation AND a `created_by` field with the uuid of the contact who submitted the N form.\r\n- [x] When a V form is submitted, add a `source_id` field with the uuid of the form that generated the schedule that the V is responding to. For example, if a user sends a P form and then a V form, the V form would have the uuid of the P form on it since the P form generated a schedule.\r\n- [x] When a D form is submitted, add a `source_id` field with the uuid of the form that generated the schedule that the D is responding to. For example, if a user sends a P form, them a V form, then a D form, the D form would have the uuid of the P form.\r\n- [x] Add a `cleared_by` field to any scheduled message that is cleared before it is sent. This field should contain the uuid of the report that cleared the scheduled message.\r\n\r\n@michaelkohn is available to provide additional information or talk through scenarios on any of these items."},"comment":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/comments/374355586","html_url":"https://github.com/medic/medic-webapp/issues/3959#issuecomment-374355586","issue_url":"https://api.github.com/repos/medic/medic-webapp/issues/3959","id":374355586,"user":{"login":"sglangevin","id":1286381,"avatar_url":"https://avatars1.githubusercontent.com/u/1286381?v=4","gravatar_id":"","url":"https://api.github.com/users/sglangevin","html_url":"https://github.com/sglangevin","followers_url":"https://api.github.com/users/sglangevin/followers","following_url":"https://api.github.com/users/sglangevin/following{/other_user}","gists_url":"https://api.github.com/users/sglangevin/gists{/gist_id}","starred_url":"https://api.github.com/users/sglangevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sglangevin/subscriptions","organizations_url":"https://api.github.com/users/sglangevin/orgs","repos_url":"https://api.github.com/users/sglangevin/repos","events_url":"https://api.github.com/users/sglangevin/events{/privacy}","received_events_url":"https://api.github.com/users/sglangevin/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T20:11:39Z","updated_at":"2018-03-19T20:11:39Z","author_association":"CONTRIBUTOR","body":"Interesting - so it would allow us to do something like rejecting a V form if there was no pregnancy registered in whatever time period we set and send an auto-response that says: please register a pregnancy before reporting a visit?"}}
{"actor":{"display_login":"sglangevin"}}