{"action":"created","issue":{"url":"https://api.github.com/repos/OHDSI/Era-Constructor/issues/2","labels_url":"https://api.github.com/repos/OHDSI/Era-Constructor/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/OHDSI/Era-Constructor/issues/2/comments","events_url":"https://api.github.com/repos/OHDSI/Era-Constructor/issues/2/events","html_url":"https://github.com/OHDSI/Era-Constructor/issues/2","id":95305783,"number":2,"title":"Some era-building code already exists","user":{"login":"schuemie","id":6713328,"avatar_url":"https://avatars.githubusercontent.com/u/6713328?v=3","gravatar_id":"","url":"https://api.github.com/users/schuemie","html_url":"https://github.com/schuemie","followers_url":"https://api.github.com/users/schuemie/followers","following_url":"https://api.github.com/users/schuemie/following{/other_user}","gists_url":"https://api.github.com/users/schuemie/gists{/gist_id}","starred_url":"https://api.github.com/users/schuemie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuemie/subscriptions","organizations_url":"https://api.github.com/users/schuemie/orgs","repos_url":"https://api.github.com/users/schuemie/repos","events_url":"https://api.github.com/users/schuemie/events{/privacy}","received_events_url":"https://api.github.com/users/schuemie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-15T22:40:49Z","updated_at":"2015-07-20T22:21:51Z","closed_at":null,"body":"Feel free to ignore, but might be helpful. I created code that constructs drug and condition eras for CDM v4 and v5, and it can be translated to all the platforms we support (SQL Server, PostgreSQL, Oracle, PDW, RedShift).\r\n\r\nThe R code is [here](https://github.com/OHDSI/CohortMethod/blob/develop/R/HelperFunctions.R#L93).\r\n\r\nThe parameterized SQL it uses is [here](https://github.com/OHDSI/CohortMethod/blob/develop/inst/sql/sql_server/ConstructEras.sql)."},"comment":{"url":"https://api.github.com/repos/OHDSI/Era-Constructor/issues/comments/123070852","html_url":"https://github.com/OHDSI/Era-Constructor/issues/2#issuecomment-123070852","issue_url":"https://api.github.com/repos/OHDSI/Era-Constructor/issues/2","id":123070852,"user":{"login":"schuemie","id":6713328,"avatar_url":"https://avatars.githubusercontent.com/u/6713328?v=3","gravatar_id":"","url":"https://api.github.com/users/schuemie","html_url":"https://github.com/schuemie","followers_url":"https://api.github.com/users/schuemie/followers","following_url":"https://api.github.com/users/schuemie/following{/other_user}","gists_url":"https://api.github.com/users/schuemie/gists{/gist_id}","starred_url":"https://api.github.com/users/schuemie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuemie/subscriptions","organizations_url":"https://api.github.com/users/schuemie/orgs","repos_url":"https://api.github.com/users/schuemie/repos","events_url":"https://api.github.com/users/schuemie/events{/privacy}","received_events_url":"https://api.github.com/users/schuemie/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T22:21:50Z","updated_at":"2015-07-20T22:21:50Z","body":"@cgreich : If I have two prescriptions of drug A, one starting on day 1 and ending on day 10, and another one starting on day 20 and ending on day 30, with a 30 day grace period these will be merged into one era from day 1 to day 30. With a 0 day grace period, these will not be merged and you will have 2 eras, from day 1 to 10 and from day 20 to day 30.\r\n\r\n@taylordelehanty : My code is based on the [code by Chris Knoll] (http://forums.ohdsi.org/t/populating--era-tables/78/6), and yes, I modified it so it uses SqlRender in order to make the code parameterized and work across platforms."}}