PHP code example of napopravku / rta-api-service-client

1. Go to this page and download the library: Download napopravku/rta-api-service-client 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/ */

    

napopravku / rta-api-service-client example snippets



//index.php
use Napopravku\RtaApiClient\RemoteRtaApiClient;


/** @var ClinicListUpdateDTO $clinicListUpdateDto */
$clinicListUpdateDto = ClinicListUpdateFactory::fromArray([
    'clinics' => [
        [
            'mis_clinic_id' => 'a',
            'name'          => 'Клиника A',
            'comment'       => 'Клиника A',
        ],
        [
            'mis_clinic_id' => 'b',
            'name'          => 'Клиника B',
            'comment'       => 'Клиника B',
        ],
        [
            'mis_clinic_id' => 'c',
            'name'          => 'Клиника C',
            'comment'       => 'Клиника C',
        ],
    ],
]);

$result = $client->updateClinics($clinicListUpdateDto);

/** @var ClinicListDTO $clinicListDto */
$clinicListDto = ClinicListFactory::fromArray([
    'with_doctors' => false,
]);

$clinicListDto->paging->perPage = PagingDTO::MAX_PER_PAGE;

$clinicListDto->sorting->sortBy = 'mis_clinic_id';
$clinicListDto->sorting->sortDir = SortingDTO::SORT_DIR_DESC;

$result = $client->getClinics($clinicListDto);
sh
#Подключение к контейнеру
docker compose exec php bash