Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

Build Status Dependency Freshness

pokitdok-java

PokitDok Platform API Client for Java

Resources

Installation

Via Maven

pokitdok-java is pushed to Maven Central via the Sonatype OSS repository.

  • Group ID: com.pokitdok
  • Artifact ID: pokitdok-java
  • Latest Version: 0.9

So, for example, in Gradle, you could add the dependency

compile "com.pokitdok:pokitdok-java:0.9"

Manual Install

You can download pokitdok-java-0.9.jar from here and include it on your classpath, like any other JAR. A few other JAR requirements need to be on your classpath as well. They are:

Quick Start

Copy the following Java code into PokitDokTest.java and save in the pokitdok-java folder.

import com.pokitdok.PokitDok;
import com.pokitdok.UnauthorizedException;
import java.util.HashMap;
import java.util.Map;
import java.io.IOException;
import org.json.simple.parser.ParseException;
import org.json.simple.JSONValue;

public class PokitDokTest {
    public static void main(String args[]) {
    
        String npi = "1912301953";
        if (args.length > 0) {
            npi = args[0];
        }
        
        try {
            PokitDok pd = new PokitDok("your_client_id", "your_client_secret");
            
            /* Retrieve provider information by NPI */
            Map npiQuery = new HashMap<String, String>();
            npiQuery.put("npi", npi);
            Map results = pd.providers(npiQuery);
            System.out.println(results.toString());
        }
        catch(IOException e) {
            System.out.println(e.getMessage());
        }
        catch(ParseException e) {
            System.out.println(e.getMessage());
        }
        catch(UnauthorizedException e) {
            System.out.println(e.getMessage());
        }
    }
}

Compile with:

 javac -sourcepath src/main/java -cp "lib/pokitdok-java-0.9.jar:lib/json-simple-1.1.1.jar:lib/httpcore-4.4.4.jar:lib/httpclient-4.5.2.jar:lib/hamcrest-core-1.1.jar:lib/commons-logging-1.2.jar:lib/commons-codec-1.9.jar" PokitDokTest.java

Run with:

java -cp ".:lib/pokitdok-java-0.9.jar:lib/json-simple-1.1.1.jar:lib/httpcore-4.4.4.jar:lib/httpclient-4.5.2.jar:lib/hamcrest-core-1.1.jar:lib/commons-logging-1.2.jar:lib/commons-codec-1.9.jar" PokitDokTest 1912301953

Providers

/* Search providers by name (individuals) */
Map nameQuery = new HashMap<String, String>();
nameQuery.put("first_name", "JEROME");
nameQuery.put("last_name", "AYA-AY");
pd.providers(nameQuery);

/* Search providers by name (organizations) */
Map orgQuery = new HashMap<String, String>();
orgQuery.put("name", "Qliance");
pd.providers(orgQuery);

/* Search providers by location and/or specialty */
Map providerQuery = new HashMap<String, String>();
providerQuery.put("zipcode", "29307");
providerQuery.put("radius", "10mi");
providerQuery.put("specialty", "RHEUMATOLOGY");
pd.providers(providerQuery);

Eligibility

/*
  Eligibility endpoint example. This example uses the SimpleJSON library
  to parse a string called "eligibility", containing JSON, into a Map,
  which is then passed into the Eligibility endpoint. You can create this
  Map in any way you prefer - loading it from a JSON string is done for
  succintness of discussion. The contents of the string are as follows:

  {
    "member": {
        "birth_date": "1970-01-01",
        "first_name": "Jane",
        "last_name": "Doe",
        "id": "W000000000"
    },
    "provider": {
        "first_name": "JEROME",
        "last_name": "AYA-AY",
        "npi": "1467560003"
    },
    "service_types": ["health_benefit_plan_coverage"],
    "trading_partner_id": "MOCKPAYER"
  }
*/

Map eligibilityQuery = JSONValue.parse(eligibility);
pd.eligibility(eligibilityQuery);

Claims

/*
  Claim endpoint example. This example parses a JSON string similarly to the
  above Eligibility example. The JSON is as follows:

  {
    "transaction_code": "chargeable",
    "trading_partner_id": "MOCKPAYER",
    "billing_provider": {
      "taxonomy_code": "207Q00000X",
      "first_name": "Jerome",
      "last_name": "Aya-Ay",
      "npi": "1467560003",
      "address": {
        "address_lines": ["8311 WARREN H ABERNATHY HWY"],
        "city": "SPARTANBURG",
        "state": "SC",
        "zipcode": "29301"
      },
      "tax_id": "123456789"
    },
    "subscriber": {
      "first_name": "Jane",
      "last_name": "Doe",
      "member_id": "W000000000",
      "address": {
        "address_lines": ["123 N MAIN ST"],
        "city": "SPARTANBURG",
        "state": "SC",
        "zipcode": "29301"
      },
      "birth_date": "1970-01-01",
      "gender": "female"
    },
    "claim": {
      "total_charge_amount": 60.0,
      "service_lines": [
        {
          "procedure_code": "99213",
          "charge_amount": 60.0,
          "unit_count": 1.0,
          "diagnosis_codes": ["487.1"],
          "service_date": "2014-06-01"
        }
      ]
    }
  }
*/

Map claimJSON = JSONValue.parse(claim);
pd.claim(claimJSON);

Claim Status

/*
  Check the status of a Claim. The JSON looks like this:

  {
      "patient": {
          "birth_date": "1970-01-01",
          "first_name": "JANE",
          "last_name": "DOE",
          "id": "1234567890"
      },
      "provider": {
          "first_name": "Jerome",
          "last_name": "Aya-Ay",
          "npi": "1467560003",
      },
      "service_date": "2014-01-01",
      "trading_partner_id": "MOCKPAYER"
  }
*/

Map claimStatusQuery = JSONValue.parse(claimStatus);
pd.claimStatus(claimStatusQuery);

Activities

/* Retrieve an index of activities */
pd.activities();

/* Check on a specific activity */
Map activityQuery = new HashMap<String, String>();
activityQuery.put("activity_id", "5362b5a064da150ef6f2526c");
pd.activities(activityQuery);

/* Check on a batch of activities */
Map batchQuery = new HashMap<String, String>();
batchQuery.put("parent_id", "537cd4b240b35755f5128d5c");
pd.activities(batchQuery);

Cash and Insurance Prices

/* Get cash prices */
Map cashQuery = new HashMap<String, String>();
cashQuery.put("cpt_code", "87799");
cashQuery.put("zip_code", "75201");
pd.cashPrices(cashQuery);

/* Get insurance prices */
Map insuranceQuery = new HashMap<String, String>();
cashQuery.put("cpt_code", "87799");
cashQuery.put("zip_code", "29403");
pd.insurancePrices(insuranceQuery);

Supported Java versions

This library aims to support and is tested against these Java versions.

  • Oracle: Java SE 8, Java SE 7
  • OpenJDK: OpenJDK 7

License

Copyright (c) 2014-2016 PokitDok Inc. See LICENSE for details.

About

PokitDok Platform API Client for Java

Resources

License

Packages

No packages published

Languages