3 * weno rx formulary update.
6 * @link http://www.open-emr.org
7 * @author Sherwin Gaddis <sherwingaddis@gmail.com>
8 * @copyright Copyright (c) 2016-2017 Sherwin Gaddis <sherwingaddis@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
12 require_once("../globals.php");
14 echo xlt("Trying")."<BR>";
16 $zip = new ZipArchive
;
17 $zip->open('FormularyFiles.zip');
18 $zip->extractTo($GLOBALS['temporary_files_dir']);
21 $file = $GLOBALS['temporary_files_dir'] . "./Weno Exchange LLC/BSureFormulary.txt";
22 $lines = count(file($file));
23 echo text($lines). "<br>";
26 // Settings to drastically speed up import with InnoDB
27 sqlStatementNoLog("SET autocommit=0");
28 sqlStatementNoLog("START TRANSACTION");
30 $fileName = new SplFileObject($file);
33 $in = explode("|", $fileName);
39 sqlStatementNoLog("INSERT INTO `erx_drug_paid` SET `drug_label_name` = ?, `NDC` = ?, `price_per_unit` = ? ", array($drugName,$ndc,$price));
40 echo xlt("Inserted") . " " . text($drugName) . "<br> ";
43 } while ($i < $lines);
45 // Settings to drastically speed up import with InnoDB
46 sqlStatementNoLog("COMMIT");
47 sqlStatementNoLog("SET autocommit=1");