Skip to content

Commit

Permalink
remove any dashes from the EIN and ensure the hospital name is lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
eoverly committed Sep 6, 2024
1 parent ac5cb26 commit 762fbea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/wizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Layout from "../layouts"
const STORAGE_PATH = "cms-hpt-file-name-wizard"

const EIN_REGEX = /^\d{2}-?\d{7}$/
//const EIN_REGEX = /^\d{9}$/
const NPI_REGEX = /^\d{10}$/

const Wizard = () => {
Expand All @@ -40,9 +41,9 @@ const Wizard = () => {
}, [state.name, state.ein, state.fileType, state.npi])

const getFilename = () =>
`${state.ein || "<ein>"}${
`${state.ein.replace(/-/g,"") || "<ein>"}${
state.showNpi && state.npi ? `-${state.npi}` : ``
}_${state.name.replace(/\s/g, "-") || "<hospitalname>"}_standardcharges.${
}_${state.name.replace(/\s/g, "-").toLowerCase() || "<hospitalname>"}_standardcharges.${
state.fileType || "<format>"
}`

Expand All @@ -60,7 +61,7 @@ const Wizard = () => {
if (!state.ein.match(EIN_REGEX)) {
return {
type: "error",
message: `EIN must be 9 digits in the format XX-XXXXXXX or XXXXXXXXX`,
message: `EIN must be 9 digits in the format XXXXXXXXX`,
}
} else if (state.showNpi && state.npi && !state.npi.match(NPI_REGEX)) {
return {
Expand Down

0 comments on commit 762fbea

Please sign in to comment.