Java

Overview

The Beacon SDK provides an interface and the functionality to facilitate the submission and upload of claims data for respective Covered Entities.

In order to accomplish this, it is a requirement that we ensure PHI (Personal Health Information) is not included in submissions, this is achieved by a one way de-identification function.

All claims files will be required to pass strict formatting and validations before uploading to Beacon. Claims data files are filtered by NDCs of participating manufacturers, only matching NDC rows will selected for submission. Claims data files are also filtered by which Covered Entities have granted you the ability to submit on their behalf.


Installation

  1. Download the jar file and place it in the lib folder of your project.
  2. Modify your pom.xml file and add the dependency:
<dependency>
    <groupId>com.secondsightsolutions.sdk</groupId>
    <artifactId>Beacon-java</artifactId>
    <version>2.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/Beacon-java-2.0-jar-with-dependencies.jar</systemPath>
</dependency>
  1. Download the appropriate binary for your OS and architecture from the binary directory and copy it to your server. Keep track of the location you copied the binary into, because it will be needed for a later step.

Configure your client

To authenticate with the client, you will be required to provided your private_token.

If you do not already have a private token please reach out to [email protected]

📘

Client Arguments

The Beacon client must be initialized with your PRIVATE_TOKEN, OS, ARCHITECTURE, and ENVIRONMENT. The following options are supported.

OSArchitecture
darwinamd64
darwinarm64
linuxamd64
linux386

A sandbox environment is available to Partners and can be enabled to test submissions and other endpoints for implementation activities with Beacon.


package com.example;

import java.util.List;

import com.secondsightsolutions.sdk.BeaconClient;
import com.secondsightsolutions.sdk.Submission;

public class App {
    public static void main(String[] args) {
        // initialize the client with your private token and the full path to the binary you copied from step 3
        BeaconClient client = new BeaconClient("private_token", "/path/to/binary", "sandbox");
    }
}

Enable Production Submissions

By default Beacon Partner accounts will be INACTIVE. To Activate a Beacon Partner account, please reach out to [email protected]

// view account status
System.out.println(client.account.status());

Usage

To create and transmit a claims file you will need to provide the path location to your CSV Claim data file as well as an output file location where the results will be written.
Additionally, you can preview submission files by including an output path and input filename.

👍

Beacon ID

It's required that you specify the location you'd like to receive your output file. The Beacon SDKs will return Beacon Identifiers for each unique submitted Claim.

Preview Submission File

// (inputFile, outputFile)
// outputFile argument required

client.submissions.previewPharmacy("PATH_TO_CLAIMS_DATA_FILE.csv", "./OUTPUT_FILE_NAME.csv");
client.submissions.previewMedical("PATH_TO_CLAIMS_DATA_FILE.csv", "./OUTPUT_FILE_NAME.csv");

Create Pharmacy Claim Submission

// (inputFile, outputFile)

response = client.submissions.createPharmacy("PATH_TO_CLAIMS_DATA_FILE.csv", "./OUTPUT_FILE_NAME.csv");

Create Medical Claim Submission

// (inputFile, outputFile)

response = client.submissions.createMedical("PATH_TO_CLAIMS_DATA_FILE.csv", "./OUTPUT_FILE_NAME.csv");

Accessor Functions

Note - For most methods where we return a list of data, if the number of results is greater than 100, we paginate the response. In order to get the next page of data, call the same method but pass an additional argument for the page number you'd like to receive as a string. You'll know if there are multiple pages by taking a look at the response object for the fist call. If the length of items in the response is 100, there is a high likelihood there are multiple pages. Also on the response object you'll see a Metadata attribute. This contains your current page, the total number of pages, and the number of results per page. Its up to you to check for this response and continue to call the endpoint passing in each page number until you've retrieved all of the data. Example of how to do this below.

The current list of methods that return this metadata are:

  • pharmacy_claims.getBySubmission()
  • pharmacy_claims.getSubmissionsByRange()
  • medical_claims.getBySubmission()
  • medical_claims.getSubmissionsByRange()
  • rebates.getRebates()
  • statements.getStatements()
  • statements.getStatementsByRange()

Example:

response = client.pharmacy_claims.getBySubmission("SUB-44195f27-5b72-4234-a19a-1bed88627c9c")
System.out.println(response.Metadata)
// output to screen looks like:
// Metadata: {
//   total_pages: 4
//   page: 1
//   perPage: 100
// }
// Now get the next page by passing in "2" as the second arg
response = client.pharmacy_claims.getBySubmission("SUB-44195f27-5b72-4234-a19a-1bed88627c9c", "2")
System.out.println(response.Metadata)
// output to screen looks like:
// Metadata: {
//   total_pages: 4
//   page: 2
//   perPage: 100
// }

Get Manufacturers

response = client.manufacturers.getManufacturers()

Get Permissions

response = client.permissions.get()

Get NDCs

response = client.ndcs.get()

Get Prices

System.out.println(client.prices.get());

Get Pharmacy Claims

  • By Date Range
response = client.pharmacy_claims.getSubmissionsByRange("2025-02-28", "2025-03-01")
  • By Submission ID
response = client.pharmacy_claims.getBySubmission("SUB-44195f27-5b72-4234-a19a-1bed88627c9c")
  • By Claim ID
response = client.pharmacy_claims.get("CLM-44c240daba75ef36adc849e489cbe2de8f1b9931f03741b8ba3a1163feb76fd2")
  • Get Pharmacy Submission by Submission ID
response = client.pharmacy_claims.getSubmissionByID("SUB-44195f27-5b72-4234-a19a-1bed88627c9c")

Get Medical Claims

  • By Date Range
response = client.medical_claims.getSubmissionsByRange("2024-01-01", "2025-03-01")
  • By Submission ID
response = client.medical_claims.getBySubmission("SUB-b01fa53b-ef14-40c3-a951-22a30e891d43")
  • By Claim ID
response = client.medical_claims.get("CLM-0c860a5dc19e9240e2f4e3b205fe70c159468f7158905d22850bf1187cc06237")
  • Get Medical Submission by Submission ID
response = client.medical_claims.getSubmissionByID("SUB-b01fa53b-ef14-40c3-a951-22a30e891d43")

Get Rebates

  • By Entity ID and Manufacturer
response = client.rebates.getRebates("entity_id", "manu")
  • By Rebate ID
response = client.rebates.getRebatesByID("CR-0HPU0OnNAZbyVQoQx9zZpPdkHqPDOggB")

Get Statements

  • By Entity ID and manufacturer
response = client.statements.getStatements("entity_id", "manu")
  • By Date Range
response = client.statements.getStatementsByRange("entity_id", "manu", "2024-01-01", "2025-03-01")

Get Balances

  • By CEID, NDC, NPI
response = client.balances.getBalance("entity_id", "ndc", "npi")

Did this page help you?