1. Go to this page and download the library: Download nextvisit/claim-md-php 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/ */
nextvisit / claim-md-php example snippets
use Nextvisit\ClaimMDWrapper\Client;
use Nextvisit\ClaimMDWrapper\Config;
$accountKey = 'your-account-key'; // Never hardcode your keys!
$config = new Config();
$client = new Client($accountKey, $config);
use Nextvisit\ClaimMDWrapper\Requests\ERARequest;
use Nextvisit\ClaimMDWrapper\DTO\ERADTO;
$eraRequest = new ERARequest($client);
// optionally pass an array or ERADTO with at least the ERA ID to get remits since then.
$eraDto = new ERADTO(eraId: 'era-id');
$recentResponse = $eraRequest->getList($eraDto);
$allResponse = $eraRequest->getList();
use Nextvisit\ClaimMDWrapper\Requests\ERARequest;
$eraRequest = new ERARequest($client);
$response = $eraRequest->get835('era-id');
use Nextvisit\ClaimMDWrapper\Requests\ERARequest;
$eraRequest = new ERARequest($client);
// optional PCN can be used after the era-id.
$pcnResponse = $eraRequest->getPDF('era-id', 'pcn');
$regularResponse = $eraRequest->getPDF('era-id');
use Nextvisit\ClaimMDWrapper\Requests\ERARequest;
$eraRequest = new ERARequest($client);
$response = $eraRequest->getJson('era-id');
use Nextvisit\ClaimMDWrapper\Requests\FileRequest;
$fileRequest = new FileRequest($client);
$response = $fileRequest->upload(fopen('path/to/your/file.txt', 'r'));
print_r($response);
use Nextvisit\ClaimMDWrapper\Requests\FileRequest;
$fileRequest = new FileRequest($client);
$response = $fileRequest->getUploadList();
use Nextvisit\ClaimMDWrapper\Requests\ProviderRequest;
use Nextvisit\ClaimMDWrapper\DTO\ProviderEnrollmentDTO;
// If this provider is already enrolled, the response will contain that information.
$providerEnrollment = new ProviderEnrollmentDTO(
payerId: 'payer-id',
enrollType: 'era',
provTaxId: 'provider-tax-id',
provNpi: 'provider-npi',
provNameLast: 'Doe',
provNameFirst: 'John',
contactEmail: '[email protected]'
);
$providerRequest = new ProviderRequest($client);
$response = $providerRequest->enroll($providerEnrollment);
use Nextvisit\ClaimMDWrapper\DTO\ClaimAppealDTO;
use Nextvisit\ClaimMDWrapper\Requests\ClaimRequest;
$appealDto = new ClaimAppealDTO(
claimId: 'claim-id',
remoteClaimId: 'remote-claim-id',
contactName: 'Jane Doe',
contactEmail: '[email protected]',
contactPhone: '+1234567890'
);
$claimRequest = new ClaimRequest($client);
$response = $claimRequest->appeal($appealDto);
use Nextvisit\ClaimMDWrapper\Requests\ClaimRequest;
$claimRequest = new ClaimRequest($client);
$response = $claimRequest->archive('claim-id');
use Nextvisit\ClaimMDWrapper\Requests\ClaimRequest;
$claimRequest = new ClaimRequest($client);
$modId = 'mod-id'; // List modifications that have occurred after modId by specifying.
$claimMdId = 'claimmd-id'; // Get responses for a specific claim.
$field = 'some-field'; // Specify changes to a particular field.
$specifiedResponse = $claimRequest->listModifications($modId, $claimMdId, $field);
// list all modifications to all claims
$allResponse = $claimRequest->listModifications();
use Nextvisit\ClaimMDWrapper\Requests\ClaimRequest;
$claimRequest = new ClaimRequest($client);
// specify notesId to get notes since that note.
$noteId = 'note-id';
// specify claimId to get notes on just that claim.
$claimId = 'claim-id';
$specifiedResponse = $claimRequest->notes($noteId, $claimId);
// list all notes on all claims
$allResponse = $claimRequest->notes();
use Nextvisit\ClaimMDWrapper\Requests\ResponseRequest;
$responseRequest = new ResponseRequest($client);
// Get responses since responseId
$responseId = 'response-id';
$recentResponse = $responseRequest->fetchResponses($responseId);
use Nextvisit\ClaimMDWrapper\Requests\ResponseRequest;
$responseRequest = new ResponseRequest($client);
// optionally pass the claimmd-id to get responses for that id
// Note per the ClaimMD API "Do not use this option for periodic status updates".
foreach ($responseRequest->fetchAllResponses() as $response) {
// do something with the response
print_r($response);
}
use Nextvisit\ClaimMDWrapper\Requests\EligibilityRequest;
$eligibilityRequest = new EligibilityRequest($client);
$eligibility270 = fopen('path/to/your/file.270', 'r');
// the response will contain a 270 file
$realtimeResponse = $eligibilityRequest->checkEligibility270271($eligibility270);
use Nextvisit\ClaimMDWrapper\Requests\EligibilityRequest;
use Nextvisit\ClaimMDWrapper\DTO\EligibilityDTO;
$eligibilityRequest = new EligibilityRequest($client);
// build an EligibilityDTO or pass an existing array
$eligDto = new EligibilityDTO(
insLastName: 'Doe',
insFirstName: 'Jane',
payerId: 'payer-id',
// 18 or G8 are the only valid codes
patientRelationship: '18',
serviceDate: '20220203',
providerNpi: 'provider-npi',
providerTaxId: 'provider-tax-id'
);
// response will be in the response array
$response = $eligibilityRequest->checkEligibilityJSON($eligDto);
use Nextvisit\ClaimMDWrapper\Requests\PayerRequest;
$payerRequest = new PayerRequest($client);
// specify a specific payer
$payerId = 'payer-id';
$specifiedPayerResponse = $payerRequest->listPayer(payerId: $payerId);
// specify a general payer name search
$payerName = 'payer-name';
$searchResponse = $payerRequest->listPayer($payerName: $payerName);
// get all payers
$allResponse = $payerRequest->listPayer();