{"action":"created","issue":{"url":"https://api.github.com/repos/mimic2/v2.6/issues/1","labels_url":"https://api.github.com/repos/mimic2/v2.6/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/mimic2/v2.6/issues/1/comments","events_url":"https://api.github.com/repos/mimic2/v2.6/issues/1/events","html_url":"https://github.com/mimic2/v2.6/issues/1","id":91080518,"number":1,"title":"How do identify the code status for patients?","user":{"login":"joytywu","id":9146471,"avatar_url":"https://avatars.githubusercontent.com/u/9146471?v=3","gravatar_id":"","url":"https://api.github.com/users/joytywu","html_url":"https://github.com/joytywu","followers_url":"https://api.github.com/users/joytywu/followers","following_url":"https://api.github.com/users/joytywu/following{/other_user}","gists_url":"https://api.github.com/users/joytywu/gists{/gist_id}","starred_url":"https://api.github.com/users/joytywu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joytywu/subscriptions","organizations_url":"https://api.github.com/users/joytywu/orgs","repos_url":"https://api.github.com/users/joytywu/repos","events_url":"https://api.github.com/users/joytywu/events{/privacy}","received_events_url":"https://api.github.com/users/joytywu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-25T21:27:34Z","updated_at":"2015-06-25T21:56:01Z","closed_at":null,"body":"I am not sure which mimic2v2.6 table have the code status information for patients (e.g. DNR, CMO, etc)\r\n"},"comment":{"url":"https://api.github.com/repos/mimic2/v2.6/issues/comments/115411066","html_url":"https://github.com/mimic2/v2.6/issues/1#issuecomment-115411066","issue_url":"https://api.github.com/repos/mimic2/v2.6/issues/1","id":115411066,"user":{"login":"tompollard","id":822601,"avatar_url":"https://avatars.githubusercontent.com/u/822601?v=3","gravatar_id":"","url":"https://api.github.com/users/tompollard","html_url":"https://github.com/tompollard","followers_url":"https://api.github.com/users/tompollard/followers","following_url":"https://api.github.com/users/tompollard/following{/other_user}","gists_url":"https://api.github.com/users/tompollard/gists{/gist_id}","starred_url":"https://api.github.com/users/tompollard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tompollard/subscriptions","organizations_url":"https://api.github.com/users/tompollard/orgs","repos_url":"https://api.github.com/users/tompollard/repos","events_url":"https://api.github.com/users/tompollard/events{/privacy}","received_events_url":"https://api.github.com/users/tompollard/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T21:56:01Z","updated_at":"2015-06-25T21:56:01Z","body":"Hi Joy, please see: https://mimic.physionet.org/database/faqs.html#18. Essentially you need to:\r\n\r\n1) find itemid for label \"code status\":\r\n\r\n``` sql\r\n-- find itemid for label \"code status\"\r\nselect itemid\r\n  from mimic2v26.d_chartitems\r\nwhere lower(label) like '%code%';\r\n```\r\n2) which allows you to extract all chartevents for 'code status':\r\n``` sql\r\n-- find all chartevents where itemid = 128\r\nselect *\r\nfrom mimic2v26.chartevents\r\nwhere itemid = '128';\r\n```\r\n3) You can then run a search for your status of interest: \r\n``` sql\r\n-- find all chartevents where itemid = 128 and value1 = comfort measures (CMO)\r\nselect *\r\nfrom mimic2v26.chartevents\r\nwhere itemid = '128' and lower(value1) like '%comfort%';\r\n```"}}