edi837p-availity
v1.0.2
Published
<h1 align="center">Generate 837P file and upload to Availity</h1>
Downloads
5
Maintainers
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));