psr12 fixes for new PHP_CodeSniffer (#4795)
[openemr.git] / src / Rx / Weno / LogDataInsert.php
blobce544e8996d201e646772298379f83737ab036a8
1 <?php
3 /*
4 * @package OpenEMR
5 * @link http://www.open-emr.org
6 * @author Sherwin Gaddis <sherwingaddis@gmail.com>
7 * @copyright Copyright (c) 2020 Sherwin Gaddis <sherwingaddis@gmail.com>
8 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
9 */
11 namespace OpenEMR\Rx\Weno;
13 class LogDataInsert
15 public function __construct()
18 public function insertPrescriptions($insertdata)
20 $sql = "INSERT INTO prescriptions SET "
21 . "id = ?, "
22 . "active = ?, "
23 . "date_added = ?, "
24 . "patient_id = ?, "
25 . "drug = ?, "
26 . "form = ?, "
27 . "quantity = ?, "
28 . "refills = ?, "
29 . "substitute = ?,"
30 . "note = ?, "
31 . "rxnorm_drugcode = ?, "
32 . "external_id = ?, "
33 . "indication = ?, "
34 . "txDate = ? ";
36 try {
37 sqlInsert($sql, [
38 $insertdata['id'],
39 $insertdata['active'],
40 $insertdata['date_added'],
41 $insertdata['patient_id'],
42 $insertdata['drug'],
43 $insertdata['form'],
44 $insertdata['quantity'],
45 $insertdata['refills'],
46 $insertdata['substitute'],
47 $insertdata['note'],
48 $insertdata['rxnorm_drugcode'],
49 $insertdata['provider_id'],
50 $insertdata['prescriptionguid'],
51 $insertdata['txDate']
52 ]);
53 echo "inserted data! <br>";
54 } catch (Exception $e) {
55 return $e->getMessage();