2 ////////////////////////////////////////////////////////////////////
3 // Form: Psychiatrisch Onderzoek
4 // Package: Report of First visit - Dutch specific form
5 // Created by: Larry Lart
6 // Version: 1.0 - 29-03-2008
7 ////////////////////////////////////////////////////////////////////
9 include_once("../../globals.php");
10 include_once("$srcdir/api.inc");
11 include_once("$srcdir/forms.inc");
13 foreach ($_POST as $k => $var) {
14 $_POST[$k] = add_escape_custom($var);
18 if ($encounter == "") {
19 $encounter = date("Ymd");
22 if ($_GET["mode"] == "new") {
23 if ($_GET["id"] != '') {
26 $newid = formSubmit("form_psychiatrisch_onderzoek", $_POST, $_GET["id"], $userauthorized);
28 addForm($encounter, "Psychiatric Examination", $newid, "psychiatrisch_onderzoek", $pid, $userauthorized);
32 $_POST['autosave_flag'] = 0;
33 /// $newid = formUpdate( "form_psychiatrisch_onderzoek", $_POST, $_GET["saveid"], $userauthorized );
35 } elseif ($_GET["mode"] == "update") {
36 $strSql = "UPDATE form_psychiatrisch_onderzoek
37 SET pid = ".$_SESSION["pid"].", groupname='".$_SESSION["authProvider"]."', user='".$_SESSION["authUser"]."',
38 authorized=$userauthorized, activity=1, date = NOW(),
39 datum_onderzoek='".$_POST["datum_onderzoek"]."',
40 reden_van_aanmelding='".$_POST["reden_van_aanmelding"]."',
41 conclusie_van_intake='".$_POST["conclusie_van_intake"]."',
42 medicatie='".$_POST["medicatie"]."',
43 anamnese='".$_POST["anamnese"]."',
44 psychiatrisch_onderzoek='".$_POST["psychiatrisch_onderzoek"]."',
45 beschrijvende_conclusie='".$_POST["beschrijvende_conclusie"]."',
46 behandelvoorstel='".$_POST["behandelvoorstel"]."',
48 autosave_datetime=NOW()
49 WHERE id = ".$_GET["id"].";";
54 $_SESSION["encounter"] = $encounter;
55 formHeader("Redirecting....");