From 762fbeae256589d7f350034060444954ac2a0117 Mon Sep 17 00:00:00 2001 From: eoverly Date: Fri, 6 Sep 2024 10:26:12 -0400 Subject: [PATCH 1/2] remove any dashes from the EIN and ensure the hospital name is lowercase --- src/pages/wizard.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/wizard.jsx b/src/pages/wizard.jsx index c35294c..40034dd 100644 --- a/src/pages/wizard.jsx +++ b/src/pages/wizard.jsx @@ -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 = () => { @@ -40,9 +41,9 @@ const Wizard = () => { }, [state.name, state.ein, state.fileType, state.npi]) const getFilename = () => - `${state.ein || ""}${ + `${state.ein.replace(/-/g,"") || ""}${ state.showNpi && state.npi ? `-${state.npi}` : `` - }_${state.name.replace(/\s/g, "-") || ""}_standardcharges.${ + }_${state.name.replace(/\s/g, "-").toLowerCase() || ""}_standardcharges.${ state.fileType || "" }` @@ -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 { From bbf5c753269952ecab05787f2aeab6f9918bcd55 Mon Sep 17 00:00:00 2001 From: eoverly Date: Mon, 9 Sep 2024 23:20:24 -0400 Subject: [PATCH 2/2] ran prettier --- src/pages/wizard.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/wizard.jsx b/src/pages/wizard.jsx index 40034dd..094f7e4 100644 --- a/src/pages/wizard.jsx +++ b/src/pages/wizard.jsx @@ -18,7 +18,6 @@ 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 = () => { @@ -41,11 +40,11 @@ const Wizard = () => { }, [state.name, state.ein, state.fileType, state.npi]) const getFilename = () => - `${state.ein.replace(/-/g,"") || ""}${ + `${state.ein.replace(/-/g, "") || ""}${ state.showNpi && state.npi ? `-${state.npi}` : `` - }_${state.name.replace(/\s/g, "-").toLowerCase() || ""}_standardcharges.${ - state.fileType || "" - }` + }_${ + state.name.replace(/\s/g, "-").toLowerCase() || "" + }_standardcharges.${state.fileType || ""}` const getAlertParams = () => { if (!(state.name.trim() && state.ein.trim() && state.fileType)) {