Skip to content

Commit

Permalink
additional tests around various errors of the file
Browse files Browse the repository at this point in the history
  • Loading branch information
shaselton-usds committed Jan 23, 2024
1 parent 669ef1f commit 34e4d49
Show file tree
Hide file tree
Showing 2 changed files with 221 additions and 7 deletions.
32 changes: 25 additions & 7 deletions test/2.0/json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test("validateJson", async (t) => {
"v2.0"
)
t.is(result.valid, true)
t.deepEqual(result.errors.length, 0)
})

test("validateJson empty", async (t) => {
Expand All @@ -30,13 +31,30 @@ test("validateJson maxErrors", async (t) => {
t.is(result.valid, false)
t.deepEqual(result.errors.length, 1)
})
/*
test("validateJson valid", async (t) => {

test("validateJson errorFile", async (t) => {
const result = await validateJson(
loadFixtureStream("sample-valid.json"),
loadFixtureStream("/2.0/sample-errors.json"),
"v2.0"
)
t.is(result.valid, true)
t.deepEqual(result.errors.length, 0)
})
*/
t.is(result.valid, false)
t.deepEqual(result.errors.length, 3)
t.deepEqual(result.errors,
[
{
path: '/standard_charges/0/payers_information/0/standard_charge_dollar',
field: 'standard_charge_dollar',
message: 'must be number'
},
{
path: '/standard_charges/3/payers_information/2',
field: '2',
message: "must have required property 'methodology'"
},
{
path: '/affirmation/affirmation',
field: 'affirmation',
message: 'must be equal to constant'
}
])
})
196 changes: 196 additions & 0 deletions test/fixtures/2.0/sample-errors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"hospital_name": "West Mercy Hospital",
"last_updated_on": "2024-07-01",
"version": "2.0.0",
"hospital_location": [
"West Mercy Hospital",
"West Mercy Surgical Center"
],
"hospital_address": [
"12 Main Street, Fullerton, CA 92832",
"23 Ocean Ave, San Jose, CA 94088"
],
"license_information": {
"license_number": "50056",
"state": "CA"
},
"affirmation": {
"affirmation": "T the best of its knowledge and belief, the hospital has included all applicable standard charge information in accordance with the requirements of 45 CFR 180.50, and the information encoded is true, accurate, and complete as of the date indicated.",
"confirm_affirmation": true
},
"standard_charge_information": [
{
"description": "Major hip and knee joint replacement or reattachment of lower extremity without mcc",
"code_information": [
{
"code": "470",
"type": "MS-DRG"
},
{
"code": "175869",
"type": "LOCAL"
}
],
"standard_charges": [
{
"minimum": 20000,
"maximum": 20000,
"setting": "inpatient",
"payers_information": [
{
"payer_name": "Platform Health Insurance",
"plan_name": "PPO",
"standard_charge_dollar": "20000",
"standard_charge_algorithm": "MS-DRG",
"estimated_amount": 22243.34,
"methodology": "case rate"
},
{
"payer_name": "Platform Health Insurance",
"plan_name": "PPO",
"standard_charge_dollar": 20000,
"standard_charge_algorithm": "https://www.cms.gov/Outreach-and-Education/Medicare-Learning-Network-MLN/MLNProducts/html/images/OP.jpg",
"estimated_amount": 22243.34,
"methodology": "case rate"
},
{
"payer_name": "Platform Health Insurance",
"plan_name": "PPO",
"standard_charge_dollar": 20000,
"standard_charge_algorithm": "The adjusted base payment rate indicated in the standard_charge|negotiated_dollar data element may be further adjusted for additional factors including transfers and outliers.",
"estimated_amount": 22243.34,
"methodology": "case rate"
},
{
"payer_name": "Region Health Insurance",
"plan_name": "HMO",
"standard_charge_percentage": 50,
"estimated_amount": 23145.98,
"methodology": "percent of total billed charges"
}
]
}
]
},
{
"description": "Evaluation of hearing function to determine candidacy for, or postoperative status of, surgically implanted hearing device; first hour",
"code_information": [
{
"code": "92626",
"type": "CPT"
}
],
"standard_charges": [
{
"setting": "outpatient",
"discounted_cash": 125,
"minimum": 98.98,
"maximum": 98.98,
"payers_information": [
{
"payer_name": "Platform Health Insurance",
"plan_name": "PPO",
"standard_charge_dollar": 98.98,
"methodology": "fee schedule",
"additional_payer_notes": "110% of the Medicare fee schedule"
},
{
"payer_name": "Region Health Insurance",
"plan_name": "HMO",
"standard_charge_percentage": 115,
"estimated_amount": 105.34,
"methodology": "fee schedule",
"additional_payer_notes": "115% of the state's workers' compensation amount"
}
]
}
]
},
{
"description": "Behavioral health; residential (hospital residential treatment program), without room and board, per diem",
"code_information": [
{
"code": "H0017",
"type": "HCPCS"
}
],
"standard_charges": [
{
"gross_charge": 2500,
"discounted_cash": 2250,
"minimum": 1200,
"maximum": 2000,
"setting": "inpatient",
"payers_information": [
{
"payer_name": "Platform Health Insurance",
"plan_name": "PPO",
"standard_charge_dollar": 1500,
"methodology": "per diem"
},
{
"payer_name": "Region Health Insurance",
"plan_name": "HMO",
"standard_charge_dollar": 2000,
"methodology": "per diem",
"additional_payer_notes": "per diem, days 1-3"
},
{
"payer_name": "Region Health Insurance",
"plan_name": "HMO",
"standard_charge_dollar": 1800,
"methodology": "per diem",
"additional_payer_notes": "per diem, days 4-5"
},
{
"payer_name": "Region Health Insurance",
"plan_name": "HMO",
"standard_charge_dollar": 1200,
"methodology": "per diem",
"additional_payer_notes": "per diem, days 6+"
}
]
}
]
},
{
"description": "Treatment or observation room — observation room",
"code_information": [
{
"code": "762",
"type": "RC"
}
],
"standard_charges": [
{
"gross_charge": 13000,
"discounted_cash": 12000,
"minimum": 8000,
"maximum": 10000,
"setting": "outpatient",
"payers_information": [
{
"payer_name": "Platform Health Insurance",
"plan_name": "PPO",
"standard_charge_dollar": 8000,
"methodology": "case rate",
"additional_payer_notes": "Negotiated standard charge without surgery and without rule out myocardial infarction"
},
{
"payer_name": "Platform Health Insurance",
"plan_name": "PPO",
"standard_charge_dollar": 10000,
"methodology": "case rate",
"additional_payer_notes": "Negotiated standard charge without surgery and with rule out myocardial infarction"
},
{
"payer_name": "Region Health Insurance",
"plan_name": "HMO",
"standard_charge_dollar": 9000
}
]
}
]
}
]
}

0 comments on commit 34e4d49

Please sign in to comment.