|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00026 require_once 'Zend/Gdata/App/Extension/Element.php'; 00027 00037 class Zend_Gdata_Health_Extension_Ccr extends Zend_Gdata_App_Extension_Element 00038 { 00039 protected $_rootNamespace = 'ccr'; 00040 protected $_rootElement = 'ContinuityOfCareRecord'; 00041 protected $_ccrDom = null; 00042 00049 public function __construct($element = null) 00050 { 00051 foreach (Zend_Gdata_Health::$namespaces as $nsPrefix => $nsUri) { 00052 $this->registerNamespace($nsPrefix, $nsUri); 00053 } 00054 } 00055 00063 public function transferFromDOM($node) 00064 { 00065 $this->_ccrDom = $node; 00066 } 00067 00078 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00079 { 00080 if ($doc === null) { 00081 $doc = new DOMDocument('1.0', 'utf-8'); 00082 } 00083 $domElement = $doc->importNode($this->_ccrDom, true); 00084 return $domElement; 00085 } 00086 00098 public function __call($name, $args) 00099 { 00100 if (substr($name, 0, 3) === 'get') { 00101 $category = substr($name, 3); 00102 00103 switch ($category) { 00104 case 'Conditions': 00105 $category = 'Problems'; 00106 break; 00107 case 'Allergies': 00108 $category = 'Alerts'; 00109 break; 00110 case 'TestResults': 00111 // TestResults is an alias for LabResults 00112 case 'LabResults': 00113 $category = 'Results'; 00114 break; 00115 default: 00116 // $category is already well formatted 00117 } 00118 00119 return $this->_ccrDom->getElementsByTagNameNS($this->lookupNamespace('ccr'), $category); 00120 } else { 00121 return null; 00122 } 00123 } 00124 }