| Crates.io | docaroo-rs |
| lib.rs | docaroo-rs |
| version | 0.0.1 |
| created_at | 2025-06-17 17:29:13.424962+00 |
| updated_at | 2025-06-17 17:29:13.424962+00 |
| description | A Rust SDK for the Docaroo Care Navigation Data API, providing healthcare provider pricing discovery and procedure likelihood analysis |
| homepage | https://github.com/nikothomas/docaroo-rs |
| repository | https://github.com/nikothomas/docaroo-rs |
| max_upload_size | |
| id | 1716071 |
| size | 119,857 |
A Rust SDK for the Docaroo Care Navigation Data API, providing healthcare provider pricing discovery and procedure likelihood analysis.
Add this to your Cargo.toml:
[dependencies]
docaroo-rs = "0.0.1"
use docaroo_rs::{DocarooClient, models::PricingRequest};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create client with your API key
let client = DocarooClient::new("your-api-key");
// Look up pricing for a provider
let request = PricingRequest::builder()
.npis(vec!["1043566623"])
.condition_code("99214")
.build();
let response = client.pricing().get_in_network_rates(request).await?;
// Process the response
for (npi, rates) in response.data {
println!("NPI {}: {} rates found", npi, rates.len());
for rate in rates {
println!(" Average rate: ${:.2}", rate.avg_rate);
}
}
Ok(())
}
Look up in-network contracted rates for healthcare providers:
use docaroo_rs::models::{PricingRequest, CodeType};
let request = PricingRequest::builder()
.npis(vec!["1043566623", "1972767655"]) // Can add multiple NPIs (up to 10)
.condition_code("99214")
.plan_id("942404110") // Optional, defaults to "942404110"
.code_type(CodeType::Cpt) // Optional, defaults to CPT
.build();
let response = client.pricing().get_in_network_rates(request).await?;
Evaluate the likelihood that providers perform specific procedures:
use docaroo_rs::models::LikelihoodRequest;
let request = LikelihoodRequest::builder()
.npis(vec!["1487648176"])
.condition_code("99214")
.code_type("CPT")
.build();
let response = client.procedures().get_likelihood(request).await?;
// Or use the convenience method
let response = client.procedures()
.check_providers(&["1487648176", "1234567890"], "99214", "CPT")
.await?;
use docaroo_rs::client::DocarooConfig;
let config = DocarooConfig::builder()
.api_key("your-api-key")
.base_url("https://custom-api-url.com") // Optional custom URL
.http_client(custom_client) // Optional custom reqwest client
.build();
let client = DocarooClient::with_config(config);
The examples use environment variables for API keys:
export DOCAROO_API_KEY="your-api-key"
cargo run --example pricing
The SDK provides comprehensive error handling:
use docaroo_rs::DocarooError;
match client.pricing().get_in_network_rates(request).await {
Ok(response) => {
// Handle success
}
Err(e) => {
match e {
DocarooError::RateLimitExceeded { retry_after } => {
println!("Rate limited. Retry after {} seconds", retry_after);
}
DocarooError::AuthenticationFailed(msg) => {
println!("Auth failed: {}", msg);
}
DocarooError::InvalidRequest(msg) => {
println!("Invalid request: {}", msg);
}
_ => {
println!("Error: {}", e);
}
}
// Check if error is retryable
if e.is_retryable() {
// Implement retry logic
}
// Get request ID for support
if let Some(request_id) = e.request_id() {
println!("Request ID: {}", request_id);
}
}
}
The SDK supports all medical billing code standards used by the API:
See the examples directory for detailed usage examples:
For detailed SDK documentation, run:
cargo doc --open
For the Docaroo API documentation and details about the API endpoints, visit the official Docaroo documentation.
This Rust client was developed by Nikolas Yanek-Chrones.
This project is licensed under the MIT License - see the LICENSE file for details.