forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
save.php
67 lines (54 loc) · 2.14 KB
/
save.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
////////////////////////////////////////////////////////////////////
// Form: Psychiatrisch Onderzoek
// Package: Report of First visit - Dutch specific form
// Created by: Larry Lart
// Version: 1.0 - 29-03-2008
////////////////////////////////////////////////////////////////////
include_once("../../globals.php");
include_once("$srcdir/api.inc");
include_once("$srcdir/forms.inc");
foreach ($_POST as $k => $var)
{
$_POST[$k] = mysql_real_escape_string($var);
// echo "$var\n";
}
if($encounter == "") $encounter = date("Ymd");
if( $_GET["mode"] == "new" )
{
if( $_GET["id"] != '' )
{
echo "lalala 1";
$_GET["id"] = '0';
$newid = formSubmit( "form_psychiatrisch_onderzoek", $_POST, $_GET["id"], $userauthorized );
// add new form ???
addForm( $encounter, "Psychiatric Examination", $newid, "psychiatrisch_onderzoek", $pid, $userauthorized );
} else
{
echo "lalala 2";
$_POST['autosave_flag'] = 0;
/// $newid = formUpdate( "form_psychiatrisch_onderzoek", $_POST, $_GET["saveid"], $userauthorized );
}
} elseif( $_GET["mode"] == "update" )
{
$strSql = "UPDATE form_psychiatrisch_onderzoek
SET pid = ".$_SESSION["pid"].", groupname='".$_SESSION["authProvider"]."', user='".$_SESSION["authUser"]."',
authorized=$userauthorized, activity=1, date = NOW(),
datum_onderzoek='".$_POST["datum_onderzoek"]."',
reden_van_aanmelding='".$_POST["reden_van_aanmelding"]."',
conclusie_van_intake='".$_POST["conclusie_van_intake"]."',
medicatie='".$_POST["medicatie"]."',
anamnese='".$_POST["anamnese"]."',
psychiatrisch_onderzoek='".$_POST["psychiatrisch_onderzoek"]."',
beschrijvende_conclusie='".$_POST["beschrijvende_conclusie"]."',
behandelvoorstel='".$_POST["behandelvoorstel"]."',
autosave_flag=0,
autosave_datetime=NOW()
WHERE id = ".$_GET["id"].";";
sqlQuery( $strSql );
}
$_SESSION["encounter"] = $encounter;
formHeader("Redirecting....");
formJump();
formFooter();
?>