PHP code example of virusphp / bridging-satusehat

1. Go to this page and download the library: Download virusphp/bridging-satusehat 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/ */

    

virusphp / bridging-satusehat example snippets



// configurasi config (Support laravel 7 ke atas)
config/satusehat.php
return [
	'api' => [
		'endpoint_auth'  => env('API_SATUSEHAT_AUTH','ENDPOINT-KAMU'),
		'endpoint_base'  => env('API_SATUSEHAT_BASE','ENDPOINT-KAMU'),
		'endpoint_consent'  => env('API_SATUSEHAT_CONSENT','ENDPOINT-KAMU'),
		'client_id' => env('CLIENT_ID_SATUSEHAT', 'SECRET-KAMU'),
		'client_secret' => env('CLIENT_SECRET_SATUSEHAT', 'SECRET-KAMU'),
	]
]



// Example Controller bridging to SATUSEHAT  (Laravel 7 ke atas)
use Virusphp\BridgingSatusehat\Bridge\BridgeBase;

Class SomeController
{
	protected $bridging;

	public function __construct()
	{
		$this->bridging = new BridgeBase();
	}

	// Example To use get Patient
	// Name of Method example
	public function getPatient($nik)
	{
		$endpoint = 'Practitioner?identifier=https://fhir.kemkes.go.id/id/nik|'. $nik;
		return $this->bridging->getRequest($endpoint);
	}
}
cmd
php artisan vendor:publish --provider="Virusphp\BridgingSatusehat\SatusehatServiceProvider" --tag=config