{"action":"created","issue":{"url":"https://api.github.com/repos/openemr/openemr/issues/1825","repository_url":"https://api.github.com/repos/openemr/openemr","labels_url":"https://api.github.com/repos/openemr/openemr/issues/1825/labels{/name}","comments_url":"https://api.github.com/repos/openemr/openemr/issues/1825/comments","events_url":"https://api.github.com/repos/openemr/openemr/issues/1825/events","html_url":"https://github.com/openemr/openemr/issues/1825","id":355446279,"node_id":"MDU6SXNzdWUzNTU0NDYyNzk=","number":1825,"title":"The value of the Type of transaction in Transactions page is not being displayed as intended","user":{"login":"zbig01","id":12654295,"node_id":"MDQ6VXNlcjEyNjU0Mjk1","avatar_url":"https://avatars1.githubusercontent.com/u/12654295?v=4","gravatar_id":"","url":"https://api.github.com/users/zbig01","html_url":"https://github.com/zbig01","followers_url":"https://api.github.com/users/zbig01/followers","following_url":"https://api.github.com/users/zbig01/following{/other_user}","gists_url":"https://api.github.com/users/zbig01/gists{/gist_id}","starred_url":"https://api.github.com/users/zbig01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbig01/subscriptions","organizations_url":"https://api.github.com/users/zbig01/orgs","repos_url":"https://api.github.com/users/zbig01/repos","events_url":"https://api.github.com/users/zbig01/events{/privacy}","received_events_url":"https://api.github.com/users/zbig01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-30T06:45:30Z","updated_at":"2018-08-31T05:35:38Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"A minor bug is noted when a Patient Transaction is created on the Transactions page, the value of the Type of transaction is not being displayed as it was in the past. The Type is displayed as LBTref, LBTptreq etc with an exclamation icon as a superscript.\r\n\r\n\r\n![pa_transactions_1](https://user-images.githubusercontent.com/12654295/44833747-ed2ee700-abe3-11e8-85c8-891319696577.png)\r\n\r\nThis is caused by :\r\n\r\n`<?php echo generate_display_field(['data_type' => 1, 'list_id' => 'transactions'], $item['title']); ?>`\r\n\r\non line 122 of `interface/patient_file/transaction/transactions.php`\r\n\r\nUpon looking at the code for the `generate_display_field` function  in ` library/options.inc.php` we see the query on lines 2028 and 2028\r\n\r\n```\r\n$lrow = sqlQuery(\"SELECT title FROM list_options \" .\r\n        \"WHERE list_id = ? AND option_id = ? AND activity = 1\", array($list_id,$currvalue));\r\n```\r\n        \r\nis seeking the value for title in table `list_options`.\r\n\r\nThese values that were introduced by @sunsetsystems committed on Jul 8, 2015 1 parent f4b60b9 commit 4ea4311875fcb9a7a5db98e109c29167a6e2242a in `sql/database.sql`\r\n\r\n```\r\nINSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists', 'transactions', 'Layout-Based Transaction Forms', 9, 0);\r\nINSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTref'  , 'Referral'         , 10, 0);\r\nINSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTptreq', 'Patient Request'  , 20, 0);\r\nINSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTphreq', 'Physician Request', 30, 0);\r\nINSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTlegal', 'Legal'            , 40, 0);\r\nINSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTbill' , 'Billing'          , 50, 0);\r\n```\r\n\r\nwere removed by @sunsetsystems authored and bradymiller committed on Sep 15, 2017 1 parent 5b149cd commit db79047421807dcfa6c4826489e528c6ea86201b\r\n\r\n```\r\n-- INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('lists', 'transactions', 'Layout-Based Transaction Forms', 9, 0);\r\n-- INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTptreq', 'Patient Request'  , 20, 0);\r\n-- INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTphreq', 'Physician Request', 30, 0);\r\n-- INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTlegal', 'Legal'            , 40, 0);\r\n-- INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('transactions', 'LBTbill' , 'Billing'          , 50, 0);\r\n```\r\n\r\ncausing this line of code in `function generate_display_field` to be executed\r\n\r\n```\r\n// If match is not found in main and backup lists, return the key with exclamation mark\r\nif ($s == '') {\r\n    $s = nl2br(htmlspecialchars($currvalue, ENT_NOQUOTES)).\r\n    '<sup> <i class=\"fa fas fa-exclamation-circle ml-1\"></i></sup>';\r\n```\r\n\r\nThus leading to the altered and less meaningful display of the type of transaction."},"comment":{"url":"https://api.github.com/repos/openemr/openemr/issues/comments/417556889","html_url":"https://github.com/openemr/openemr/issues/1825#issuecomment-417556889","issue_url":"https://api.github.com/repos/openemr/openemr/issues/1825","id":417556889,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzU1Njg4OQ==","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},"created_at":"2018-08-31T05:35:38Z","updated_at":"2018-08-31T05:35:38Z","author_association":"MEMBER","body":"hi @zbig01 ,\r\nThanks for pointing this out. Looks like the titles got migrated to the layout_group_properties tables in the big layouts project that @sunsetsystems did. Looks like we need a function like collectLayoutNames() that is in the edit_layout.php script to grab the titles.\r\n-brady"}}
{"actor":{"display_login":"bradymiller"}}