rossdakin / node-fdsh-client

A Node.js client for the Federal Data Services Hub (FDSH).

Home Page:https://www.npmjs.com/package/fdsh-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fdsh-client NPM version

A Node.js client for the Federal Data Services Hub (FDSH)

Install

Install with npm:

npm install fdsh-client

Synopsis

Setup a bunch of config data:

const fdsh = require('fdsh-client');
const fs = require('fs');

// connectivity config
const host = 'dev.hub.cms.gov'
const port = 5443
const path = null
const userId = 'MY_USER_ID'
const password = 'MY_PASSWORD'
const cert = fs.readFileSync('/path/to/cert.pem')
const key = fs.readFileSync('/path/to/key.pem')
const connectivityArgs = { host, port, path, userId, password, cert, key }

// method-specific config
const firstName = 'MARK'
const middleName = ''
const lastName = 'WHITE'
const ssn = '277025100'
const dob = '1991-07-08'
const methodArgs = { firstName, middleName, lastName, ssn, dob }

// some simple callbacks
let onThen = result => console.log(result)
let onCatch = err => console.error(err)

Then you can start feeding it to methods that correspond to FDSH services.

For example, the Hub Connectivity Service:

fdsh.HubConnectivityService.hubConnectivityCheck(connectivityArgs)
  .then(onThen)
  .catch(onCatch)

…outputs:

{ ResponseMetadata: { ResponseCode: 'HS000000', ResponseDescriptionText: 'Success' } }

The Verify SSA Composite Service:

fdsh.VerifySSACompositeService.verifySsa(connectivityArgs, methodArgs)
  .then(onThen)
  .catch(onCatch)

…outputs:

{ SSACompositeIndividualResponse:
  { ResponseMetadata: { ResponseCode: 'HS000000', ResponseDescriptionText: 'Success' },
    PersonSSNIdentification: '277025100',
    SSAResponse:
    { SSNVerificationIndicator: 'true',
      DeathConfirmationCode: 'Unconfirmed',
      PersonUSCitizenIndicator: 'true',
      PersonIncarcerationInformationIndicator: 'false',
      SSATitleIIMonthlyIncomeInformationIndicator: 'true',
      SSATitleIIAnnualIncomeInformationIndicator: 'false',
      SSATitleIIMonthlyIncome: [Object] } } }

FAQ

What is the Federal Data Services Hub (FDSH)?

It's a system developed for the sharing of information between various entities.

Who oversees the FDSH?

The Centers for Medicare & Medicaid Services (CMS)

Who built the FDSH?

QSS, Inc. (QSSI)

How can I obtain a user ID, password, etc.?

You must speak with CMS.

TODO

  • tests
  • include more services
  • better error handling (more informative error messages, perhaps a unified error messaging scheme, etc.)

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

About

A Node.js client for the Federal Data Services Hub (FDSH).

https://www.npmjs.com/package/fdsh-client

License:Other


Languages

Language:JavaScript 100.0%