npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

edi837p-availity

v1.0.2

Published

<h1 align="center">Generate 837P file and upload to Availity</h1>

Downloads

5

Readme

Installation

Install the edi837p-availity package to create an 837P file using JSON as input, and upload it to Availity using SFTP details:

npm install edi837p-availity

PreRequisite

To use edi837p-availity, ensure you have the following prerequisites:


// JSON object containing all the information related to the 837 file

const inputJson = {
  "isProduction": true,
  "patientControlNumber": "26463774",
  "chargeAmount": 100,
  "transaction": {
    "controlNumber": "92179",  // Control number should be unique every time
    "sender": {
      "identifier": "AV09311993", // Use your own Sender ID
      "lastNameOrOrgName": "PREMIER BILLING SERVICE",
      "contacts": [
        {
          "name": "JERRY",
          "contactNumbers": [
            {
              "type": "PHONE",
              "number": "30555522XX"
            },
            {
              "type": "EXTENSION",
              "number": "231"
            }
          ]
        }
      ]
    },
    "receiver": {
      "identifier": "030240928", // Use your own Receiver ID
      "lastNameOrOrgName": "KEY INSURANCE COMPANY",
    },
    "originatorApplicationTransactionId": "2445XX",
    "placeOfServiceType": "OFFICE",
    "clearinghouseTraceNumber": "1731234560000XXXX",
  },
  "subscriber": {
    "payerResponsibilitySequence": "PRIMARY",
    "relationshipType": "SELF",
    "groupOrPolicyNumber": "2222-SJ",
    "claimFilingIndicatorCode": "CI",
    "person": {
      "identifier": "JS00111223XXX",
      "lastNameOrOrgName": "Smith",
      "firstName": "Jane",
      "birthDate": "1943-05-01",
      "gender": "FEMALE",
      "address": {
        "line": "237 N MAIN ST",
        "city": "TAMPA",
        "stateCode": "FL",
        "zipCode": "33412"
      }
    },
    "payer": {
      "identifier": "AETNA",
      "lastNameOrOrgName": "KEY INSURANCE COMPANY",
      "additionalIds": [
        {
          "qualifierCode": "G2",
          "type": "PROVIDER_COMMERCIAL_NUMBER",
          "identification": "KA6663"
        }
      ]
    }
  },
  "patient": {
    "relationshipType": "CHILD", // SPOUSE or CHILD or SELF
    "person": {
      "identifier": "JS00111223333-child",
      "lastNameOrOrgName": "Smith",
      "firstName": "Ted",
      "birthDate": "1973-05-01",
      "gender": "MALE",
      "address": {
        "line": "236 N MAIN ST",
        "city": "MIAMI",
        "stateCode": "FL",
        "zipCode": "33413"
      }
    }
  },
  "diags": [
      {
        "subType": "ICD_10_PRINCIPAL",
        "code": "J020",
      },
      {
        "subType": "ICD_10",
        "code": "Z1159",
      }
  ],
  "serviceLines": [
      {
        "chargeAmount": 40,
        "serviceDateFrom": "2006-10-03",
        "unitCount": 1,
        "procedure": {
          "code": "99213"
        }
      },
      {
        "chargeAmount": 15,
        "serviceDateFrom": "2006-10-03",
        "unitCount": 1,
        "procedure": {
          "code": "87070",
        },
      },
      {
        "chargeAmount": 35,
        "serviceDateFrom": "2006-10-10",
        "unitCount": 1,
        "procedure": {
          "code": "99214",
        }
      }
    ],
  "billingProvider": {
    "providerTaxonomy": {
      "code": "103G00000X",
    },
    "lastNameOrOrgName": "Ben Kildare Service",
    "identifier": "9876543210",
    "address": {
      "line": "234 SEAWAY ST",
      "city": "MIAMI",
      "stateCode": "FL",
      "zipCode": "33111"
    },
    "taxId": "587654321"
  }
}

// Remote location where your file will be uploaded after creation
const remotePath = '/SendFiles/edi837.txt';

// Local file storage location from your project where you want to save the created EDI file
const localFilePath = "ediFile/";
// NOTE: Do not forget to add a forward slash (/) after the folder name, otherwise, the file will be created at the root folder location

// Ensure the above-mentioned location exists in your project folder
// Use the below code to create the folder if it doesn't exist
if (!fs.existsSync(localFilePath)){
    fs.mkdirSync(localFilePath);
}

// Find your FTP details from Availity

const ftpConfig = {
    "host": "ftp.availity.com",
    "port": "9922",
    "user": "YOUR-USERNAME",
    "password": "YOUR-PASSWORD",
    "secure": false
}

Development

// If you want to create your 837P EDI file and don't want to upload it, use the following function 

createEdi873(inputJson, localFilePath)
  .then(() => console.log('EDI file created successfully'))
  .catch(err => console.error('Process failed', err));


// If you are 100% sure that you have the correct information in the JSON variable and your file is created successfully, use the following function to create and upload the EDI file using Availity 
createEdi873AndUpload(inputJson, localFilePath, ftpConfig, remotePath)
  .then(() => console.log('Process completed successfully'))
  .catch(err => console.error('Process failed', err));