From 5b2a4e44f59867e4ea9ee3a28b75e6f38df6ba9f Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Fri, 22 Dec 2006 00:53:32 +0000 Subject: [PATCH] permit non-numeric prescription quantity --- controllers/C_Prescription.class.php | 13 +++++++------ library/classes/Prescription.class.php | 6 +++--- sql/2_8_1-to-2_8_2_upgrade.sql | 3 ++- sql/database.sql | 2 +- templates/prescription/general_edit.html | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/controllers/C_Prescription.class.php b/controllers/C_Prescription.class.php index 62b171c5c..01ea0cf87 100644 --- a/controllers/C_Prescription.class.php +++ b/controllers/C_Prescription.class.php @@ -227,12 +227,13 @@ class C_Prescription extends Controller { } function get_prescription_body_text($p) { - $body = 'Rx: ' . $p->get_drug() . ' ' . $p->get_size() . ' ' . $p->get_unit_display() - . ' [' . $p->form_array[$p->get_form()] . "] " - . $p->substitute_array[$p->get_substitute()] . "\n" - . 'Disp #: ' . $p->get_quantity() . "\n" - . 'Sig: ' . $p->get_dosage() . ' ' . $p->form_array[$p->get_form()] .' ' - . $p->route_array[$p->get_route()] . ' ' . $p->interval_array[$p->get_interval()] . "\n"; + $body = 'Rx: ' . $p->get_drug() . ' ' . $p->get_size() . ' ' . $p->get_unit_display(); + if ($p->get_form()) $body .= ' [' . $p->form_array[$p->get_form()] . "]"; + $body .= " " + . $p->substitute_array[$p->get_substitute()] . "\n" + . 'Disp #: ' . $p->get_quantity() . "\n" + . 'Sig: ' . $p->get_dosage() . ' ' . $p->form_array[$p->get_form()] .' ' + . $p->route_array[$p->get_route()] . ' ' . $p->interval_array[$p->get_interval()] . "\n"; if ($p->get_refills() > 0) { $body .= "\nRefills: " . $p->get_refills() . " of quantity " . $p->get_per_refill() . "\n"; } diff --git a/library/classes/Prescription.class.php b/library/classes/Prescription.class.php index 40d67b7dc..12f592817 100644 --- a/library/classes/Prescription.class.php +++ b/library/classes/Prescription.class.php @@ -265,9 +265,9 @@ class Prescription extends ORDataObject { return $this->size; } function set_quantity($qty) { - if (is_numeric($qty)) { - $this->quantity = $qty; - } + // if (is_numeric($qty)) { + $this->quantity = $qty; + // } } function get_quantity() { return $this->quantity; diff --git a/sql/2_8_1-to-2_8_2_upgrade.sql b/sql/2_8_1-to-2_8_2_upgrade.sql index b8253d2f0..f3e692284 100644 --- a/sql/2_8_1-to-2_8_2_upgrade.sql +++ b/sql/2_8_1-to-2_8_2_upgrade.sql @@ -403,4 +403,5 @@ ALTER TABLE patient_data ADD `hipaa_message` VARCHAR(20); ALTER TABLE prescriptions - MODIFY `dosage` varchar(100) DEFAULT NULL; + MODIFY `dosage` varchar(100) DEFAULT NULL, + MODIFY `quantity` varchar(11) DEFAULT NULL; diff --git a/sql/database.sql b/sql/database.sql index 5022a2c95..e4e92a7a1 100644 --- a/sql/database.sql +++ b/sql/database.sql @@ -27586,7 +27586,7 @@ CREATE TABLE `prescriptions` ( `drug_id` int(11) NOT NULL DEFAULT 0, `form` int(3) default NULL, `dosage` varchar(100) default NULL, - `quantity` int(11) default NULL, + `quantity` varchar(11) default NULL, `size` float unsigned default NULL, `unit` int(11) default NULL, `route` int(11) default NULL, diff --git a/templates/prescription/general_edit.html b/templates/prescription/general_edit.html index 7f3191fc7..38c8d26e8 100644 --- a/templates/prescription/general_edit.html +++ b/templates/prescription/general_edit.html @@ -115,7 +115,7 @@ textarea { Quantity - + -- 2.11.4.GIT