PHP code example of chrisreedio / laravel-mdstaff-sdk

1. Go to this page and download the library: Download chrisreedio/laravel-mdstaff-sdk 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/ */

    

chrisreedio / laravel-mdstaff-sdk example snippets


use ChrisReedIO\MDStaff\Enums\QuerySource;
use ChrisReedIO\MDStaff\Facades\MDStaff;
use ChrisReedIO\MDStaff\Queries\ProviderQueries;

// Name search: matches "Jane Doe" and "Doe, Jane"
$matches = MDStaff::providers()->search('Jane Doe');

// A single Demographic record, using the preset Demographic fields
$provider = MDStaff::providers()->findByNpi('1234567890');
$provider = MDStaff::providers()->find($providerId);

// Every record of one source, paged lazily at 2,000 records per request
MDStaff::providers()->records(QuerySource::Address)->each(function (array $address) {
    // ...
});

// One provider's records, or only records changed within a date range
MDStaff::providers()->records(QuerySource::BoardCertification, providerId: $providerId);
MDStaff::providers()->records(
    QuerySource::Demographic,
    filter: ProviderQueries::lastUpdatedBetween(now()->subDay(), now()),
);

// The latest in-use JPEG/PNG headshot, or null
$image = MDStaff::providers()->image($providerId);

if ($image !== null) {
    Storage::put("providers/{$image->safeUid()}.{$image->extension()}", $image->contents);
}

use ChrisReedIO\MDStaff\Enums\LookUpType;

MDStaff::lookUps()->list(LookUpType::Specialty)->all();
MDStaff::facilities()->list();

use ChrisReedIO\MDStaff\Enums\QuerySource;
use ChrisReedIO\MDStaff\MDStaffConnector;
use ChrisReedIO\MDStaff\Requests\QueryRequest;

$records = MDStaffConnector::forFacility($facilityUid)
    ->paginate(new QueryRequest(
        source: QuerySource::ReferenceSource,
        fields: ['ReferenceSourceID', 'Name', 'City', 'State'],
        filter: ['ReferenceType' => ['Medical Education']],
    ))
    ->setPerPageLimit(2000)
    ->collect();

use ChrisReedIO\MDStaff\Support\RequestBudget;

app(RequestBudget::class)->reserve();
bash
php artisan vendor:publish --tag="mdstaff-sdk-config"
bash
php artisan mdstaff:test