Exemple #1
0
 /**
  * Transform an XML file to array
  * @param string $xmlFile
  * @return type
  */
 protected function xmlToArray($xmlFile)
 {
     $data = FALSE;
     if (file_exists($xmlFile)) {
         $reader = new \Zend\Config\Reader\Xml();
         $xml = $reader->fromFile($xmlFile);
         if ($xml) {
             $data = $xml;
         }
     }
     return $data;
 }
Exemple #2
0
 /**
  * Read an XML File and return it as an array
  * @param string $xml Path to XML File
  * @return array|boolean 
  */
 public static function toArray($xmlFile)
 {
     $data = FALSE;
     if (file_exists($xmlFile)) {
         $reader = new \Zend\Config\Reader\Xml();
         $xml = $reader->fromFile($xmlFile);
         if ($xml) {
             $cacheObj = self::getCache();
             $data = $xml;
         }
     }
     return $data;
 }
Exemple #3
0
 public function importAction()
 {
     $request = $this->getRequest();
     if ($request->getQuery('document_id')) {
         $_REQUEST["document_id"] = $request->getQuery('document_id');
         $category_details = \Carecoordination\Controller\CarecoordinationController::getCarecoordinationTable()->fetch_cat_id('CCD');
         \Documents\Controller\DocumentsController::getDocumentsTable()->updateDocumentCategory($category_details[0]['id'], $_REQUEST["document_id"]);
     }
     $document_id = $_REQUEST["document_id"];
     $xml_content = \Carecoordination\Controller\CarecoordinationController::getCarecoordinationTable()->getDocument($document_id);
     $xmltoarray = new \Zend\Config\Reader\Xml();
     $array = $xmltoarray->fromString((string) $xml_content);
     $this->getCcdTable()->import($array, $document_id);
     $view = new ViewModel();
     $view->setTerminal(true);
     return $view;
 }
 public function index3Action()
 {
     $reader = new \Zend\Config\Reader\Xml();
     $data = $reader->fromFile(__DIR__ . '/../../../config/xml/module.config.xml');
     echo "<pre>";
     print_r($data);
     echo "</pre>";
     /** ghi vao file xml */
     $config = new \Zend\Config\Config(array(), true);
     $config->production = array();
     $config->production->website = 'zend.vn';
     $config->production->account = array();
     $config->production->account->email = '*****@*****.**';
     $config->production->account->port = 465;
     $writer = new \Zend\Config\Writer\Xml();
     $writer->toFile(__DIR__ . '/../../../config/xml/config.xml', $config);
     return false;
 }
