PHP code example of yudistira / satusehat-api

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

    

yudistira / satusehat-api example snippets


use Satusehat\Integration\FHIR\Patient;

$patient = new Patient();
$patient->addIdentifier('nik', '3174012345678901');
$patient->setName('Budi Setiawan');
$patient->setGender('male');
$patient->setBirthDate('1990-01-15');

$json = $patient->json();

use Satusehat\Integration\FHIR\Bundle;
use Satusehat\Integration\FHIR\Encounter;
use Satusehat\Integration\FHIR\Condition;

$encounter = new Encounter();
// ... isi data encounter

$diagnosis = new Condition();
// ... isi data diagnosis

$bundle = new Bundle();
$bundle->addEncounter($encounter);
$bundle->addCondition($diagnosis);

$response = $bundle->post();
bash
php artisan vendor:publish --provider="Satusehat\Integration\SatusehatIntegrationServiceProvider"
php artisan migrate