Update to 4.0 Documentation
[openemr.git] / ccr / createCCRProcedure.php
blob8d7e2a1ae5656d502f8f01226f8e1e6d6038e2d4
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 echo 'encounter :'.$row['encounter'].'\n';
35 $e_Procedure = $ccr->createElement('Procedure');
36 $e_Procedures->appendChild($e_Procedure);
38 $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid());
39 $e_Procedure->appendChild($e_CCRDataObjectID);
41 $e_DateTime = $ccr->createElement('DateTime');
42 $e_Procedure->appendChild($e_DateTime);
44 $date = date_create($row['date']);
46 $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\TH:i:s\Z'));
47 $e_DateTime->appendChild($e_ExactDateTime);
49 $e_Type = $ccr->createElement('Type');
50 $e_Procedure->appendChild($e_Type);
52 $e_Text = $ccr->createElement('Text', $row['type']);
53 $e_Type->appendChild($e_Text);
56 $e_Description = $ccr->createElement('Description' );
57 $e_Procedure->appendChild($e_Description);
59 $e_Text->nodeValue = $row['proc_title'];
60 $e_Description->appendChild(clone $e_Text);
62 $e_Code = $ccr->createElement('Code');
63 $e_Description->appendChild($e_Code);
65 $e_Value = $ccr->createElement('Value', 'None');
66 $e_Code->appendChild($e_Value);
68 $e_Status = $ccr->createElement('Status');
69 $e_Procedure->appendChild($e_Status);
71 $e_Text->nodeValue = $row['outcome'];
72 $e_Status->appendChild(clone $e_Text);
74 $e_Procedure->appendChild(sourceType($ccr, $authorID));
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->nodeValue = 'body_location'; //$row['laterality'];
86 $e_Description->appendChild(clone $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->nodeValue = 'None';
98 $e_ActorRole->appendChild(clone $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->nodeValue = 'None';
107 $e_Description->appendChild(clone $e_Text);
109 $e_Substance = $ccr->createElement('Substance');
110 $e_Procedure->appendChild($e_Substance);
112 $e_Text->nodeValue = 'substance';
113 $e_Substance->appendChild(clone $e_Text);
115 $e_Method = $ccr->createElement('Method');
116 $e_Procedure->appendChild($e_Method);
118 $e_Text->nodeValue = 'method'; //?
119 $e_Method->appendChild(clone $e_Text);
121 $e_Position = $ccr->createElement('Position'); //$row['laterality']
122 $e_Procedure->appendChild($e_Position);
124 $e_Text->nodeValue = 'body_position';// $row['laterality'];
125 $e_Position->appendChild(clone $e_Text);
127 $e_Site = $ccr->createElement('Site');
128 $e_Procedure->appendChild($e_Site);
130 $e_Text->nodeValue = 'body_site';//$row['body_site'];
131 $e_Site->appendChild(clone $e_Text);
133 } while ($row = sqlFetchArray($result));