Skip to content

Commit

Permalink
Do not validate defined optional elements (#49)
Browse files Browse the repository at this point in the history
There are elements defined in the data dictionary that are specified as
being optional. These elements have types defined in the data
dictionary. Do not validate that these type requirements are fulfilled
when the elements are present.
  • Loading branch information
mint-thompson authored Jul 19, 2024
1 parent a9fa28d commit e7658de
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 71 deletions.
22 changes: 0 additions & 22 deletions src/versions/1.1/csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import {
import {
BILLING_CODE_TYPES,
BillingCodeType,
CHARGE_BILLING_CLASSES,
CHARGE_SETTINGS,
CONTRACTING_METHODS,
ChargeBillingClass,
ChargeSetting,
ContractingMethod,
DRUG_UNITS,
Expand All @@ -24,13 +22,11 @@ export const HEADER_COLUMNS = [
"last_updated_on",
"version",
"hospital_location",
"financial_aid_policy",
"license_number | state",
]

export const BASE_COLUMNS = [
"description",
"billing_class",
"setting",
"drug_unit_of_measurement",
"drug_type_of_measurement",
Expand Down Expand Up @@ -243,23 +239,6 @@ export function validateRow(
)
}

if (
!CHARGE_BILLING_CLASSES.includes(row["billing_class"] as ChargeBillingClass)
) {
errors.push(
csvErr(
index,
columns.indexOf("billing_class"),
"billing_class",
ERRORS.ALLOWED_VALUES(
"billing_class",
row["billing_class"],
CHARGE_BILLING_CLASSES as unknown as string[]
)
)
)
}

if (!CHARGE_SETTINGS.includes(row["setting"] as ChargeSetting)) {
errors.push(
csvErr(
Expand Down Expand Up @@ -477,7 +456,6 @@ export function getBaseColumns(columns: string[]): string[] {
return [
"description",
...codeColumns,
"billing_class",
"setting",
"drug_unit_of_measurement",
"drug_type_of_measurement",
Expand Down
6 changes: 0 additions & 6 deletions src/versions/1.1/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "../../types.js"
import {
BILLING_CODE_TYPES,
CHARGE_BILLING_CLASSES,
CHARGE_SETTINGS,
DRUG_UNITS,
CONTRACTING_METHODS,
Expand Down Expand Up @@ -58,10 +57,6 @@ const STANDARD_CHARGE_DEFINITIONS = {
items: { $ref: "#/definitions/payers_information" },
minItems: 1,
},
billing_class: {
enum: CHARGE_BILLING_CLASSES,
type: "string",
},
additional_generic_notes: { type: "string" },
},
required: ["setting"],
Expand Down Expand Up @@ -157,7 +152,6 @@ export const METADATA_PROPERTIES = {
},
version: { type: "string" },
hospital_location: { type: "string" },
financial_aid_policy: { type: "string" },
}

export const METADATA_REQUIRED = ["hospital_name", "last_updated_on", "version"]
Expand Down
4 changes: 0 additions & 4 deletions src/versions/1.1/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ export const CHARGE_SETTINGS = ["inpatient", "outpatient", "both"] as const
type ChargeSettingTuple = typeof CHARGE_SETTINGS
export type ChargeSetting = ChargeSettingTuple[number]

export const CHARGE_BILLING_CLASSES = ["professional", "facility"] as const
type ChargeBillingClassTuple = typeof CHARGE_BILLING_CLASSES
export type ChargeBillingClass = ChargeBillingClassTuple[number]

export const CONTRACTING_METHODS = [
"case rate",
"fee schedule",
Expand Down
26 changes: 0 additions & 26 deletions src/versions/2.0/csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "../common/csv.js"
import {
BILLING_CODE_TYPES,
CHARGE_BILLING_CLASSES,
CHARGE_SETTINGS,
STANDARD_CHARGE_METHODOLOGY,
DRUG_UNITS,
Expand Down Expand Up @@ -43,11 +42,6 @@ export const BASE_COLUMNS = [
"additional_generic_notes", // string
]

export const OPTIONAL_COLUMNS = [
"financial_aid_policy", // string
"billing_class", // CHARGE_BILLING_CLASSES or blank
]

export const TALL_COLUMNS = [
"payer_name", // string
"plan_name", // string
Expand Down Expand Up @@ -387,16 +381,6 @@ export function validateRow(
)
}

errors.push(
...validateOptionalEnumField(
row,
"billing_class",
index,
columns.indexOf("billing_class"),
CHARGE_BILLING_CLASSES
)
)

errors.push(
...validateRequiredEnumField(
row,
Expand Down Expand Up @@ -555,16 +539,6 @@ function validateModifierRow(
}

// other conditionals don't apply for modifier rows, but any values entered should still be the correct type
errors.push(
...validateOptionalEnumField(
row,
"billing_class",
index,
columns.indexOf("billing_class"),
CHARGE_BILLING_CLASSES
)
)

errors.push(
...validateOptionalEnumField(
row,
Expand Down
5 changes: 0 additions & 5 deletions src/versions/2.0/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "../../types.js"
import {
BILLING_CODE_TYPES,
CHARGE_BILLING_CLASSES,
CHARGE_SETTINGS,
DRUG_UNITS,
STANDARD_CHARGE_METHODOLOGY,
Expand Down Expand Up @@ -55,10 +54,6 @@ const STANDARD_CHARGE_DEFINITIONS = {
items: { $ref: "#/definitions/payers_information" },
minItems: 1,
},
billing_class: {
enum: CHARGE_BILLING_CLASSES,
type: "string",
},
additional_generic_notes: { type: "string" },
},
required: ["setting"],
Expand Down
8 changes: 0 additions & 8 deletions src/versions/2.0/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ export const CHARGE_SETTINGS = ["inpatient", "outpatient", "both"] as const
type ChargeSettingTuple = typeof CHARGE_SETTINGS
export type ChargeSetting = ChargeSettingTuple[number]

export const CHARGE_BILLING_CLASSES = [
"professional",
"facility",
"both",
] as const
type ChargeBillingClassTuple = typeof CHARGE_BILLING_CLASSES
export type ChargeBillingClass = ChargeBillingClassTuple[number]

export const STANDARD_CHARGE_METHODOLOGY = [
"case rate",
"fee schedule",
Expand Down

0 comments on commit e7658de

Please sign in to comment.