Exemplo n.º 1
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 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;
 }
Exemplo n.º 3
0
 /**
  *
  * @param type $sString
  * @return array
  */
 public static function importEqdkp($sString)
 {
     $reader = new \Zend\Config\Reader\Xml();
     $data = $reader->fromString($sString);
     return $data;
 }