Exemple #5
0
 public function getConfig()
 {
     /*
             Read file config by xml
     */
     $reader = new \Zend\Config\Reader\Xml();
     // $reader->setNestSeparator(".");
     $configArr = $reader->fromFile(__DIR__ . "/config/module.config.xml");
     $configArr['view_manager']['template_path_stack'] = array(__DIR__ . "/view");
     foreach ($configArr['controllers']['invokables'] as $key => $value) {
         $newKey = preg_replace("#Controller\$#", "", $value);
         $configArr['controllers']['invokables'][$newKey] = $value;
         unset($configArr['controllers']['invokables'][$key]);
     }
     /*
             Read file config by ini
     */
     // $reader = new \Zend\Config\Reader\Ini();
     // $reader->setNestSeparator(".");
     // $configArr = $reader->fromFile(__DIR__."/config/module.config.ini");
     // $configArr['view_manager']['template_path_stack'] = array(__DIR__."/view");
     //return $configArr;
     return include __DIR__ . '/config/module.config.php';
 }
 public function importAction()
 {
     $request = $this->getRequest();
     if ($request->getQuery('document_id')) {
         $_REQUEST["document_id"] = $request->getQuery('document_id');
         $category_details = $this->getCarecoordinationTable()->fetch_cat_id('CCDA');
         \Documents\Controller\DocumentsController::getDocumentsTable()->updateDocumentCategory($category_details[0]['id'], $_REQUEST["document_id"]);
     }
     $document_id = $_REQUEST["document_id"];
     $xml_content = $this->getCarecoordinationTable()->getDocument($document_id);
     $xml_content_new = preg_replace('#<br />#', '', $xml_content);
     $xml_content_new = preg_replace('#<br/>#', '', $xml_content_new);
     $xmltoarray = new \Zend\Config\Reader\Xml();
     $array = $xmltoarray->fromString((string) $xml_content_new);
     $patient_role = $array['recordTarget']['patientRole'];
     $patient_pub_pid = $patient_role['id'][0]['extension'];
     $patient_ssn = $patient_role['id'][1]['extension'];
     $patient_address = $patient_role['addr']['streetAddressLine'];
     $patient_city = $patient_role['addr']['city'];
     $patient_state = $patient_role['addr']['state'];
     $patient_postalcode = $patient_role['addr']['postalCode'];
     $patient_country = $patient_role['addr']['country'];
     $patient_phone_type = $patient_role['telecom']['use'];
     $patient_phone_no = $patient_role['telecom']['value'];
     $patient_fname = $patient_role['patient']['name']['given'][0];
     $patient_lname = $patient_role['patient']['name']['given'][1];
     $patient_family_name = $patient_role['patient']['name']['family'];
     $patient_gender_code = $patient_role['patient']['administrativeGenderCode']['code'];
     $patient_gender_name = $patient_role['patient']['administrativeGenderCode']['displayName'];
     $patient_dob = $patient_role['patient']['birthTime']['value'];
     $patient_marital_status = $patient_role['patient']['religiousAffiliationCode']['code'];
     $patient_marital_status_display = $patient_role['patient']['religiousAffiliationCode']['displayName'];
     $patient_race = $patient_role['patient']['raceCode']['code'];
     $patient_race_display = $patient_role['patient']['raceCode']['displayName'];
     $patient_ethnicity = $patient_role['patient']['ethnicGroupCode']['code'];
     $patient_ethnicity_display = $patient_role['patient']['ethnicGroupCode']['displayName'];
     $patient_language = $patient_role['patient']['languageCommunication']['languageCode']['code'];
     $author = $array['recordTarget']['author']['assignedAuthor'];
     $author_id = $author['id']['extension'];
     $author_address = $author['addr']['streetAddressLine'];
     $author_city = $author['addr']['city'];
     $author_state = $author['addr']['state'];
     $author_postalCode = $author['addr']['postalCode'];
     $author_country = $author['addr']['country'];
     $author_phone_use = $author['telecom']['use'];
     $author_phone = $author['telecom']['value'];
     $author_name_given = $author['assignedPerson']['name']['given'];
     $author_name_family = $author['assignedPerson']['name']['family'];
     $data_enterer = $array['recordTarget']['dataEnterer']['assignedEntity'];
     $data_enterer_id = $data_enterer['id']['extension'];
     $data_enterer_address = $data_enterer['addr']['streetAddressLine'];
     $data_enterer_city = $data_enterer['addr']['city'];
     $data_enterer_state = $data_enterer['addr']['state'];
     $data_enterer_postalCode = $data_enterer['addr']['postalCode'];
     $data_enterer_country = $data_enterer['addr']['country'];
     $data_enterer_phone_use = $data_enterer['telecom']['use'];
     $data_enterer_phone = $data_enterer['telecom']['value'];
     $data_enterer_name_given = $data_enterer['assignedPerson']['name']['given'];
     $data_enterer_name_family = $data_enterer['assignedPerson']['name']['family'];
     $informant = $array['recordTarget']['informant'][0]['assignedEntity'];
     $informant_id = $informant['id']['extension'];
     $informant_address = $informant['addr']['streetAddressLine'];
     $informant_city = $informant['addr']['city'];
     $informant_state = $informant['addr']['state'];
     $informant_postalCode = $informant['addr']['postalCode'];
     $informant_country = $informant['addr']['country'];
     $informant_phone_use = $informant['telecom']['use'];
     $informant_phone = $informant['telecom']['value'];
     $informant_name_given = $informant['assignedPerson']['name']['given'];
     $informant_name_family = $informant['assignedPerson']['name']['family'];
     $personal_informant = $array['recordTarget']['informant'][1]['relatedEntity'];
     $personal_informant_name = $personal_informant['relatedPerson']['name']['given'];
     $personal_informant_family = $personal_informant['relatedPerson']['name']['family'];
     $custodian = $array['recordTarget']['custodian']['assignedCustodian']['representedCustodianOrganization'];
     $custodian_name = $custodian['name'];
     $custodian_address = $custodian['addr']['streetAddressLine'];
     $custodian_city = $custodian['addr']['city'];
     $custodian_state = $custodian['addr']['state'];
     $custodian_postalCode = $custodian['addr']['postalCode'];
     $custodian_country = $custodian['addr']['country'];
     $custodian_phone = $custodian['telecom']['value'];
     $custodian_phone_use = $custodian['telecom']['use'];
     $informationRecipient = $array['recordTarget']['informationRecipient']['intendedRecipient'];
     $informationRecipient_name = $informationRecipient['informationRecipient']['name']['given'];
     $informationRecipient_name = $informationRecipient['informationRecipient']['name']['family'];
     $informationRecipient_org = $informationRecipient['receivedOrganization']['name'];
     $legalAuthenticator = $array['recordTarget']['legalAuthenticator'];
     $legalAuthenticator_signatureCode = $legalAuthenticator['signatureCode']['code'];
     $legalAuthenticator_id = $legalAuthenticator['assignedEntity']['id']['extension'];
     $legalAuthenticator_address = $legalAuthenticator['assignedEntity']['addr']['streetAddressLine'];
     $legalAuthenticator_city = $legalAuthenticator['assignedEntity']['addr']['city'];
     $legalAuthenticator_state = $legalAuthenticator['assignedEntity']['addr']['state'];
     $legalAuthenticator_postalCode = $legalAuthenticator['assignedEntity']['addr']['postalCode'];
     $legalAuthenticator_country = $legalAuthenticator['assignedEntity']['addr']['country'];
     $legalAuthenticator_phone = $legalAuthenticator['assignedEntity']['telecom']['value'];
     $legalAuthenticator_phone_use = $legalAuthenticator['assignedEntity']['telecom']['use'];
     $legalAuthenticator_name_given = $legalAuthenticator['assignedEntity']['assignedPerson']['name']['given'];
     $legalAuthenticator_name_family = $legalAuthenticator['assignedEntity']['assignedPerson']['name']['family'];
     $authenticator = $array['recordTarget']['authenticator'];
     $authenticator_signatureCode = $authenticator['signatureCode']['code'];
     $authenticator_id = $authenticator['assignedEntity']['id']['extension'];
     $authenticator_address = $authenticator['assignedEntity']['addr']['streetAddressLine'];
     $authenticator_city = $authenticator['assignedEntity']['addr']['city'];
     $authenticator_state = $authenticator['assignedEntity']['addr']['state'];
     $authenticator_postalCode = $authenticator['assignedEntity']['addr']['postalCode'];
     $authenticator_country = $authenticator['assignedEntity']['addr']['country'];
     $authenticator_phone = $authenticator['assignedEntity']['telecom']['value'];
     $authenticator_phone_use = $authenticator['assignedEntity']['telecom']['use'];
     $authenticator_name_given = $authenticator['assignedEntity']['assignedPerson']['name']['given'];
     $authenticator_name_family = $authenticator['assignedEntity']['assignedPerson']['name']['family'];
     $this->getCarecoordinationTable()->import($array, $document_id);
     $view = new ViewModel();
     $view->setTerminal(true);
     return $view;
 }
Exemple #7
0
 /**
  *
  * @param type $sString
  * @return array
  */
 public static function importEqdkp($sString)
 {
     $reader = new \Zend\Config\Reader\Xml();
     $data = $reader->fromString($sString);
     return $data;
 }