Add medication dosage to the patient dashboard and reports (#5621 #5623) (#5622)
[openemr.git] / ccr / createCCRProcedure.php
blobbdfd85d8c9b1dd33320fd1440eb30dbd72596ec2
1 <?php
3 /**
4 * CCR Script.
6 * Copyright (C) 2010 Garden State Health Systems <http://www.gshsys.com/>
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 3
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Garden State Health Systems <http://www.gshsys.com/>
21 * @link http://www.open-emr.org
24 $result = getProcedureData();
25 $row = sqlFetchArray($result);
27 do {
28 $e_Procedure = $ccr->createElement('Procedure');
29 $e_Procedures->appendChild($e_Procedure);
31 $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid());
32 $e_Procedure->appendChild($e_CCRDataObjectID);
34 $e_DateTime = $ccr->createElement('DateTime');
35 $e_Procedure->appendChild($e_DateTime);
37 $date = date_create($row['date']);
39 $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\TH:i:s\Z'));
40 $e_DateTime->appendChild($e_ExactDateTime);
42 $e_Type = $ccr->createElement('Type');
43 $e_Procedure->appendChild($e_Type);
45 $e_Text = $ccr->createElement('Text', $row['type']);
46 $e_Type->appendChild($e_Text);
48 $e_Description = $ccr->createElement('Description');
49 $e_Procedure->appendChild($e_Description);
51 $e_Text = $ccr->createElement('Text', $row['proc_title']);
52 $e_Description->appendChild($e_Text);
54 $e_Code = $ccr->createElement('Code');
55 $e_Description->appendChild($e_Code);
57 $e_Value = $ccr->createElement('Value', $row['code']);
58 $e_Code->appendChild($e_Value);
60 $e_Value = $ccr->createElement('CodingSystem', $row['coding']);
61 $e_Code->appendChild($e_Value);
63 $e_Status = $ccr->createElement('Status');
64 $e_Procedure->appendChild($e_Status);
66 $e_Text = $ccr->createElement('Text', $row['outcome']);
67 $e_Status->appendChild($e_Text);
69 $e_Procedure->appendChild(sourceType($ccr, $sourceID));
71 $e_Locations = $ccr->createElement('Locations');
72 $e_Procedure->appendChild($e_Locations);
74 $e_Location = $ccr->createElement('Location');
75 $e_Locations->appendChild($e_Location);
77 $e_Description = $ccr->createElement('Description');
78 $e_Location->appendChild($e_Description);
80 $e_Text = $ccr->createElement('Text', $row['laterality']);
81 $e_Description->appendChild($e_Text);
83 $e_Practitioners = $ccr->createElement('Practitioners');
84 $e_Procedure->appendChild($e_Practitioners);
86 $e_Practitioner = $ccr->createElement('Practitioner');
87 $e_Practitioners->appendChild($e_Practitioner);
89 $e_ActorRole = $ccr->createElement('ActorRole');
90 $e_Practitioner->appendChild($e_ActorRole);
92 $e_Text = $ccr->createElement('Text', 'None');
93 $e_ActorRole->appendChild($e_Text);
95 $e_Duration = $ccr->createElement('Duration');
96 $e_Procedure->appendChild($e_Duration);
98 $e_Description = $ccr->createElement('Description');
99 $e_Duration->appendChild($e_Description);
101 $e_Text = $ccr->createElement('Text', 'None');
102 $e_Description->appendChild($e_Text);
104 $e_Substance = $ccr->createElement('Substance');
105 $e_Procedure->appendChild($e_Substance);
107 $e_Text = $ccr->createElement('Text', '');
108 $e_Substance->appendChild($e_Text);
110 $e_Method = $ccr->createElement('Method');
111 $e_Procedure->appendChild($e_Method);
113 $e_Text = $ccr->createElement('Text', '');
114 $e_Method->appendChild($e_Text);
116 $e_Position = $ccr->createElement('Position');
117 $e_Procedure->appendChild($e_Position);
119 $e_Text = $ccr->createElement('Text', $row['laterality']);
120 $e_Position->appendChild($e_Text);
122 $e_Site = $ccr->createElement('Site');
123 $e_Procedure->appendChild($e_Site);
125 $e_Text = $ccr->createElement('Text', $row['body_site']);
126 $e_Site->appendChild($e_Text);
127 } while ($row = sqlFetchArray($result));