edihistory -- revisions and cleanup of 277 claim status functions
[openemr.git] / ccr / createCCRProcedure.php
blobc507c867a4f3c6cd94117b19f0295a86735b532f
1 <?php
2 // ------------------------------------------------------------------------ //
3 // Garden State Health Systems //
4 // Copyright (c) 2010 gshsys.com //
5 // <http://www.gshsys.com/> //
6 // ------------------------------------------------------------------------ //
7 // This program is free software; you can redistribute it and/or modify //
8 // it under the terms of the GNU General Public License as published by //
9 // the Free Software Foundation; either version 2 of the License, or //
10 // (at your option) any later version. //
11 // //
12 // You may not change or alter any portion of this comment or credits //
13 // of supporting developers from this source code or any supporting //
14 // source code which is considered copyrighted (c) material of the //
15 // original comment or credit authors. //
16 // //
17 // This program is distributed in the hope that it will be useful, //
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20 // GNU General Public License for more details. //
21 // //
22 // You should have received a copy of the GNU General Public License //
23 // along with this program; if not, write to the Free Software //
24 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
25 // ------------------------------------------------------------------------ //
28 $result = getProcedureData();
29 $row = sqlFetchArray($result);
31 do {
33 $e_Procedure = $ccr->createElement('Procedure');
34 $e_Procedures->appendChild($e_Procedure);
36 $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid());
37 $e_Procedure->appendChild($e_CCRDataObjectID);
39 $e_DateTime = $ccr->createElement('DateTime');
40 $e_Procedure->appendChild($e_DateTime);
42 $date = date_create($row['date']);
44 $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\TH:i:s\Z'));
45 $e_DateTime->appendChild($e_ExactDateTime);
47 $e_Type = $ccr->createElement('Type');
48 $e_Procedure->appendChild($e_Type);
50 $e_Text = $ccr->createElement('Text', $row['type']);
51 $e_Type->appendChild($e_Text);
53 $e_Description = $ccr->createElement('Description' );
54 $e_Procedure->appendChild($e_Description);
56 $e_Text = $ccr->createElement('Text', $row['proc_title']);
57 $e_Description->appendChild($e_Text);
59 $e_Code = $ccr->createElement('Code');
60 $e_Description->appendChild($e_Code);
62 $e_Value = $ccr->createElement('Value', $row['code']);
63 $e_Code->appendChild($e_Value);
65 $e_Value = $ccr->createElement('CodingSystem', $row['coding']);
66 $e_Code->appendChild($e_Value);
68 $e_Status = $ccr->createElement('Status');
69 $e_Procedure->appendChild($e_Status);
71 $e_Text = $ccr->createElement('Text', $row['outcome']);
72 $e_Status->appendChild($e_Text);
74 $e_Procedure->appendChild(sourceType($ccr, $sourceID));
76 $e_Locations = $ccr->createElement('Locations');
77 $e_Procedure->appendChild($e_Locations);
79 $e_Location = $ccr->createElement('Location');
80 $e_Locations->appendChild($e_Location);
82 $e_Description = $ccr->createElement('Description' );
83 $e_Location->appendChild($e_Description);
85 $e_Text = $ccr->createElement('Text', $row['laterality']);
86 $e_Description->appendChild($e_Text);
88 $e_Practitioners = $ccr->createElement('Practitioners');
89 $e_Procedure->appendChild($e_Practitioners);
91 $e_Practitioner = $ccr->createElement('Practitioner');
92 $e_Practitioners->appendChild($e_Practitioner);
94 $e_ActorRole = $ccr->createElement('ActorRole');
95 $e_Practitioner->appendChild($e_ActorRole);
97 $e_Text = $ccr->createElement('Text', 'None');
98 $e_ActorRole->appendChild($e_Text);
100 $e_Duration = $ccr->createElement('Duration');
101 $e_Procedure->appendChild($e_Duration);
103 $e_Description = $ccr->createElement('Description' );
104 $e_Duration->appendChild($e_Description);
106 $e_Text = $ccr->createElement('Text', 'None');
107 $e_Description->appendChild($e_Text);
109 $e_Substance = $ccr->createElement('Substance');
110 $e_Procedure->appendChild($e_Substance);
112 $e_Text = $ccr->createElement('Text', '');
113 $e_Substance->appendChild($e_Text);
115 $e_Method = $ccr->createElement('Method');
116 $e_Procedure->appendChild($e_Method);
118 $e_Text = $ccr->createElement('Text', '');
119 $e_Method->appendChild($e_Text);
121 $e_Position = $ccr->createElement('Position');
122 $e_Procedure->appendChild($e_Position);
124 $e_Text = $ccr->createElement('Text', $row['laterality']);
125 $e_Position->appendChild($e_Text);
127 $e_Site = $ccr->createElement('Site');
128 $e_Procedure->appendChild($e_Site);
130 $e_Text = $ccr->createElement('Text', $row['body_site']);
131 $e_Site->appendChild($e_Text);
133 } while ($row = sqlFetchArray($result));