GitHub PullRequestReviewCommentEvent at 2014-05-22 05:51:02
Repository: bluebutton.js
Actor: jmandel
Payload: {"comment":{"url":"https://api.github.com/repos/blue-button/bluebutton.js/pulls/comments/12935748","id":12935748,"diff_hunk":"@@ -9,9 +9,13 @@ var Documents = (function () {\n    * ...\n    */\n   var detect = function (data) {\n+    if (!data.template) {\n+      return 'json';\n+    }\n+    \n     if (!data.template('2.16.840.1.113883.3.88.11.32.1').isEmpty()) {\n       return 'c32';\n-    } else if(!data.template('2.16.840.1.113883.10.20.22.1.2').isEmpty()) {\n+    } else if(!data.template('2.16.840.1.113883.10.20.22.1.1').isEmpty()) {\n       return 'ccda';","path":"lib/documents.js","position":12,"original_position":12,"commit_id":"dc19f05310bf226e5f801e53908bc16aea3f98bf","original_commit_id":"dc19f05310bf226e5f801e53908bc16aea3f98bf","user":{"login":"jmandel","id":313089,"avatar_url":"https://avatars.githubusercontent.com/u/313089?","gravatar_id":"aae34cfe55f3765c541f4396d0cff9f3","url":"https://api.github.com/users/jmandel","html_url":"https://github.com/jmandel","followers_url":"https://api.github.com/users/jmandel/followers","following_url":"https://api.github.com/users/jmandel/following{/other_user}","gists_url":"https://api.github.com/users/jmandel/gists{/gist_id}","starred_url":"https://api.github.com/users/jmandel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmandel/subscriptions","organizations_url":"https://api.github.com/users/jmandel/orgs","repos_url":"https://api.github.com/users/jmandel/repos","events_url":"https://api.github.com/users/jmandel/events{/privacy}","received_events_url":"https://api.github.com/users/jmandel/received_events","type":"User","site_admin":false},"body":"@sankarravi \r\n\r\nYou're correct that `2.16.840.1.113883.10.20.22.1.2` is the document-level templateId for CCD-type C-CDAs.\r\n\r\nOne thing about C-CDA that it's important to know: **C-CDA is purely a \"US Realm\" construct.** So there's no notion of C-CDAs \"from other countries\" as such. The \"consolidation\" activity was done for US-centric use cases. \r\n\r\nSo checking for the specific US Realm Header `2.16.840.1.113883.10.20.22.1.1` sounds like the right approach to me. \r\n\r\nAn alternative would be to check explicit for one of the nine document-level templates, which is to say a document-level templateId in:\r\n\r\n```\r\n[\r\n  \"2.16.840.1.113883.10.20.22.1.2\",\r\n  \"2.16.840.1.113883.10.20.22.1.4\",\r\n  \"2.16.840.1.113883.10.20.22.1.5\",\r\n  \"2.16.840.1.113883.10.20.22.1.8\",\r\n  \"2.16.840.1.113883.10.20.22.1.3\",\r\n  \"2.16.840.1.113883.10.20.22.1.7\",\r\n  \"2.16.840.1.113883.10.20.22.1.6\",\r\n  \"2.16.840.1.113883.10.20.22.1.9\",\r\n  \"2.16.840.1.113883.10.20.22.1.1\" // \"Unstructured\": no special templateId beyond US Realm\r\n]\r\n```\r\n","created_at":"2014-05-22T05:51:02Z","updated_at":"2014-05-22T05:51:02Z","html_url":"https://github.com/blue-button/bluebutton.js/pull/104#discussion_r12935748","pull_request_url":"https://api.github.com/repos/blue-button/bluebutton.js/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/blue-button/bluebutton.js/pulls/comments/12935748"},"html":{"href":"https://github.com/blue-button/bluebutton.js/pull/104#discussion_r12935748"},"pull_request":{"href":"https://api.github.com/repos/blue-button/bluebutton.js/pulls/104"}}}}