Add new modules loaded event (#7463)
[openemr.git] / ccr / createCCRImmunization.php
blob2bb080e04e0449b3b94b998ad85928bd2d5ab5be
1 <?php
3 /**
4 * CCR Script.
6 * Copyright (C) 2010 Garden State Health Systems <http://www.gshsys.com/>
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 3
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Garden State Health Systems <http://www.gshsys.com/>
21 * @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));