Connect and Authenticate


In [ ]:
import pokitdok

In [ ]:
pd = pokitdok.api.connect('[your client id]', '[your client secret]')

or


In [ ]:
import os
client_id = os.environ['POKITDOK_CLIENT_ID']
client_secret = os.environ['POKITDOK_CLIENT_SECRET']
pd = pokitdok.api.connect(client_id, client_secret)

Making API Requests


In [ ]:
# a low level "request" method is available that allows you to have more control over the construction of the API request
pd.request('/activities', method='get')

In [ ]:
pd.request('/eligibility/', method='post', data={
    "member": {
        "birth_date": "1970-01-01",
        "first_name": "Jane",
        "last_name": "Doe",
        "id": "W000000000"
    },
    "trading_partner_id": "MOCKPAYER"
})

In [ ]:
# Convenience methods are available for the commonly used http methods built around the request method
pd.get('/activities')

In [ ]:
pd.post('/eligibility/', data={
    "member": {
        "birth_date": "1970-01-01",
        "first_name": "Jane",
        "last_name": "Doe",
        "id": "W000000000"
    },
    "trading_partner_id": "MOCKPAYER"
})

In [ ]:
# higher level functions are also available to access the APIs
pd.activities()

In [ ]:
pd.eligibility({
    "member": {
        "birth_date": "1970-01-01",
        "first_name": "Jane",
        "last_name": "Doe",
        "id": "W000000000"
    },
    "trading_partner_id": "MOCKPAYER"
})

Data APIs

Claims Convert


In [ ]:
#convert existing claims in a X12 837 file to claims request JSON.  ICD-9 codes are converted to ICD-10
pd.claims_convert('/path/to/my_claims.837')

Insurance Prices


In [ ]:
#retrieve insurance price information by zip and CPT code
pd.insurance_prices(zip_code='32218', cpt_code='87799')

Medical Procedure Code (MPC)


In [ ]:
pd.mpc(code='99213')

X12 APIs

Eligibility


In [ ]:
pd.eligibility({
    "member": {
        "birth_date": "1970-01-01",
        "first_name": "Jane",
        "last_name": "Doe",
        "id": "W000000000"
    },
    "trading_partner_id": "MOCKPAYER"
})

In [ ]:
pd.eligibility({
    "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"
})

Claims


In [ ]:
pd.claims({
    "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"
            }
        ]
    }
})

Claims Status


In [ ]:
#Check the status of a claim
pd.claims_status({
    "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"
})

Utility APIs

Activities


In [ ]:
#Check on platform activities
#check on a specific activity
pd.activities(activity_id='[one of your activity ids]')

In [ ]:
#retrieve an index of your application's activities
pd.activities()

In [ ]:
#check on a batch of activities (useful to track the results of APIs like X12 files, Claims Convert, etc.)
pd.activities(parent_id='[one of your parent activity ids]')

Trading Partners


In [ ]:
#retrieve a specific trading_partner
pd.trading_partners("MOCKPAYER")