Support for larger size codes (such as SNOMED US Extension codes)
[openemr.git] / contrib / forms / nursing_notes / C_FormNursingNotes.class.php
blobb627c794120d4422a4ce2c7dadcbf0b3660a31f1
1 <?php
2 // Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
8 require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php");
9 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
10 require_once("FormNursingNotes.class.php");
12 class C_FormNursingNotes extends Controller {
14 var $template_dir;
16 function C_FormNursingNotes($template_mod = "general") {
17 parent::Controller();
18 $this->template_mod = $template_mod;
19 $this->template_dir = dirname(__FILE__) . "/templates/";
20 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
21 $this->assign("DONT_SAVE_LINK",$GLOBALS['form_exit_url']);
22 $this->assign("STYLE", $GLOBALS['style']);
25 function default_action() {
26 $form = new FormNursingNotes();
27 $this->assign("data",$form);
28 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
31 function view_action($form_id) {
32 if (is_numeric($form_id)) {
33 $form = new FormNursingNotes($form_id);
35 else {
36 $form = new FormNursingNotes();
38 $dbconn = $GLOBALS['adodb']['db'];
39 $this->assign("data",$form);
40 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
43 function default_action_process() {
44 if ($_POST['process'] != "true")
45 return;
46 $this->form = new FormNursingNotes($_POST['id']);
47 parent::populate_object($this->form);
48 $this->form->persist();
49 if ($GLOBALS['encounter'] == "") {
50 $GLOBALS['encounter'] = date("Ymd");
52 if (empty($_POST['id'])) {
53 addForm($GLOBALS['encounter'], "Nursing Notes", $this->form->id, "nursing_notes",
54 $GLOBALS['pid'], $_SESSION['userauthorized']);
55 $_POST['process'] = "";
57 return;