PillFill Java Client

A mHealth library to simplify accessing patient prescriptions, drug information, and prescriber/pharmacy data.

License

License

Categories

Categories

Java Languages CLI User Interface
GroupId

GroupId

com.apothesource.pillfill
ArtifactId

ArtifactId

pf-java-client
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

PillFill Java Client
A mHealth library to simplify accessing patient prescriptions, drug information, and prescriber/pharmacy data.
Source Code Management

Source Code Management

https://github.com/rammic/pf-java-client

Download pf-java-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.apothesource.pillfill/pf-java-client/ -->
<dependency>
    <groupId>com.apothesource.pillfill</groupId>
    <artifactId>pf-java-client</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.apothesource.pillfill/pf-java-client/
implementation 'com.apothesource.pillfill:pf-java-client:1.0.1'
// https://jarcasting.com/artifacts/com.apothesource.pillfill/pf-java-client/
implementation ("com.apothesource.pillfill:pf-java-client:1.0.1")
'com.apothesource.pillfill:pf-java-client:jar:1.0.1'
<dependency org="com.apothesource.pillfill" name="pf-java-client" rev="1.0.1">
  <artifact name="pf-java-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.apothesource.pillfill', module='pf-java-client', version='1.0.1')
)
libraryDependencies += "com.apothesource.pillfill" % "pf-java-client" % "1.0.1"
[com.apothesource.pillfill/pf-java-client "1.0.1"]

Dependencies

compile (8)

Group / Artifact Type Version
com.google.guava : guava jar 18.0
com.google.code.gson : gson jar 2.3
com.squareup.okhttp : okhttp-urlconnection jar 2.4.0
io.reactivex : rxjava jar 1.0.11
com.squareup.okhttp : okhttp jar 2.4.0
org.cryptonode.jncryptor : jncryptor jar 1.2.0
com.google.dagger : dagger jar 2.0.1
com.jakewharton.timber : timber jar 3.1.0

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : java-hamcrest jar 2.0.0.0
org.mockito : mockito-core jar 1.9.5

Project Modules

There are no modules declared in this project.

PillFill Java Client

Build Status

This library aims to make building mHealth applications easier. It serves as the base of the PillFill Android Application.

PillFill

We're focused on three areas:

These are fairly broad groups and will probably mean breaking each into their separate module in the future.

Most of the data services depend on pulling information from the developer.pillfill.com server, so you'll need to get an API Key. Swagger documentation on the REST services is available at the PillFill Developer Site.

Integration and Use

The easiest way to get started is to simply add a dependency. If you're using maven:

<dependency>
  <groupId>com.apothesource.pillfill</groupId>
  <artifactId>pf-java-client</artifactId>
  <version>1.0.1</version>
</dependency>

Or if you're using gradle (e.g. w/ Android Studio):

dependency{
    compile 'com.apothesource.pillfill:pf-java-client:1.0.1'
}

Primary Features & Services

Some of the most useful functions in this library are the following services (or proxies for the PF backend services) to provide information about drugs, providers, and patients. Most will reach back to the PillFill Server as needed to retrieve relevant information. Be sure to set your apikey as either a system property (e.g. export pfApiKey=[YOUR_API_KEY]) or in the credentials.properties file.

Medication & Interaction Services

DrugService

DrugService provides methods to access information about medications, broken into Generic Drug concepts (e.g. Ibuprofen 200mg Pills) and products (e.g. Advil 200mg Pill 100 Pill Bottle).

DrugAlertService

DrugAlertService offers methods to check for FDA Alerts (Drug Recalls and Shortages), Maximum Recommended Therapeutic Dose (MRTD- Overdose Monitoring), and Drug/Drug Interaction Checking (via NIH/RxNav).

Prescriber & Pharmacy Services

PrescriberService

Use the prescriber service to search for prescriber by NPI or by name and location. You can also use this method to get detailed background information about a doctor including Medicare prescribing history if available.

PharmacyService

Use the pharmacy service to retrieve detailed operational information (e.g. hours of operation, phone number) about a pharmacies included in a prescription's pharmacyStoreId field.

Patient Services

PrescriptionService

Prescription service coordinates the task of extracting and managing prescriptions from pharmacy and insurance accounts. More information about data included in the prescription.

PatientService

Each instance of this service represents a single patient. It is responsible for managing the Rx lists for an individual and syncing to/from the server. It ensures that sensitive information about the user is encrypted before it is synced to the server.

Example Command Line Tool

You can invoke a CLI to test the API by running the library as an executable Jar. First build a fatJar to avoid classpath issues:

./gradlew fatJar

This should build a Jar with the path of build/libs/pf-java-client.jar. Switch to directory (cd build/libs) to run commands from the command line. You can try any of the following:

Example: Get product information about drug with NDC '00555078802':

java -jar pf-java-client.jar info apikey=[YOUR_API_KEY] ids=00555078802

Example: Get concept information about National Drug File ID 'N022111124':

java -jar pf-java-client.jar info apikey=[YOUR_API_KEY] ids=N022111124

Example: Export a prescription information for a given user:

java -jar pf-java-client.jar extract apikey=[YOUR_API_KEY] [email protected] password=testPassword type=test outfile=rx-export.json

This will retrieve a set of example prescriptions. You can also use this to extract live information:

java -jar pf-java-client.jar extract apikey=[YOUR_API_KEY] username=[YOUR_USERNAME] password=[YOUR_PASSWORD] type=[ACCOUNT_TYPE] outfile=rx-export.json

The export process is described in more detail in the PrescriptionService documentation.. A current list of supported account types is available on the developer site.

Build

Be sure to set JAVA7_HOME & JAVA8_HOME environment variables (or in gradle.properties) if you want to build from scratch since this library depends on retrolambda to handle the conversion of lambda functions to Android-compatible Java 7 baseline.

License

The MIT License (MIT)

Copyright (c) 2015, Apothesource, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Versions

Version
1.0.1
1.0.0