fix issue #1176
[openemr.git] / ccr / createCCRImmunization.php
blobcb13a2d09f0b61da823637264916cc919ce71f6a
1 <?php
2 /**
3 * CCR Script.
5 * Copyright (C) 2010 Garden State Health Systems <http://www.gshsys.com/>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Garden State Health Systems <http://www.gshsys.com/>
20 * @link http://www.open-emr.org
24 $result = getImmunizationData();
25 $row = sqlFetchArray($result);
27 do {
28 $e_Immunization = $ccr->createElement('Immunization');
29 $e_Immunizations->appendChild($e_Immunization);
31 $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid());
32 $e_Immunization->appendChild($e_CCRDataObjectID);
34 $e_DateTime = $ccr->createElement('DateTime');
35 $e_Immunization->appendChild($e_DateTime);
37 $date = date_create($row['administered_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_Immunization->appendChild($e_Type);
45 $e_Text = $ccr->createElement('Text', 'Immunization');
46 $e_Type->appendChild($e_Text);
48 $e_Status = $ccr->createElement('Status');
49 $e_Immunization->appendChild($e_Status);
51 $e_Text = $ccr->createElement('Text', 'ACTIVE');
52 $e_Status->appendChild($e_Text);
54 $e_Immunization->appendChild(sourceType($ccr, $sourceID));
56 $e_Product = $ccr->createElement('Product');
57 $e_Immunization->appendChild($e_Product);
59 $e_ProductName = $ccr->createElement('ProductName');
60 $e_Product->appendChild($e_ProductName);
62 $e_Text = $ccr->createElement('Text', $row['title']);
63 $e_ProductName->appendChild($e_Text);
65 $e_Directions = $ccr->createElement('Directions');
66 $e_Immunization->appendChild($e_Directions);
68 $e_Direction = $ccr->createElement('Direction');
69 $e_Directions->appendChild($e_Direction);
71 $e_Description = $ccr->createElement('Description');
72 $e_Direction->appendChild($e_Description);
74 $e_Text = $ccr->createElement('Text', $row['note']);
75 $e_Description->appendChild($e_Text);
77 $e_Code = $ccr->createElement('Code');
78 $e_Description->appendChild($e_Code);
80 $e_Value = $ccr->createElement('Value', 'None');
81 $e_Code->appendChild($e_Value);
82 } while ($row = sqlFetchArray($result));