病毒php/bridging-bpjs

服务桥接Bpjs

v2.1.5 2024-09-05 04:50 UTC

README

Service-bridging是一个包,旨在简化PHP框架用户生成签名或令牌以访问BPJS服务的操作,无论是当前版本还是即将推出的版本2,希望这个包能帮助大家在健康服务BPJS的开发中取得进展。

功能

  • 自定义URL
  • 生成签名
  • 生成BPJS时间戳
  • 生成keyString
  • 解密字符串
  • 使用(Lz-String)解压缩

安装

Composer

composer require virusphp/bridging-bpjs

发布配置

php artisan vendor:publish --provider="Vclaim\Bridging\BridgingBpjsServiceProvider" --tag=config

使用方法

#Confirasi .env BPJS
CONS_ID=xxxxx
SECRET_KEY=xxxX

#Config untuk Vclaim BPJS
API_BPJS_VCLAIM=https://apijkn-dev.bpjs-kesehatan.go.id/vclaim-rest-dev/
USER_KEY_VCLAIM=xxxx

#Config untuk Icare BPJS
API_BPJS_ICARE=https://apijkn-dev.bpjs-kesehatan.go.id/ihs_dev/

#Config untuk Antrol BPJS
API_BPJS_ANTROL=https://apijkn-dev.bpjs-kesehatan.go.id/antreanrs_dev/
USER_KEY_ANTROL=xxxx

#Config untuk Aplicares BPJS
API_BPJS_APLICARE=https://new-api.bpjs-kesehatan.go.id/aplicaresws/rest/


##Configurasi .env untuk sirs kemkes
USER_SIRS=xxxx
PASS_SIRS=xxxx
API_KEMKES=http://sirs.kemkes.go.id/fo/index.php/
<?php
// configurasi config (Support laravel 7 ke atas)
config/vclaim.php
return [
	'api' => [
		'endpoint'  => env('API_BPJS','ENDPOINT-KAMU'),
		'consid'  => env('CONS_ID','CONSID-KAMU'),
		'seckey' => env('SECRET_KEY', 'SECRET-KAMU'),
		'user_key' => env('USER_KEY', 'SECRET-KAMU'),
	]
]
<?php
// Example Controller bridging to Vclaim BPJS  (Laravel 7 ke atas)
use Bpjs\Bridging\Vclaim\BridgeVclaim;

Class SomeController
{
	protected $bridging;

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

	// Example To use get Referensi diagnosa
	// Name of Method example
	public function getDiagnosa($kode)
	{
		$endpoint = 'referensi/diagnosa/'. $kode;
		return $this->bridging->getRequest($endpoint);
	}
}
<?php
// Example Controller bridging to Icare BPJS  (Laravel 7 ke atas)
use Bpjs\Bridging\Icare\BridgeIcare;
use Illuminate\Http\Request;

Class SomeController
{
	protected $bridging;

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

	// Example To use get History
	// Name of Method example
	public function getHistory(Request $reqeust)
	{
		$data = $this->handleRequest($reqeust);
		$endpoint = 'api/rs/validate';
		return $this->bridging->postRequest($endpoint, $data);
	}

	protected function handleRequest($request)
	{
		$data['param'] = $request->nomor_kartu;
		$data['kodedokter'] = $request->kode_dokter;
		return json_encode($data);
	}
}
<?php
// Example Controller bridging to Aplicare BPJS  (Laravel 7 ke atas)
use Bpjs\Bridging\Icare\BridgeAPlicares;
use Illuminate\Http\Request;

Class SomeController
{
	protected $bridging;

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

	// Example To use get Referensi Kelas
	// Name of Method example
	public function getReferensiKelas()
	{
		$endpoint = 'ref/kelas';
		return $this->bridging->getRequest($endpoint);
	}
}
<?php
// Example Controller bridging to SIRS Kemkes  (Laravel 7 ke atas)
use Kemkes\Bridging\Sirs\BridgeSirs;

Class SomeController
{
   	protected $bridging;

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

	// Example To use get list Tempat tidur
	// Name of Method example
	 public function getTempatTidur()
    {
        $url = 'Fasyankes';
        $tempattidur = $this->bridging->getRequest($url);
        return $tempattidur;
    }
}

CHANEL YOUTUBE

点击观看以支持(点赞和评论)

Watch the video

联系

  • 082220801333

变更日志

2024-08-02

  • v2.1.4 添加新的桥接Sirs更新功能