PHP code example of nextgen-tech / ewus

1. Go to this page and download the library: Download nextgen-tech/ewus library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nextgen-tech / ewus example snippets


// Create once handler instance
$handler = new Handler(new HttpConnection());

// (Optional) Enable sandbox mode for testing
$handler->enableSandboxMode();

// Login
$request = new LoginRequest('15', 'TEST1', 'qwerty!@#');
$login = $handler->handle($request);

// Check patient status
$request = new CheckRequest($login->getSessionId(), $login->getToken(), '12345678901');
$check = $handler->handle($request);

// Change password
$request = new ChangePasswordRequest($login->getSessionId(), $login->getToken(), '15', 'TEST1', 'qwerty!@#', 'asdfgh#@!');
$changePassword = $handler->handle($request);

// Logout
$request = new LogoutRequest($login->getSessionId(), $login->getToken());
$logout = $handler->handle($request);