Wie ktoś może skąd mogę wyłowić informacje o oznaczeniu DN na receptach ?
Nieaktualne Miałem starą wersję status_cwu.xsd
$systemNFZnazwa = $xpath->query("//odp:system")->item(0)->getAttribute('nazwa'); $systemNFZwersja = $xpath->query("//odp:system")->item(0)->getAttribute('wersja');
function status ($potwierdzenie) { $doc = new DOMDocument(); $doc->loadXML($potwierdzenie); $xpath = new DOMXpath($doc); $xpath->registerNamespace('odp','https://ewus.nfz.gov.pl/ws/broker/ewus/status_cwu/v2'); $statusCWU = $xpath->query("//odp:status_cwu")->item(0)->nodeValue; $statusUbezpieczenia = $xpath->query("//odp:status_ubezp")->item(0)->nodeValue; $receptaDN = $xpath->query("//odp:status_ubezp")->item(0)->getAttribute('ozn_rec'); $zwrotnyPesel = $xpath->query("//odp:numer_pesel")->item(0)->nodeValue;; $pacjentImie = $xpath->query("//odp:imie")->item(0)->nodeValue;; $pacjentNazwisko = $xpath->query("//odp:nazwisko")->item(0)->nodeValue;; $systemNFZ = $xpath->query("//odp:system_nfz")->item(0)->nodeValue;; $swiadczeniodawca = $xpath->query("//odp:swiad")->item(0)->nodeValue;; $swiadczeniodawcaID = $xpath->query("//odp:id_swiad")->item(0)->nodeValue;; $nfzID = $xpath->query("//odp:id_ow")->item(0)->nodeValue;; $operatorID = $xpath->query("//odp:id_operatora")->item(0)->nodeValue;; $idOperacji = $xpath->query("//odp:status_cwu_odp")->item(0)->getAttribute('id_operacji'); $dataCzasOperacji = $xpath->query("//odp:status_cwu_odp")->item(0)->getAttribute('data_czas_operacji'); $dataWaznosciPotwierdzenia = $xpath->query("//odp:data_waznosci_potwierdzenia")->item(0)->nodeValue; $systemNFZnazwa = $xpath->query("//odp:system")->item(0)->getAttribute('nazwa'); $systemNFZwersja = $xpath->query("//odp:system")->item(0)->getAttribute('wersja'); }
<xs:element name="status_cwu_odp"> <xs:annotation> <xs:documentation>Komunikat z odpowiedzią dla świadczeniodawcy</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element name="status_cwu" type="xs:string"> <xs:annotation> <xs:documentation>Status pozycji w systemie CWU - jest/nie ma</xs:documentation> </xs:annotation> </xs:element> <xs:element name="numer_pesel" type="pesel"> <xs:annotation> <xs:documentation>Numer PESEL</xs:documentation> </xs:annotation> </xs:element>
<xs:element name="system_nfz" type="system"> <xs:annotation> <xs:documentation>Informacja o systemie udzielającym odpowiedzi po stronie NFZ </xs:documentation> </xs:annotation> </xs:element>
<xs:element name="swiad" type="swiadczeniodawca"> <xs:annotation> <xs:documentation>Identyfikacja operatora świadczeniodawcy wysyłającego zapytanie</xs:documentation> </xs:annotation> </xs:element> <xs:element name="pacjent" type="swiadczeniobiorca" minOccurs="0"> <xs:annotation> <xs:documentation>Wystepuje tylko dla pacjentów zarejestrowanych w CWU</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dsig:Signature" minOccurs="0"/> </xs:sequence> <xs:attribute name="id_operacji" use="required"> <xs:annotation> <xs:documentation>Unikalny identyfikator operacji sprawdzenia statusu ubezpieczenia</xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="8"/> <xs:maxLength value="20"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="data_czas_operacji" type="xs:dateTime" use="required"> <xs:annotation> <xs:documentation>Data i czas dokonana sprawdzenia w systemie NFZ</xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element>
$sygnatura = $xpath->query("//odp:Signature")->item(0)->nodeValue;;
$xpath->registerNamespace('ds', 'http://www.w3.org/2000/09/xmldsig#'); $SignatureValue = $xpath->query("//ds:SignatureValue")->item(0)->nodeValue;; $DigestValue = $xpath->query("//ds:DigestValue")->item(0)->nodeValue;;
$doc = new DOMDocument(); $doc->loadXML($responseXML); $match = $doc->getElementsByTagName('status_cwu_odp');// $foundXML = $doc->saveXML($match->item(0)); $xpath = new DOMXpath($doc); $xpath->registerNamespace('odp','https://ewus.nfz.gov.pl/ws/broker/ewus/status_cwu/v2'); $operId = $xpath->query("//odp:status_cwu_odp")->item(0)->getAttribute('id_operacji'); file_put_contents($operId . '.xml', $foundXML);
$doc = new DOMDocument(); $doc->loadXML($r); $match = $doc->getElementsByTagName('status_cwu_odp');// $foundXML = $doc->saveXML($match->item(0)); $xpath = new DOMXpath($doc); $xpath->registerNamespace('odp','https://ewus.nfz.gov.pl/ws/broker/ewus/status_cwu/v2'); $operId = $xpath->query("//odp:status_cwu_odp")->item(0)->getAttribute('id_operacji'); file_put_contents($folderPotwierdzen. $operId . '.xml', $foundXML);
try { $potwierdzenie = $clientBroker->__doRequest($xml, $path, 'executeService', SOAP_1_1); }
class EWUSException extends Exception { private $_type; }
/** * * @param string $response * @throws Exception * @throws EWUSException */ private function _parseResponse($response) { throw new Exception('Brak odpowiedzi na żądanie.'); $doc = new DOMDocument(); $doc->loadXML($response); $xpath = new DOMXpath($doc); $xpath->registerNamespace('env', 'http://schemas.xmlsoap.org/soap/envelope/'); $xpath->registerNamespace('com', 'http://xml.kamsoft.pl/ws/common'); $fault = $xpath->query('//env:Fault'); if ($fault->length===1) { $ee = new EWUSException(); $ks = $xpath->query('//com:*'); if ($ks->length>=1) $ee->setType($ks->item(0)->localName); throw $ee; } }
try { $r = $ec->checkCWU($pesel, EWUSClient::FLAG_STATUS | EWUSClient::FLAG_RESPONSE); } catch(EWUSException $ee) { switch($ee->getType()) { case 'authTokenError': case 'sessionError': $e->refreshSession(true); break; case 'inputError': break; default: break; } } catch(Exception $e) { }
$doc = new DOMDocument(); $doc->loadXML($r); $match = $doc->getElementsByTagName('status_cwu_odp');// $foundXML = $doc->saveXML($match->item(0)); file_put_contents($operId . '.xml', $foundXML);
<?php ), 'password' => 'qwerty!@#'); $clientAuth = new SoapClient('https://ewus.nfz.gov.pl/ws-broker-server-ewus-auth-test/services/Auth?wsdl', array( 'trace' => true, 'soap_version' => SOAP_1_2, "exceptions" => true, "cache_wsdl" => "WSDL_CACHE_NONE" )); $xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://xml.kamsoft.pl/ws/common" xmlns:brok="http://xml.kamsoft.pl/ws/broker"> <soapenv:Header> <com:session id="' . $loginHeaders['session']->id . '" xmlns:ns1="http://xml.kamsoft.pl/ws/common"/> <com:authToken id="' . $loginHeaders['authToken']->id . '" xmlns:ns1="http://xml.kamsoft.pl/ws/common"/> </soapenv:Header> <soapenv:Body> <brok:executeService> <com:location> <com:namespace>nfz.gov.pl/ws/broker/cwu</com:namespace> <com:localname>checkCWU</com:localname> <com:version>2.0</com:version> </com:location> <brok:date>2008-09-12T09:37:36.406+01:00</brok:date> <brok:payload> <brok:textload> <ewus:status_cwu_pyt xmlns:ewus="https://ewus.nfz.gov.pl/ws/broker/ewus/status_cwu/v2"> <ewus:numer_pesel>00000000000</ewus:numer_pesel> <ewus:system_swiad nazwa="eWUS" wersja="2012.07.1.0"/> </ewus:status_cwu_pyt> </brok:textload> </brok:payload> </brok:executeService> </soapenv:Body> </soapenv:Envelope>'; $clientBroker = new SoapClient('https://ewus.nfz.gov.pl/ws-broker-server-ewus-auth-test/services/ServiceBroker?wsdl', array('trace' => true, 'soap_version' => SOAP_1_2, "exceptions" => true, "cache_wsdl" => "WSDL_CACHE_NONE")); $r = $clientBroker->__doRequest($xml, 'https://ewus.nfz.gov.pl/ws-broker-server-ewus-auth-test/services/ServiceBroker', 'executeService', SOAP_1_2); ?>