Giter VIP home page Giter VIP logo

erecept's Introduction

Instalace

> 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

  1. nahrát ssl certifikát do složky erecept/cert
  2. nahrát privátní klíč a osobní certifikát do složky erecept/cert
  3. zkopírovat erecept/tests/erecept.neon.example do erecept/tests/erecept.neon
  4. 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

erecept's People

Contributors

pesektomas avatar thiscodeworks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.