pesovo / erecept
Client for SUKL eRecept portal in Czech Republic
dev-master / 1.x-dev
2017-11-21 14:56 UTC
Requires
- php: ^7.1
- ext-openssl: *
- ext-soap: *
- consistence/consistence: ^1.0.0
- ramsey/uuid: ^3.5
- robrichards/xmlseclibs: ^2.0
Requires (Dev)
- composer/ca-bundle: ^1.0
- consistence/coding-standard: ^2.0.0
- guzzlehttp/guzzle: ^6.2
- jakub-onderka/php-parallel-lint: ^0.9.2
- phing/phing: ^2.16
- phpstan/phpstan: ^0.7.0
- phpunit/phpunit: ^6.2.0
- slevomat/coding-standard: ^3.0
Suggests
- guzzlehttp/guzzle: For usage of bundled GuzzleSoapClientDriver
This package is not auto-updated.
Last update: 2025-03-30 07:00:33 UTC
README
> composer require pesovo/erecept
Použití
$configuration = new Configuration( Environment::get(Environment::CUER_DOCTOR), EreceptVersion::get(EreceptVersion::V_201704A), '1234567890', 'cesta k ssl certifikatu', 'heslo k ssl certifikatu' ); $userPersonalData = new UserPersonalData( 'cesta k privatnimu klici', 'heslo k privatnimu klici', 'cesta k uzivatelskemu certfikatu', 'SUKL uzivatelske uid', 'SUKL uzivatelske heslo' ); $client = new Client( $configuration, new GuzzleSoapClientDriver( new \GuzzleHttp\Client( [ \GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getBundledCaBundlePath(), \GuzzleHttp\RequestOptions::CERT => [$configuration->getHttpsCertificate() , $configuration->getHttpsCertificatePassword()], ] ), 'BASIC ' . \base64_encode(\sprintf('%s:%s', $userPersonalData->getUserUid(), $userPersonalData->getUserPassword())) ), new CryptographyService($userPersonalData), true ); $appPingZep = new AppPingZEP( new Message( $configuration->getVersion(), new \DateTimeImmutable('now', new \DateTimeZone('Europe/Prague')), '0123456789AB' ) ); try { $response = $client->send(new AppPingZepRequest($appPingZep)); print_r($response); } catch (\Throwable $th) { echo 'error ' . $th->getMessage() . PHP_EOL; }
První nastavení pro testy
- nahrát ssl certifikát do složky erecept/cert
- nahrát privátní klíč a osobní certifikát do složky erecept/cert
- zkopírovat erecept/tests/erecept.neon.example do erecept/tests/erecept.neon
- nastavit proměnné v erecept/tests/erecept.neon
Spustit docker a testy
> cd /erecept
> docker-compose up -d
> docker exec -it php7.1_erecet bash
> cd /srv
> php vendor/bin/phing
Konverze certifikátů
Sukl pošle soubor pfx, pro PHP ho musíme překonvertovat na PEM. Příkaz je následovný:
> openssl pkcs12 -in cuer_lekar.pfx -out cuer_lekar.pem -clcerts
Přehled metod a jejich implementace
Metoda | Určení | Implementace |
---|---|---|
AppPing | Všichni | ANO |
AppPingZEP | Všichni | ANO |
NacistCiselnikChyb | Všichni | ANO |
NacistVerze | Všichni | ANO |
ZalozitPredpis | Lékař | ANO |
ZmenitPredpis | Lékař | ANO |
ZrusitPredpis | Lékař | ANO |
NacistInformaceOZrusenemPredpisu | Lékař | NE |
NacistPredpis | Všichni | NE |
StahnoutPruvodku | Všichni | NE |
ZalozitVydej | Lékárník | NE |
ZmenitVydej | Lékárník | NE |
ZrusitVydej | Lékárník | NE |
NacistInformaceOZrusenemVydeji | Všichni | NE |
NacistVydej | Všichni | NE |
ZmenitStavPredpisu | Lékárník | NE |
DigitalizovatPredpis | Lékárník | NE |
ZmenitPojistovnuPredpisu | Lékárník | NE |
SeznamPredpisu | Lékař | NE |
SeznamVydejuPredepisujiciho | Lékař | NE |
PripravitVydejePredepisujiciho | Lékař | NE |
StahnoutVydejePredepisujiciho | Lékař | NE |
PrevzitVydejePredepisujiciho | Lékař | NE |
OveritPredpis | Lékař | NE |
OveritVydej | Lékárník | NE |
ZalozitVydejOTC | Lékárník | NE |
ZmenitVydejOTC | Lékárník | NE |
ZrusitVydejOTC | Lékárník | NE |
NacistVydejOTC | Lékárník | NE |
NacistInformaceOZrusenemVydejiOTC | Lékárník | NE |