https://github.com/backworkai/verity-dotnet
C# .NET SDK for the Verity API - Medicare coverage policies and prior authorization
https://github.com/backworkai/verity-dotnet
Last synced: 28 days ago
JSON representation
C# .NET SDK for the Verity API - Medicare coverage policies and prior authorization
- Host: GitHub
- URL: https://github.com/backworkai/verity-dotnet
- Owner: backworkai
- Created: 2026-01-25T23:56:50.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2026-05-23T16:24:24.000Z (29 days ago)
- Last Synced: 2026-05-23T18:16:09.806Z (29 days ago)
- Language: C#
- Size: 27.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Verity .NET SDK
Official .NET client for the [Verity API](https://verity.backworkai.com): Medicare coverage policies, medical code intelligence, prior authorization checks, claim validation, compliance review, and drug formulary evidence.
The SDK targets .NET Standard 2.0 and is compatible with .NET Framework 4.6.1+, .NET Core 2.0+, and modern .NET releases.
## Installation
NuGet.org is not currently serving the public `Verity.SDK` package. Until NuGet indexing is resolved, install from the GitHub release asset:
```bash
mkdir -p ~/.nuget/verity
curl -L -o ~/.nuget/verity/Verity.SDK.1.0.2.nupkg \
https://github.com/backworkai/verity-dotnet/releases/download/v1.0.2/Verity.SDK.1.0.2.nupkg
curl -L -o ~/.nuget/verity/Verity.SDK.1.0.2.nupkg.sha256 \
https://github.com/backworkai/verity-dotnet/releases/download/v1.0.2/Verity.SDK.1.0.2.nupkg.sha256
(cd ~/.nuget/verity && shasum -a 256 -c Verity.SDK.1.0.2.nupkg.sha256)
dotnet add package Verity.SDK --version 1.0.2 --source ~/.nuget/verity
```
## Quick Start
```csharp
using Verity.SDK;
using var client = new VerityClient("vrt_live_YOUR_API_KEY");
var code = await client.LookupCodeAsync(
code: "76942",
include: new[] { "rvu", "policies" }
);
Console.WriteLine(code.Data?.Description);
var priorAuth = await client.CheckPriorAuthAsync(
procedureCodes: new[] { "76942" },
diagnosisCodes: new[] { "M54.5" },
state: "TX",
payer: "medicare"
);
Console.WriteLine(priorAuth.Data?.PaRequired);
```
Get an API key from the [Verity dashboard](https://verity.backworkai.com/dashboard).
## Core Workflows
### Code Lookup
```csharp
var result = await client.LookupCodeAsync(
code: "76942",
codeSystem: "CPT",
jurisdiction: "JM",
include: new[] { "rvu", "policies", "rates" },
fuzzy: true
);
```
### Policy Search and Retrieval
```csharp
var policies = await client.ListPoliciesAsync(
query: "ultrasound guidance",
mode: "keyword",
policyType: "LCD",
status: "active",
limit: 25
);
var policy = await client.GetPolicyAsync(
"L33831",
include: new[] { "criteria", "codes" }
);
```
### Prior Authorization and Claim Validation
```csharp
var priorAuth = await client.CheckPriorAuthAsync(
procedureCodes: new[] { "76942" },
diagnosisCodes: new[] { "M54.5" },
state: "TX",
payer: "medicare"
);
var claim = await client.ValidateClaimWithDateOfServiceAsync(
procedureCodes: new[] { "99213" },
diagnosisCodes: new[] { "E11.9" },
payer: "Medicare",
state: "TX",
dateOfService: "2026-05-23"
);
Console.WriteLine($"{claim.Data?.CoverageStatus} {claim.Data?.DenialRisk}");
Console.WriteLine(string.Join(", ", claim.Data?.Issues ?? new()));
```
### Coverage, Spending, and Compliance
```csharp
var criteria = await client.SearchCriteriaAsync(
query: "diabetes",
section: "indications",
limit: 10
);
Console.WriteLine($"{criteria.Data?.FirstOrDefault()?.PolicyId}: {criteria.Data?.FirstOrDefault()?.PolicyTitle}");
var spending = await client.GetSpendingByCodeAsync(
codes: new[] { "T1019", "T1020" },
year: 2023
);
var changes = await client.ListUnreviewedChangesAsync(limit: 10);
var stats = await client.GetComplianceStatsAsync();
```
### Drug Formulary Evidence
```csharp
var formulary = await client.SearchDrugFormularyEvidenceAsync(
query: "ozempic",
payer: "all",
limit: 5
);
```
## Error Handling
```csharp
using Verity.SDK;
try
{
var result = await client.LookupCodeAsync("76942");
}
catch (VerityException ex) when (ex.StatusCode == 401)
{
Console.WriteLine($"Invalid API key: {ex.Message}");
}
catch (VerityException ex) when (ex.StatusCode == 404)
{
Console.WriteLine($"Resource not found: {ex.Message}");
}
catch (VerityException ex) when (ex.StatusCode == 429)
{
Console.WriteLine($"Rate limit exceeded: {ex.Message}");
}
catch (VerityException ex)
{
Console.WriteLine($"Verity API error ({ex.Code}): {ex.Message}");
}
```
## Dependency Injection
```csharp
services.AddSingleton(_ =>
new VerityClient(configuration["Verity:ApiKey"]));
```
## Configuration and Disposal
```csharp
using var client = new VerityClient(
"vrt_live_YOUR_API_KEY",
"https://verity.backworkai.com/api/v1"
);
```
`VerityClient` implements `IDisposable`. Use a `using` statement or register it with your dependency injection container.
## Development
```bash
dotnet restore
dotnet build src/Verity.SDK/Verity.SDK.csproj
dotnet pack src/Verity.SDK/Verity.SDK.csproj --configuration Release --output artifacts
```
## Release
The SDK publishes to NuGet.org as `Verity.SDK` using NuGet Trusted Publishing.
1. Configure a NuGet trusted publishing policy for `backworkai/verity-dotnet`, workflow `release.yml`, environment `nuget`.
2. Save the NuGet profile username as the repository secret `NUGET_USER`.
3. Update `src/Verity.SDK/Verity.SDK.csproj` to the new package version.
4. Push a matching tag, for example `v1.0.0`.
5. The release workflow restores, builds, packs, exchanges GitHub OIDC for a short-lived NuGet API key, and pushes the `.nupkg` to NuGet.
## Support
- Documentation: https://verity.backworkai.com/docs
- Issues: https://github.com/backworkai/verity-dotnet/issues
- Email: support@verity.backworkai.com
## License
MIT