Skip to content

Commit

Permalink
adding stricter schema requirements to ensure attributes have values
Browse files Browse the repository at this point in the history
  • Loading branch information
shaselton-usds committed Jan 23, 2024
1 parent c215bf1 commit ec304e1
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/versions/2.0/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const STANDARD_CHARGE_DEFINITIONS = {
code_information: {
type: "object",
properties: {
code: { type: "string" },
code: { type: "string", minLength: 1 },
type: {
enum: BILLING_CODE_TYPES,
type: "string",
Expand All @@ -32,7 +32,7 @@ const STANDARD_CHARGE_DEFINITIONS = {
drug_information: {
type: "object",
properties: {
unit: { type: "string" },
unit: { type: "string", minLength: 1 },
type: { enum: DRUG_UNITS, type: "string" },
},
required: ["unit", "type"],
Expand Down Expand Up @@ -65,7 +65,7 @@ const STANDARD_CHARGE_DEFINITIONS = {
standard_charge_information: {
type: "object",
properties: {
description: { type: "string" },
description: { type: "string", minLength: 1 },
drug_information: { $ref: "#/definitions/drug_information" },
code_information: {
type: "array",
Expand All @@ -83,8 +83,8 @@ const STANDARD_CHARGE_DEFINITIONS = {
payers_information: {
type: "object",
properties: {
payer_name: { type: "string" },
plan_name: { type: "string" },
payer_name: { type: "string", minLength: 1 },
plan_name: { type: "string", minLength: 1 },
additional_payer_notes: { type: "string" },
standard_charge_dollar: { type: "number", exclusiveMinimum: 0 },
standard_charge_algorithm: { type: "string" },
Expand All @@ -102,7 +102,7 @@ const STANDARD_CHARGE_DEFINITIONS = {
const STANDARD_CHARGE_PROPERTIES = {
type: "object",
properties: {
description: { type: "string" },
description: { type: "string", minLength: 1 },
drug_information: { $ref: "#/definitions/drug_information" },
code_information: {
type: "array",
Expand Down Expand Up @@ -134,7 +134,7 @@ export const METADATA_DEFINITIONS = {
type: "string",
},
},
required: ["license_number", "state"],
required: ["state"],
},
affirmation: {
type: "object",
Expand All @@ -154,9 +154,11 @@ export const METADATA_DEFINITIONS = {
properties: {
description: {
type: "string",
minLength: 1,
},
code: {
type: "string",
minLength: 1,
},
modifier_payer_information: {
type: "array",
Expand All @@ -173,34 +175,39 @@ export const METADATA_DEFINITIONS = {
properties: {
payer_name: {
type: "string",
minLength: 1,
},
plan_name: {
type: "string",
minLength: 1,
},
description: {
type: "string",
minLength: 1,
},
},
required: ["payer_name", "plan_name", "description"],
},
}

export const METADATA_PROPERTIES = {
hospital_name: { type: "string" },
hospital_name: { type: "string", minLength: 1 },
last_updated_on: { type: "string", format: "date" },
license_information: {
$ref: "#/definitions/license_information",
},
version: { type: "string" },
version: { type: "string", minLength: 1 },
hospital_address: {
type: "array",
items: { type: "string" },
minItems: 1,
},
hospital_location: {
type: "array",
items: {
type: "string",
},
minItems: 1,
},
affirmation: {
$ref: "#/definitions/affirmation",
Expand Down

0 comments on commit ec304e1

Please sign in to comment.