Internationalization: some more documentation fixes
[openemr.git] / ccr / createCCRProblem.php
blobc9c54292ce4edc99258d9fc6f3aa952d75e027fc
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 = getProblemData();
29 $row = sqlFetchArray($result);
30 $pCount =0;
31 //while ($row = sqlFetchArray($result)) {
33 do {
35 $pCount++;
36 echo 'encounter :'.$row['encounter'].'\n';
38 $e_Problem = $ccr->createElement('Problem');
39 $e_Problems->appendChild($e_Problem);
41 $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', 'PROB'.$pCount);
42 $e_Problem->appendChild($e_CCRDataObjectID);
44 $e_DateTime = $ccr->createElement('DateTime');
45 $e_Problem->appendChild($e_DateTime);
47 $date = date_create($row['date']);
49 $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\TH:i:s\Z'));
50 $e_DateTime->appendChild($e_ExactDateTime);
52 $e_IDs = $ccr->createElement('IDs');
53 $e_Problem->appendChild($e_IDs);
55 $e_ID = $ccr->createElement('ID', $row['pid']);
56 $e_IDs->appendChild($e_ID);
58 $e_IDs->appendChild(sourceType($ccr, $authorID));
60 $e_Type = $ccr->createElement('Type');
61 $e_Problem->appendChild($e_Type);
63 $e_Text = $ccr->createElement('Text', $row['prob_title']);
64 $e_Type->appendChild($e_Text);
66 $e_Description = $ccr->createElement('Description' );
67 $e_Problem->appendChild($e_Description);
69 $e_Text = $ccr->createElement('Text', $row['code_text']);
70 $e_Description->appendChild($e_Text);
72 $e_Code = $ccr->createElement('Code');
73 $e_Description->appendChild($e_Code);
75 $e_Value = $ccr->createElement('Value',$row['diagnosis']);
76 $e_Code->appendChild($e_Value);
78 $e_Status = $ccr->createElement('Status');
79 $e_Problem->appendChild($e_Status);
81 // $e_Text = $ccr->createElement('Text', $row['outcome']);
82 $e_Text = $ccr->createElement('Text', 'Active');
83 $e_Status->appendChild($e_Text);
85 $e_CommentID = $ccr->createElement('CommentID', $row['comments']);
86 $e_Problem->appendChild($e_CommentID);
88 $e_Episodes = $ccr->createElement('Episodes' );
89 $e_Problem->appendChild($e_Episodes);
91 $e_Number = $ccr->createElement('Number');
92 $e_Episodes->appendChild($e_Number);
94 $e_Episode = $ccr->createElement('Episode');
95 $e_Episodes->appendChild($e_Episode);
97 $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', 'EP'.$pCount);
98 $e_Episode->appendChild($e_CCRDataObjectID);
100 $e_Episode->appendChild(sourceType($ccr, $authorID));
102 $e_Episodes->appendChild(sourceType($ccr, $authorID));
104 $e_HealthStatus = $ccr->createElement('HealthStatus' );
105 $e_Problem->appendChild($e_HealthStatus);
107 $e_DateTime = $ccr->createElement('DateTime');
108 $e_HealthStatus->appendChild($e_DateTime);
110 $e_ExactDateTime = $ccr->createElement('ExactDateTime' );
111 $e_DateTime->appendChild($e_ExactDateTime);
113 $e_Description = $ccr->createElement('Description' );
114 $e_HealthStatus->appendChild($e_Description);
116 $e_Text = $ccr->createElement('Text',$row['reason']);
117 $e_Description->appendChild($e_Text);
119 $e_HealthStatus->appendChild(sourceType($ccr, $authorID));
121 } while ($row = sqlFetchArray($result));
124 // complex type should go in different find and should be included in createCCR.php
126 function sourceType($ccr, $uuid){
128 $e_Source = $ccr->createElement('Source');
130 $e_Actor = $ccr->createElement('Actor');
131 $e_Source->appendChild($e_Actor);
133 $e_ActorID = $ccr->createElement('ActorID',$uuid);
134 $e_Actor->appendChild($e_ActorID);
136 return $e_Source;