CCR-CCD module: minor bug fix
[openemr.git] / ccr / createCCRImmunization.php
blob24355cc4b25482c7ffeb9c89c3b80aab6bafd5ba
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 // ------------------------------------------------------------------------ //
27 //require_once(dirname(__FILE__) . "/../library/sql-ccr.inc");
29 $result = getImmunizationData();
30 $row = sqlFetchArray($result);
32 do {
34 echo "immunization_id :".$row['immunization_id']."\n";
36 $e_Immunization = $ccr->createElement('Immunization');
37 $e_Immunizations->appendChild($e_Immunization);
39 $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid());
40 $e_Immunization->appendChild($e_CCRDataObjectID);
42 $e_DateTime = $ccr->createElement('DateTime');
43 $e_Immunization->appendChild($e_DateTime);
45 $date = date_create($row['administered_date']);
47 $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\TH:i:s\Z'));
48 $e_DateTime->appendChild($e_ExactDateTime);
50 $e_Type = $ccr->createElement('Type');
51 $e_Immunization->appendChild($e_Type);
53 $e_Text = $ccr->createElement('Text', 'Immunization');
54 $e_Type->appendChild($e_Text);
56 $e_Status = $ccr->createElement('Status');
57 $e_Immunization->appendChild($e_Status);
59 $e_Text = $ccr->createElement('Text','ACTIVE');
60 $e_Status->appendChild($e_Text);
62 $e_Immunization->appendChild(sourceType($ccr, $authorID));
64 $e_Product = $ccr->createElement('Product');
65 $e_Immunization->appendChild($e_Product);
67 $e_ProductName = $ccr->createElement('ProductName');
68 $e_Product->appendChild($e_ProductName);
70 $e_Text = $ccr->createElement('Text',$row['title']);
71 $e_ProductName->appendChild( $e_Text);
73 $e_Directions = $ccr->createElement('Directions');
74 $e_Immunization->appendChild($e_Directions);
76 $e_Direction = $ccr->createElement('Direction');
77 $e_Directions->appendChild($e_Direction);
79 $e_Description = $ccr->createElement('Description');
80 $e_Direction->appendChild($e_Description);
82 $e_Text = $ccr->createElement('Text',$row['note']);
83 $e_Description->appendChild($e_Text);
85 $e_Code = $ccr->createElement('Code');
86 $e_Description->appendChild($e_Code);
88 $e_Value = $ccr->createElement('Value', 'None');
89 $e_Code->appendChild($e_Value);
91 } while ($row = sqlFetchArray($result));