From: Agnibho Mondal Date: Fri, 14 May 2021 23:51:27 +0000 (+0530) Subject: Added autocomplete X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=63134d85d2a6980c762fdb244bacbefaa9b92763;p=simpleipd.git Added autocomplete --- diff --git a/autocomplete/drugs.json b/autocomplete/drugs.json new file mode 100644 index 0000000..a799fc2 --- /dev/null +++ b/autocomplete/drugs.json @@ -0,0 +1,66 @@ +{ + "Paracetamol":"Paracetamol", + "Drotaverine":"Drotaverine", + "Pantoprazole":"Pantoprazole", + "Ondansetron":"Ondansetron", + "Levocetrizine":"Levocetrizine", + "Montelukast":"Montelukast", + "Amoxycillin-Clavulinic Acid":"Amoxycillin-Clavulinic Acid", + "Azithromycin":"Azithromycin", + "Ciprofloxacin":"Ciprofloxacin", + "Metronidazole":"Metronidazole", + "Ceftriaxone":"Ceftriaxone", + "Vancomycin":"Vancomycin", + "Meropenem":"Meropenem", + "Piperacillin-Tazobactum":"Pipzo", + "Colistin":"Colistin", + "Polymyxin B": "Polymyxin B", + "Levosalbutamol-Ipratropium Bromide":"Levosalbutamol-Ipratropium Bromide", + "Budesonide":"Budesonide", + "NS":"NS", + "3% NaCl":"3% NaCl", + "RL":"RL", + "5D":"5D", + "25D":"25D", + "Half NS":"Half NS", + "ORS":"ORS", + "O2 with nasal cannula":"O2 with nasal cannula", + "O2 with face mask":"O2 with face mask", + "O2 with NRBM":"O2 with NRBM", + "O2 with HFNC":"O2 with HFNC", + "Ivermectin":"Ivermectin", + "Doxycycline":"Doxycycline", + "Zinc":"Zinc", + "Vitamin C":"Vitamin C", + "Antioxidant":"Antioxidant", + "Multivitamin":"Multivitamin", + "Remdesivir":"Remdesivir", + "Dexamethasone":"Dexamethasone", + "Enoxaparin":"Enoxaparin", + "LMWH":"LMWH", + "Warfarin":"Warfarin", + "Artesunate-SP":"Artesunate-SP", + "Artenmether-Lumefantrine":"Artemether-Lumefantrine", + "Primaquine":"Primaquine", + "Amphotericin B":"Amphotericin B", + "Liposomal AmB":"Liposomal AmB", + "Miltefosine":"Miltefosine", + "Cotrimoxazole":"Cotrimoxazole", + "ART":"ART", + "ATD":"ATD", + "Streptomycin":"Streptomycin", + "Levofloxacin":"Levofloxacin", + "Rifampicin":"Rifampicin", + "Isoniazide":"Isoniazide", + "Pyrazinamide":"Pyrazinamide", + "Ethambutol":"Ethambutol", + "Fluconazole":"Fluconazole", + "Acyclovir":"Acyclovir", + "Nor-Adrenaline":"Nor-Adrenaline", + "Adrenaline":"Adrenaline", + "Dopamine":"Dopamine", + "Dobutamine":"Dobutamine", + "Lorazepam":"Lorazepam", + "Phenytoin":"Phenytoin", + "Midazolam":"Midazolam" +} diff --git a/autocomplete/frequency.json b/autocomplete/frequency.json new file mode 100644 index 0000000..301ac30 --- /dev/null +++ b/autocomplete/frequency.json @@ -0,0 +1,24 @@ +{ + "OD":"OD", + "BD":"BD", + "TDS":"TDS", + "QDS":"QDS", + "5 times/day":"5 times/day", + "ODHS":"ODHS", + "ODAC":"ODAC", + "BDAC":"BDAC", + "ODPC":"ODPC", + "BDPC":"BDPC", + "1 hourly":"1 hourly", + "2 hourly":"2 hourly", + "3 hourly":"3 hourly", + "4 hourly":"4 hourly", + "5 hourly":"5 hourly", + "6 hourly":"6 hourly", + "7 hourly":"7 hourly", + "9 hourly":"9 hourly", + "10 hourly":"10 hourly", + "11 hourly":"11 hourly", + "12 hourly":"12 hourly", + "Stat":"Stat" +} diff --git a/autocomplete/route.json b/autocomplete/route.json new file mode 100644 index 0000000..468385d --- /dev/null +++ b/autocomplete/route.json @@ -0,0 +1,10 @@ +{ + "PO":"PO", + "IV":"IV", + "IM":"IM", + "PR":"PR", + "Infusion":"Infusion", + "Transfusion":"Transfusion", + "Inhalation":"Inhalation", + "Nebulization":"Nebulization" +} diff --git a/discharge.php b/discharge.php index 32e7488..1b0a5cc 100644 --- a/discharge.php +++ b/discharge.php @@ -11,15 +11,15 @@ if(!empty($_GET["pid"])){ if(!empty($_POST["delete"])){ $db->deleteAdvice($_POST["delete"]); } - elseif(!empty($_POST["name"])){ - $db->addAdvice($pid, $_POST["name"], $_POST["dose"], $_POST["route"], $_POST["frequency"], $_POST["duration"], $_POST["extra-note"]); + elseif(!empty($_POST["drug"])){ + $db->addAdvice($pid, $_POST["drug"], $_POST["dose"], $_POST["route"], $_POST["frequency"], $_POST["duration"], $_POST["extra-note"]); } $list=$db->getAdvice($pid); $view="
"; $view=$view.""; $view=$view.""; while($drug=$list->fetchArray()){ - $view=$view.""; + $view=$view.""; } $view=$view."
DrugDoseRouteFrequencyDurationNote
".$drug["name"]."".$drug["dose"]."".$drug["route"]."".$drug["frequency"]."".$drug["duration"]."".$drug["addl"]."
".$drug["drug"]."".$drug["dose"]."".$drug["route"]."".$drug["frequency"]."".$drug["duration"]."".$drug["addl"]."
"; $form=schema2form("forms/drugs.schema.json"); diff --git a/forms/drugs.schema.json b/forms/drugs.schema.json index 5d4d8c2..8605693 100644 --- a/forms/drugs.schema.json +++ b/forms/drugs.schema.json @@ -5,7 +5,7 @@ "type": "object", "properties": { - "name": { + "drug": { "description": "Name", "type": "string" }, diff --git a/lib/foot.php b/lib/foot.php index 3103bf4..c8308cf 100644 --- a/lib/foot.php +++ b/lib/foot.php @@ -1,6 +1,7 @@ + diff --git a/res/bootstrap-4-autocomplete.min.js b/res/bootstrap-4-autocomplete.min.js new file mode 100644 index 0000000..e581a88 --- /dev/null +++ b/res/bootstrap-4-autocomplete.min.js @@ -0,0 +1 @@ +!function(u){var n={treshold:4,maximumItems:5,highlightTyped:!0,highlightClass:"text-primary"};function p(e,t,o){var a;if(o.highlightTyped){var n=t.label.toLowerCase().indexOf(e.toLowerCase());a=t.label.substring(0,n)+''+t.label.substring(n,n+e.length)+""+t.label.substring(n+e.length,t.label.length)}else a=t.label;return'"}function l(e,t){var o=e.val();if(o.length=t.maximumItems))break}return e.next().find(".dropdown-item").click(function(){e.val(u(this).text()),t.onSelectItem&&t.onSelectItem({value:u(this).data("value"),label:u(this).text()},e[0])}),a.children().length}u.fn.autocomplete=function(e){var t={};u.extend(t,n,e);var o=u(this);o.parent().removeClass("dropdown"),o.removeAttr("data-toggle"),o.removeClass("dropdown-toggle"),o.parent().find(".dropdown-menu").remove(),o.dropdown("dispose"),o.parent().addClass("dropdown"),o.attr("data-toggle","dropdown"),o.addClass("dropdown-toggle");var a=u('');return t.dropdownClass&&a.addClass(t.dropdownClass),o.after(a),o.dropdown(t.dropdownOptions),this.off("click.autocomplete").click("click.autocomplete",function(e){0==l(o,t)&&(e.stopPropagation(),o.dropdown("hide"))}),this.off("keyup.autocomplete").keyup("keyup.autocomplete",function(){0omitDrug($_POST["omit"]); } - elseif(!empty($_POST["name"])){ - $db->addDrug($pid, $_POST["name"], $_POST["dose"], $_POST["route"], $_POST["frequency"], $_POST["date"], $_POST["time"], $_POST["duration"], $_POST["extra-note"]); + elseif(!empty($_POST["drug"])){ + $db->addDrug($pid, $_POST["drug"], $_POST["dose"], $_POST["route"], $_POST["frequency"], $_POST["date"], $_POST["time"], $_POST["duration"], $_POST["extra-note"]); } $list=$db->getDrugs($pid); $view="
"; @@ -31,7 +31,7 @@ if(!empty($_GET["pid"])){ } } catch(TypeError $e){} } - $view=$view."".$drug["name"]."".$drug["dose"]."".$drug["route"]."".$drug["frequency"]."".date("M j", $drug["start"])."".$drug["duration"]."".$drug["addl"].""; + $view=$view."".$drug["drug"]."".$drug["dose"]."".$drug["route"]."".$drug["frequency"]."".date("M j", $drug["start"])."".$drug["duration"]."".$drug["addl"].""; } $view=$view.""; $form=schema2form("forms/drugs.schema.json");