pokitdok-nodejs
PokitDok Platform API Client for NodeJS
Resources
- Read the PokitDok API docs
- View the pokitdok-nodejs API Reference
- View Source on GitHub
- Report Issues on GitHub
Installation
npm install pokitdok-nodejs
Supported NodeJS versions
This library aims to support and is tested against these NodeJS versions, using travis-ci:
- 0.8.x
- 0.9.x
- 0.10.x
API Reference
class: PokitDok
Members
- class: PokitDok
- new PokitDok(clientId, clientSecret, version)
- pokitDok.apiRequest(options, callback)
- pokitDok.activities(options, callback)
- pokitDok.authorizations(options, callback)
- pokitDok.cashPrices(options, callback)
- pokitDok.claims(options, callback)
- pokitDok.claimStatus(options, callback)
- pokitDok.eligibility(options, callback)
- pokitDok.enrollment(options, callback)
- pokitDok.icdConvert(options, callback)
- pokitDok.insurancePrices(options, callback)
- pokitDok.medicalProcedureCodes(options, callback)
pokitDok.payers(callback)- pokitDok.plans(options, callback)
- pokitDok.providers(options, callback)
- pokitDok.referrals(options, callback)
- pokitDok.schedulers(options, callback)
- pokitDok.appointmentTypes(options, callback)
- pokitDok.appointments(options, callback)
- pokitDok.updateAppointment(options, callback)
- pokitDok.deleteAppointment(options, callback)
- pokitDok.addPatientToSystem(options, callback)
- pokitDok.createAppointmentSlot(options, callback)
- pokitDok.deleteAppointmentSlot(options, callback)
- pokitDok.getIdentity(options, callback)
- pokitDok.updateIdentity(options, callback)
- pokitDok.createIdentity(options, callback)
- pokitDok.tradingPartners(options, callback)
new PokitDok(clientId, clientSecret, version)
Create a connection to the pokitdok API. The version defaults to v4. You must enter your client ID and client secret or all requests made with your connection will return errors.
Params
- clientId
string
- The client id of your PokitDok App - clientSecret
string
- The client secret of your PokitDok App - version
string
- the version of the API the connection should use
Example
// get a connection to the PokitDok Platform for the most recent versionvar PokitDok = ;var pokitdok = processenvPOKITDOK_CLIENT_ID processenvPOKITDOK_CLIENT_SECRET;
Example
// get a connection to the PokitDok Platform for version 3var PokitDok = ;var pokitdokV3 = processenvPOKITDOK_CLIENT_ID processenvPOKITDOK_CLIENT_SECRET 'v3';
pokitDok.apiRequest(options, callback)
A generic API request that is used by all specific endpoints functions like pokitdok.activities(...)
and
pokitdok.CashPrices(...)
.
Params
- options
object
- keys:path
,method
,qs
,json
. The path is the desired API endpoint, such as/activities
or/tradingpartners
. Method is the desiredHTTP
request method. qs is the query string containing request paramaters, and json is a json object containing request options. - callback
function
- a callback function that accepts an error and response parameter
Example
// Get a list of activities using the generic pokitdok.apiRequest(...) function. // This has the same result as the first pokidtdok.activities(...) example. pokitdok;
pokitDok.activities(options, callback)
Get a list of activities from the API. If an id is passed with the options, get a single activity. You can also change the state of an activity by passing the desired state (pause, cancel, resume) in the transition key.
Params
- options
object
- keys: id, transition - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// get a list of activitiespokitdok;
Example
// get a single activitypokitdok;
Example
// cancel an activitypokitdok;
pokitDok.authorizations(options, callback)
The Authorizations resource allows an application to submit a request for the review of health care in order to obtain an authorization for that health care.
Params
- options
object
- the authorizations query - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// submit an authorizations requestpokitdok;
pokitDok.cashPrices(options, callback)
Get a list of cash prices for a particular CPT Code in a specific Zip Code
Params
- options
object
- keys: cpt_code, zip_code - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// print the procedure code and price for a particular zip/cpt combinationpokitdok;
pokitDok.claims(options, callback)
Submit a claim for processing. The API calls back with an activity object that tracks the state of the claim.
Params
- options
object
- the claim document - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// submit a claim documentpokitdok;
pokitDok.claimStatus(options, callback)
Get the status of a submitted claim from the specified trading partner. You can specify a specific tracking id if you have one from the original claim.
Params
- options
object
- the claim status query - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// get the status of a claim using a date range and tracking idpokitdok;
pokitDok.eligibility(options, callback)
Get an eligibility response from a trading partner based on the provided eligibility document (provider, member, cpt code, service_types)
Params
- options
object
- keys: provider, service_types, member, cpt_code, trading_partner_id - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// get general eligibility for a member for a specific providerpokitdok;
Example
// get eligibility for a member for a specific CPT codepokitdok;
pokitDok.enrollment(options, callback)
Get an enrollment response from a trading partner based on the provided enrollment document (provider, member, cpt code, service_types)
Params
- options
object
- keys: provider, service_types, member, cpt_code, trading_partner_id - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// get general enrollment for a member for a specific providerpokitdok;
pokitDok.icdConvert(options, callback)
The ICD Convert endpoint allows a client application to request ICD-9 to ICD-10 mapping information for the specified ICD-9 code. This endpoint retrieves ICD-9 to ICD-10 mapping information.
Params
- options
object
- An object containing query parameters. Avaiable keys: code (an ICD-9 code) - callback
function
- See API documentation for more information
Example
// Basic ICD-9 to ICD-10 conversionpokitdok
pokitDok.insurancePrices(options, callback)
Get a list of insurance prices for a particular CPT Code in a specific Zip Code
Params
- options
object
- keys: cpt_code, zip_code - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// print the procedure code and price for a particular zip/cpt combinationpokitdok;
pokitDok.medicalProcedureCodes(options, callback)
Get a list of medical procedure information meeting certain search criteria.
Params
- options
object
- possible query string parameters or a specific code. Available query paramters: name, description. - callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Example
// Print a list of all code namespokitdok;
pokitDok.payers(callback)
Get a list of payers from the API for use in other EDI transactions.
Params
- callback
function
- a callback function that accepts an error and response parameter
See API documentation for more information
Deprecated
Example
// print the trading partner id's, used to identify a payer for other EDI transactionpokitdok;
pokitDok.plans(options, callback)
Get information about available plans based on parameters given
See API documentation for more information
Params
- options
object
- keys: trading_partner_id, county, state, plan_id, plan_type, plan_name, metallic_level - callback
function
- a callback function that accepts an error and response parameter
Example
// fetch any plan informationpokitdok;
Example
// fetch plan information for PPOs in Texaspokitdok;
pokitDok.providers(options, callback)
Search health care providers in the PokitDok directory. When an id is specified in the options object, a single provider or a 404 error response is returned. When a npi is specified on the options object, a single provider or 404 error is returned. Use any of the other available options to return a list of providers.
See API documentation for more information
Params
- options
object
- keys: npi, zipcode, radius, first_name, last_name, specialty, organization_name, limit - callback
function
- a callback function that accepts an error and response parameter
Example
// get a list of providers based on the filters providedpokitdok;
Example
// get a provider using a npi idpokitdok;
pokitDok.referrals(options, callback)
The Referrals resource allows an application to request approval for a referral to another health care provider.
See API documentation for more information
Params
- options
object
- the authorizations query - callback
function
- a callback function that accepts an error and response parameter
Example
// submit a referral request for approvalpokitdok;
pokitDok.schedulers(options, callback)
Get a list of supported scheduling systems and their UUIDs and descriptions or get a single
See API documentation for more information
Params
- options
object
- Available keys: scheduler_uuid - A scheduling system's unique ID - callback
function
- a callback function that accepts an error and response parameter
Example
// Grab a list of schedulers and print their descriptionspokitdok;
Example
// Grab a single scheduler and print the scheduler objectpokitdok;
pokitDok.appointmentTypes(options, callback)
Get a list of appointment types, their UUIDs, and descriptions.
See API documentation for more information
Params
- options
object
- Available keys: uuid - An appointment type's unique ID - callback
function
- a callback function that accepts an error and response parameter
Example
// Grab a list of appointment types and print their type and descriptionspokitdok;
Example
// Grab a single appointment type and print the appointment type objectpokitdok;
pokitDok.appointments(options, callback)
Query for open appointment slots (using pd_provider_uuid and location) or booked appointments (using patient_uuid) given query parameters.
See API documentation for more information
Params
- options
object
- Available keys: uuid - An appointment type's unique ID, pd_provider_uuid - A provider's unique ID, patient_uuid - an existing patient's unique ID, and location - location {object} for a provider or business - callback
function
- a callback function that accepts an error and response parameter
Example
// Grab a list of appointment types and print their type and descriptionspokitdok;
Example
// Grab a single appointment and print the appointment type objectpokitdok;
pokitDok.updateAppointment(options, callback)
Book appointment for an open slot or edit its description. Post data contains patient attributes and description.
See API documentation for more information
Params
- options
object
- Required keys: pd_appointment_uuid, - callback
function
- a callback function that accepts an error and response parameter
Example
// Delete an appointment slot with the given uuidpokitdok;
pokitDok.deleteAppointment(options, callback)
Cancel appointment given its {pd_appointment_uuid}.
See API documentation for more information
Params
- options
object
- Required keys: pd_appointment_uuid, - callback
function
- a callback function that accepts an error and response parameter
Example
// Delete an appointment slot with the given uuidpokitdok;
pokitDok.addPatientToSystem(options, callback)
Registers an existing PokitDok user as a patient within a provider’s scheduling system.
See API documentation for more information
Params
- options
object
- Required keys: pd_patient_uuid - The PokitDok unique identifier for the user record, pd_provider_uuid - The PokitDok unique identifier for the provider record. location - The geo-location of the provider’s physical address. - callback
function
- a callback function that accepts an error and response parameter
Example
// Grab a list of appointment types and print their type and descriptionspokitdok; // An example response from this endpoint: // { // 'uuid': '2773f6ff-00cb-460f-823f-5ff2208511e7', // 'email': 'peg@emailprovider.com', // 'phone': '5553331122', // 'birth_date': '1990-01-13', // 'first_name': 'Peg', // 'last_name': 'Patient', // 'member_id': 'PD20150001' // }
pokitDok.createAppointmentSlot(options, callback)
Creates an open scheduling slot with the specified start and end times at the specified provider and location.
See API documentation for more information
Params
- options
object
- Required keys: pd_provider_uuid, location, appointment_type, start_date, end_date - callback
function
- a callback function that accepts an error and response parameter
Example
// Grab a list of appointment types and print their type and descriptionspokitdok; // An example response from this endpoint // { // 'pd_appointment_uuid': 'ab21e95b-8fa6-41d4-98b9-9a1f6fcff0d2', // 'provider_scheduler_uuid': '8b21efa4-8535-11e4-a6cb-0800272e8da1', // 'appointment_id': 'W4MEM00001', // 'appointment_type': 'AT1', // 'start_date': '2014-12-16T15:09:34.197709', // 'end_date': '2014-12-16T16:09:34.197717', // 'booked': false // }
pokitDok.deleteAppointmentSlot(options, callback)
Deletes an open scheduling slot with the specified uuid.
See API documentation for more information
Params
- options
object
- Required keys: pd_appointment_uuid. - callback
function
- a callback function that accepts an error and response parameter
Example
// Delete an appointment slot with the given uuidpokitdok;
pokitDok.getIdentity(options, callback)
Returns a list containing a single identity resource if a uuid is provided or returns a list containing one or more identity resources meeting search criteria.
See API documentation for more information
Params
- options
object
- A list of parameters used to create the identity resource. Avaiable keys include: address.adddress_lines, address.city, address.state, address.zipcode, birth_date, email, first_name, gender, identifiers, last_name, member_id, middle_name, phone, prefix, secondary_phone ssn, suffix, uuid. - callback
function
- a callback function that accepts an error and response parameter
Example
// Get a single identity resource by providing an uuidpokitdok;
Example
// Query the indentity endpoint for an identity resource with the given values for the fields providedpokitdok;
pokitDok.updateIdentity(options, callback)
Updates an existing identity resource. Returns the updated resource
See API documentation for more information
Params
- options
object
- A list of parameters used to create the identity resource. Avaiable keys include: address.adddress_lines, address.city, address.state, address.zipcode, birth_date, email, first_name, gender, identifiers, last_name, member_id, middle_name, phone, prefix, secondary_phone ssn, suffix, uuid. - callback
function
- a callback function that accepts an error and response parameter
Example
// Get a single identity resource by providing an uuidpokitdok;
pokitDok.createIdentity(options, callback)
Creates an identity resource. Returns the created resource with a uuid
See API documentation for more information
Params
- options
object
- A list of parameteres used to creat the identity resource. Avaiable keys include: address.adddress_lines, address.city, address.state, address.zipcode, birth_date, email, first_name, gender, identifiers, last_name, member_id, middle_name, phone, prefix, secondary_phone ssn, suffix, uuid. - callback
function
- a callback function that accepts an error and response parameter
Example
// Create a new identity resource with the following informationpokitdok;
pokitDok.tradingPartners(options, callback)
Get a list of trading partners from the API for use in other EDI transactions.
See API documentation for more information
Params
- options
object
- A object containing some options for the request. Possible keys include: id (a trading partner id) - callback
function
- a callback function that accepts an error and response parameter
Example
// print the trading partner id's, used to identify a payer for other EDI transactionpokitdok;
Example
// print a single trading partnerpokitdok;
License
Copyright (c) 2014 PokitDok Inc. See LICENSE for details.