{"action":"created","comment":{"url":"https://api.github.com/repos/openemr/openemr/pulls/comments/238091143","pull_request_review_id":180553963,"id":238091143,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODA5MTE0Mw==","diff_hunk":"@@ -0,0 +1,678 @@\n+<?php\n+/*\n+ * This program creates the HCFA 1500 claim form.\n+ *\n+ * @package OpenEMR\n+ * @author Rod Roark <rod@sunsetsystems.com>\n+ * @author Stephen Waite <stephen.waite@cmsvt.com>\n+ * @copyright Copyright (c) 2011 Rod Roark <rod@sunsetsystems.com>\n+ * @copyright Copyright (C) 2018 Stephen Waite <stephen.waite@cmsvt.com>\n+ * @link http://www.open-emr.org\n+ * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3\n+ */\n+\n+namespace OpenEMR\\Billing;\n+\n+require_once(dirname(__FILE__) . \"/../../invoice_summary.inc.php\");\n+\n+use OpenEMR\\Billing\\Claim;\n+\n+class HCFA_1500\n+{\n+    private $hcfa_curr_line = 1;\n+    private $hcfa_curr_col = 1;\n+    private $hcfa_data = '';\n+    private $hcfa_proc_index = 0;\n+\n+    /**\n+     * take the data element and place it at the correct coordinates on the page\n+     *\n+     * @global int $hcfa_curr_line\n+     * @global int $hcfa_curr_col\n+     * @global type $hcfa_data\n+     * @param type $line\n+     * @param type $col\n+     * @param type $maxlen\n+     * @param type $data\n+     * @param type $strip   regular expression for what to strip from the data. period and has are the defaults\n+     *                      02/12 version needs to include periods in the diagnoses hence the need to override\n+     */\n+    public static function put_hcfa($line, $col, $maxlen, $data, $strip = '/[.#]/')\n+    {\n+        global $hcfa_curr_line, $hcfa_curr_col, $hcfa_data;\n+        if ($line < $hcfa_curr_line) {\n+            die(\"Data item at ($line, $col) precedes current line.\");\n+        }\n+\n+        while ($hcfa_curr_line < $line) {\n+            $hcfa_data .= \"\\n\";\n+            ++$hcfa_curr_line;\n+            $hcfa_curr_col = 1;\n+        }\n+\n+        if ($col < $hcfa_curr_col) {\n+            die(\"Data item at ($line, $col) precedes current column.\");\n+        }\n+\n+        while ($hcfa_curr_col < $col) {\n+            $hcfa_data .= \" \";\n+            ++$hcfa_curr_col;\n+        }\n+\n+        $data = preg_replace($strip, '', strtoupper($data));\n+        $len = min(strlen($data), $maxlen);\n+        $hcfa_data .= substr($data, 0, $len);\n+        $hcfa_curr_col += $len;\n+    }\n+\n+\n+    public static function gen_hcfa_1500($pid, $encounter, &$log)\n+    {\n+        global $hcfa_data, $hcfa_proc_index;\n+\n+        $hcfa_data = '';\n+        $hcfa_proc_index = 0;\n+\n+        $today = time();\n+        $claim = new Claim($pid, $encounter);\n+\n+        $log .= \"Generating HCFA claim $pid-$encounter for \" .\n+            $claim->patientFirstName() . ' ' .\n+            $claim->patientMiddleName() . ' ' .\n+            $claim->patientLastName() . ' on ' .\n+            date('Y-m-d H:i', $today) . \".\\n\";\n+\n+        while ($hcfa_proc_index < $claim->procCount()) {\n+            if ($hcfa_proc_index) {\n+                $hcfa_data .= \"\\014\"; // append form feed for new page\n+            }\n+\n+            HCFA_1500::gen_hcfa_1500_page($pid, $encounter, $log, $claim);\n+        }\n+\n+        $log .= \"\\n\";\n+        return $hcfa_data;\n+    }\n+\n+    private function gen_hcfa_1500_page($pid, $encounter, &$log, &$claim)\n+    {\n+        global $hcfa_curr_line, $hcfa_curr_col, $hcfa_data, $hcfa_proc_index;","path":"library/billing/src/HCFA_1500.php","position":99,"original_position":99,"commit_id":"1de9815ee67ed1fe93939be232f5a0a641d9b8b2","original_commit_id":"1de9815ee67ed1fe93939be232f5a0a641d9b8b2","user":{"login":"bradymiller","id":278968,"node_id":"MDQ6VXNlcjI3ODk2OA==","avatar_url":"https://avatars1.githubusercontent.com/u/278968?v=4","gravatar_id":"","url":"https://api.github.com/users/bradymiller","html_url":"https://github.com/bradymiller","followers_url":"https://api.github.com/users/bradymiller/followers","following_url":"https://api.github.com/users/bradymiller/following{/other_user}","gists_url":"https://api.github.com/users/bradymiller/gists{/gist_id}","starred_url":"https://api.github.com/users/bradymiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradymiller/subscriptions","organizations_url":"https://api.github.com/users/bradymiller/orgs","repos_url":"https://api.github.com/users/bradymiller/repos","events_url":"https://api.github.com/users/bradymiller/events{/privacy}","received_events_url":"https://api.github.com/users/bradymiller/received_events","type":"User","site_admin":false},"body":"Need to remove these globals and prepend them below with $this-> when use them:\r\n$this->$hcfa_curr_line\r\n$this->$hcfa_curr_col\r\n$this->$hcfa_data\r\n$this->$hcfa_proc_index","created_at":"2018-12-02T09:31:16Z","updated_at":"2018-12-02T09:32:01Z","html_url":"https://github.com/openemr/openemr/pull/2002#discussion_r238091143","pull_request_url":"https://api.github.com/repos/openemr/openemr/pulls/2002","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/openemr/openemr/pulls/comments/238091143"},"html":{"href":"https://github.com/openemr/openemr/pull/2002#discussion_r238091143"},"pull_request":{"href":"https://api.github.com/repos/openemr/openemr/pulls/2002"}}},"pull_request":{"url":"https://api.github.com/repos/openemr/openemr/pulls/2002","id":235219277,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MjE5Mjc3","html_url":"https://github.com/openemr/openemr/pull/2002","diff_url":"https://github.com/openemr/openemr/pull/2002.diff","patch_url":"https://github.com/openemr/openemr/pull/2002.patch","issue_url":"https://api.github.com/repos/openemr/openemr/issues/2002","number":2002,"state":"open","locked":false,"title":"work in progress to consolidate HCFA 1500 into one class in namespace…","user":{"login":"stephenwaite","id":5618372,"node_id":"MDQ6VXNlcjU2MTgzNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5618372?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenwaite","html_url":"https://github.com/stephenwaite","followers_url":"https://api.github.com/users/stephenwaite/followers","following_url":"https://api.github.com/users/stephenwaite/following{/other_user}","gists_url":"https://api.github.com/users/stephenwaite/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenwaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenwaite/subscriptions","organizations_url":"https://api.github.com/users/stephenwaite/orgs","repos_url":"https://api.github.com/users/stephenwaite/repos","events_url":"https://api.github.com/users/stephenwaite/events{/privacy}","received_events_url":"https://api.github.com/users/stephenwaite/received_events","type":"User","site_admin":false},"body":"… OpenEMR\\Billing","created_at":"2018-12-01T21:19:11Z","updated_at":"2018-12-02T09:32:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72b44b7a27c7d4d1201022f842f003500e2885a4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":433468182,"node_id":"MDU6TGFiZWw0MzM0NjgxODI=","url":"https://api.github.com/repos/openemr/openemr/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"fbca04","default":false},{"id":433468358,"node_id":"MDU6TGFiZWw0MzM0NjgzNTg=","url":"https://api.github.com/repos/openemr/openemr/labels/Status:%20Needs%20Work","name":"Status: Needs Work","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openemr/openemr/pulls/2002/commits","review_comments_url":"https://api.github.com/repos/openemr/openemr/pulls/2002/comments","review_comment_url":"https://api.github.com/repos/openemr/openemr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openemr/openemr/issues/2002/comments","statuses_url":"https://api.github.com/repos/openemr/openemr/statuses/1de9815ee67ed1fe93939be232f5a0a641d9b8b2","head":{"label":"stephenwaite:hcfa_psr","ref":"hcfa_psr","sha":"1de9815ee67ed1fe93939be232f5a0a641d9b8b2","user":{"login":"stephenwaite","id":5618372,"node_id":"MDQ6VXNlcjU2MTgzNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5618372?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenwaite","html_url":"https://github.com/stephenwaite","followers_url":"https://api.github.com/users/stephenwaite/followers","following_url":"https://api.github.com/users/stephenwaite/following{/other_user}","gists_url":"https://api.github.com/users/stephenwaite/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenwaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenwaite/subscriptions","organizations_url":"https://api.github.com/users/stephenwaite/orgs","repos_url":"https://api.github.com/users/stephenwaite/repos","events_url":"https://api.github.com/users/stephenwaite/events{/privacy}","received_events_url":"https://api.github.com/users/stephenwaite/received_events","type":"User","site_admin":false},"repo":{"id":13348177,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM0ODE3Nw==","name":"openemr","full_name":"stephenwaite/openemr","private":false,"owner":{"login":"stephenwaite","id":5618372,"node_id":"MDQ6VXNlcjU2MTgzNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5618372?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenwaite","html_url":"https://github.com/stephenwaite","followers_url":"https://api.github.com/users/stephenwaite/followers","following_url":"https://api.github.com/users/stephenwaite/following{/other_user}","gists_url":"https://api.github.com/users/stephenwaite/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenwaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenwaite/subscriptions","organizations_url":"https://api.github.com/users/stephenwaite/orgs","repos_url":"https://api.github.com/users/stephenwaite/repos","events_url":"https://api.github.com/users/stephenwaite/events{/privacy}","received_events_url":"https://api.github.com/users/stephenwaite/received_events","type":"User","site_admin":false},"html_url":"https://github.com/stephenwaite/openemr","description":"Mirror of official OpenEMR Sourceforge repository","fork":true,"url":"https://api.github.com/repos/stephenwaite/openemr","forks_url":"https://api.github.com/repos/stephenwaite/openemr/forks","keys_url":"https://api.github.com/repos/stephenwaite/openemr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephenwaite/openemr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephenwaite/openemr/teams","hooks_url":"https://api.github.com/repos/stephenwaite/openemr/hooks","issue_events_url":"https://api.github.com/repos/stephenwaite/openemr/issues/events{/number}","events_url":"https://api.github.com/repos/stephenwaite/openemr/events","assignees_url":"https://api.github.com/repos/stephenwaite/openemr/assignees{/user}","branches_url":"https://api.github.com/repos/stephenwaite/openemr/branches{/branch}","tags_url":"https://api.github.com/repos/stephenwaite/openemr/tags","blobs_url":"https://api.github.com/repos/stephenwaite/openemr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephenwaite/openemr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephenwaite/openemr/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephenwaite/openemr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephenwaite/openemr/statuses/{sha}","languages_url":"https://api.github.com/repos/stephenwaite/openemr/languages","stargazers_url":"https://api.github.com/repos/stephenwaite/openemr/stargazers","contributors_url":"https://api.github.com/repos/stephenwaite/openemr/contributors","subscribers_url":"https://api.github.com/repos/stephenwaite/openemr/subscribers","subscription_url":"https://api.github.com/repos/stephenwaite/openemr/subscription","commits_url":"https://api.github.com/repos/stephenwaite/openemr/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephenwaite/openemr/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephenwaite/openemr/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephenwaite/openemr/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephenwaite/openemr/contents/{+path}","compare_url":"https://api.github.com/repos/stephenwaite/openemr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephenwaite/openemr/merges","archive_url":"https://api.github.com/repos/stephenwaite/openemr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephenwaite/openemr/downloads","issues_url":"https://api.github.com/repos/stephenwaite/openemr/issues{/number}","pulls_url":"https://api.github.com/repos/stephenwaite/openemr/pulls{/number}","milestones_url":"https://api.github.com/repos/stephenwaite/openemr/milestones{/number}","notifications_url":"https://api.github.com/repos/stephenwaite/openemr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephenwaite/openemr/labels{/name}","releases_url":"https://api.github.com/repos/stephenwaite/openemr/releases{/id}","deployments_url":"https://api.github.com/repos/stephenwaite/openemr/deployments","created_at":"2013-10-05T16:18:19Z","updated_at":"2018-12-01T14:15:59Z","pushed_at":"2018-12-01T22:41:12Z","git_url":"git://github.com/stephenwaite/openemr.git","ssh_url":"git@github.com:stephenwaite/openemr.git","clone_url":"https://github.com/stephenwaite/openemr.git","svn_url":"https://github.com/stephenwaite/openemr","homepage":"http://open-emr.org/","size":416797,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"openemr:master","ref":"master","sha":"e5b1cf32fb13d5d4b4a35c2cb22238e23b5de100","user":{"login":"openemr","id":283089,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzA4OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/283089?v=4","gravatar_id":"","url":"https://api.github.com/users/openemr","html_url":"https://github.com/openemr","followers_url":"https://api.github.com/users/openemr/followers","following_url":"https://api.github.com/users/openemr/following{/other_user}","gists_url":"https://api.github.com/users/openemr/gists{/gist_id}","starred_url":"https://api.github.com/users/openemr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openemr/subscriptions","organizations_url":"https://api.github.com/users/openemr/orgs","repos_url":"https://api.github.com/users/openemr/repos","events_url":"https://api.github.com/users/openemr/events{/privacy}","received_events_url":"https://api.github.com/users/openemr/received_events","type":"Organization","site_admin":false},"repo":{"id":679584,"node_id":"MDEwOlJlcG9zaXRvcnk2Nzk1ODQ=","name":"openemr","full_name":"openemr/openemr","private":false,"owner":{"login":"openemr","id":283089,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzA4OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/283089?v=4","gravatar_id":"","url":"https://api.github.com/users/openemr","html_url":"https://github.com/openemr","followers_url":"https://api.github.com/users/openemr/followers","following_url":"https://api.github.com/users/openemr/following{/other_user}","gists_url":"https://api.github.com/users/openemr/gists{/gist_id}","starred_url":"https://api.github.com/users/openemr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openemr/subscriptions","organizations_url":"https://api.github.com/users/openemr/orgs","repos_url":"https://api.github.com/users/openemr/repos","events_url":"https://api.github.com/users/openemr/events{/privacy}","received_events_url":"https://api.github.com/users/openemr/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openemr/openemr","description":"OpenEMR is the most popular open source electronic health records and medical practice management solution. ONC certified with international usage, OpenEMR's goal is a superior alternative to its proprietary counterparts.","fork":false,"url":"https://api.github.com/repos/openemr/openemr","forks_url":"https://api.github.com/repos/openemr/openemr/forks","keys_url":"https://api.github.com/repos/openemr/openemr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openemr/openemr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openemr/openemr/teams","hooks_url":"https://api.github.com/repos/openemr/openemr/hooks","issue_events_url":"https://api.github.com/repos/openemr/openemr/issues/events{/number}","events_url":"https://api.github.com/repos/openemr/openemr/events","assignees_url":"https://api.github.com/repos/openemr/openemr/assignees{/user}","branches_url":"https://api.github.com/repos/openemr/openemr/branches{/branch}","tags_url":"https://api.github.com/repos/openemr/openemr/tags","blobs_url":"https://api.github.com/repos/openemr/openemr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openemr/openemr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openemr/openemr/git/refs{/sha}","trees_url":"https://api.github.com/repos/openemr/openemr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openemr/openemr/statuses/{sha}","languages_url":"https://api.github.com/repos/openemr/openemr/languages","stargazers_url":"https://api.github.com/repos/openemr/openemr/stargazers","contributors_url":"https://api.github.com/repos/openemr/openemr/contributors","subscribers_url":"https://api.github.com/repos/openemr/openemr/subscribers","subscription_url":"https://api.github.com/repos/openemr/openemr/subscription","commits_url":"https://api.github.com/repos/openemr/openemr/commits{/sha}","git_commits_url":"https://api.github.com/repos/openemr/openemr/git/commits{/sha}","comments_url":"https://api.github.com/repos/openemr/openemr/comments{/number}","issue_comment_url":"https://api.github.com/repos/openemr/openemr/issues/comments{/number}","contents_url":"https://api.github.com/repos/openemr/openemr/contents/{+path}","compare_url":"https://api.github.com/repos/openemr/openemr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openemr/openemr/merges","archive_url":"https://api.github.com/repos/openemr/openemr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openemr/openemr/downloads","issues_url":"https://api.github.com/repos/openemr/openemr/issues{/number}","pulls_url":"https://api.github.com/repos/openemr/openemr/pulls{/number}","milestones_url":"https://api.github.com/repos/openemr/openemr/milestones{/number}","notifications_url":"https://api.github.com/repos/openemr/openemr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openemr/openemr/labels{/name}","releases_url":"https://api.github.com/repos/openemr/openemr/releases{/id}","deployments_url":"https://api.github.com/repos/openemr/openemr/deployments","created_at":"2010-05-21T19:54:08Z","updated_at":"2018-12-02T07:18:09Z","pushed_at":"2018-12-02T08:12:05Z","git_url":"git://github.com/openemr/openemr.git","ssh_url":"git@github.com:openemr/openemr.git","clone_url":"https://github.com/openemr/openemr.git","svn_url":"https://github.com/openemr/openemr","homepage":"http://open-emr.org/","size":416315,"stargazers_count":853,"watchers_count":853,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":699,"mirror_url":null,"archived":false,"open_issues_count":246,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":699,"open_issues":246,"watchers":853,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openemr/openemr/pulls/2002"},"html":{"href":"https://github.com/openemr/openemr/pull/2002"},"issue":{"href":"https://api.github.com/repos/openemr/openemr/issues/2002"},"comments":{"href":"https://api.github.com/repos/openemr/openemr/issues/2002/comments"},"review_comments":{"href":"https://api.github.com/repos/openemr/openemr/pulls/2002/comments"},"review_comment":{"href":"https://api.github.com/repos/openemr/openemr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openemr/openemr/pulls/2002/commits"},"statuses":{"href":"https://api.github.com/repos/openemr/openemr/statuses/1de9815ee67ed1fe93939be232f5a0a641d9b8b2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bradymiller"}}