diff --git a/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.scss b/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.scss index 26ac2967d0..ab7ddad40e 100644 --- a/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.scss +++ b/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.scss @@ -40,3 +40,20 @@ font-style: normal; } } + +.csv-section-tablist { + li:first-child { + padding-left: 0; + } + + .tab-button { + display: inline-block; + } + + .tab-selected, + .tab-button:hover { + border-bottom: 0.25rem solid #005ea2; + padding-bottom: 0.5rem; + cursor: pointer; + } +} diff --git a/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.test.tsx b/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.test.tsx index fa81c2ed20..cbc296f007 100644 --- a/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.test.tsx +++ b/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.test.tsx @@ -10,7 +10,10 @@ import CsvSchemaDocumentation, { CsvSchemaItem, getPageTitle, } from "./CsvSchemaDocumentation"; -import { specificSchemaBuilder } from "./specificSchemaBuilder"; +import { + RequiredStatusTag, + specificSchemaBuilder, +} from "./specificSchemaBuilder"; jest.mock("../../TelemetryService", () => ({ ...jest.requireActual("../../TelemetryService"), @@ -21,8 +24,7 @@ window.scrollTo = jest.fn(); const baseItem: CsvSchemaItem = { name: "Sample Item", colHeader: "sample_item", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, acceptedValues: [], description: [], subHeader: [], @@ -50,7 +52,7 @@ describe("CsvSchemaDocumentation tests", () => { it("renders a required schema item", () => { const item = { ...baseItem, - required: true, + requiredStatusTag: RequiredStatusTag.REQUIRED, }; render(); expect(screen.getByText("Required")).toBeInTheDocument(); @@ -59,22 +61,22 @@ describe("CsvSchemaDocumentation tests", () => { it("renders a optional schema item", () => { const item = { ...baseItem, - required: false, }; render(); expect(screen.getByText("Optional")).toBeInTheDocument(); }); - it("renders a requested schema item", () => { + it("renders a required when positive schema item", () => { const item = { ...baseItem, - requested: true, + requiredStatusTag: RequiredStatusTag.REQUIRED_FOR_POSITIVES, }; render(); - expect(screen.queryByText("Required")).not.toBeInTheDocument(); expect(screen.queryByText("Optional")).not.toBeInTheDocument(); const header = screen.getByTestId("header"); - expect(within(header).getByText("Requested")).toBeInTheDocument(); + expect( + within(header).getByText("Required for Positives") + ).toBeInTheDocument(); }); it("renders a schema item with description", () => { @@ -161,6 +163,34 @@ describe("CsvSchemaDocumentation tests", () => { ); expect(container).toMatchSnapshot(); }); + it("has working tabs for navigation", async () => { + render( + + + + } + /> + + + ); + const user = userEvent.setup(); + + expect(screen.getAllByText("Required for Positives")).toHaveLength(1); + + const hivAoeTab = screen.getByRole("tab", { + name: "HIV", + }); + + await user.click(hivAoeTab); + + expect(screen.getAllByText("Required for Positives")).toHaveLength(2); + }); it("logs to App Insights on template download", async () => { const mockTrackEvent = jest.fn(); (getAppInsights as jest.Mock).mockImplementation(() => { diff --git a/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.tsx b/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.tsx index 8d3ed5e5ac..4870c3d70d 100644 --- a/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.tsx +++ b/frontend/src/app/testResults/uploads/CsvSchemaDocumentation.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React, { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; import { LinkWithQuery } from "../../commonComponents/LinkWithQuery"; @@ -9,18 +9,17 @@ import ScrollToTopOnMount from "../../commonComponents/ScrollToTopOnMount"; import { getFacilityIdFromUrl } from "../../utils/url"; import { BULK_UPLOAD_SUPPORTED_DISEASES_COPY_TEXT } from "../../../config/constants"; -import { CsvSchema } from "./specificSchemaBuilder"; +import { CsvSchema, RequiredStatusTag, Section } from "./specificSchemaBuilder"; export type CsvSchemaItem = { name: string; colHeader: string; - required: boolean; - requested: boolean; acceptedValues?: string[]; description?: string[]; subHeader?: string[]; format?: string; examples?: string[]; + requiredStatusTag?: RequiredStatusTag; }; type CsvSchemaItemProps = { @@ -40,19 +39,20 @@ export const CsvSchemaDocumentationItem: React.FC = ({ data-testid="header" > {item.name} - {item.required && ( + {item.requiredStatusTag === RequiredStatusTag.REQUIRED && ( Required )} - {!item.required && item.requested && ( - - Requested + {item.requiredStatusTag === + RequiredStatusTag.REQUIRED_FOR_POSITIVES && ( + + Required for Positives )} - {!item.required && !item.requested && ( + {item.requiredStatusTag === RequiredStatusTag.OPTIONAL && ( Optional @@ -158,6 +158,65 @@ interface CsvSchemaDocumentationProps { returnUrl: string; } +const buildDefaultTabSectionState = (schema: CsvSchema) => { + let tabSectionState: Record = {}; + schema.fields.forEach((field) => + field.sections.forEach((section) => { + // only set a default if there isn't a value for this key + if (section.tabs && !tabSectionState[section.slug]) { + tabSectionState[section.slug] = section.tabs[0].title; + } + }) + ); + return tabSectionState; +}; + +interface SectionTabButtonProps { + selected: boolean; + parentSection: Section; + tabSection: Section; + setTabSectionState: React.Dispatch< + React.SetStateAction> + >; + index: number; +} + +const SectionTabButton = ({ + selected, + parentSection, + tabSection, + setTabSectionState, + index, +}: SectionTabButtonProps) => { + return ( +
+ +
+ ); +}; + const CsvSchemaDocumentation: React.FC = ({ schemaBuilder, returnUrl, @@ -173,6 +232,9 @@ const CsvSchemaDocumentation: React.FC = ({ const appInsights = getAppInsights(); const activeFacilityId = getFacilityIdFromUrl(location); const schema = schemaBuilder(activeFacilityId); + const [tabSectionState, setTabSectionState] = useState( + buildDefaultTabSectionState(schema) + ); return (
@@ -313,23 +375,44 @@ const CsvSchemaDocumentation: React.FC = ({

Include data for all required fields

- The data template has three field types: required, requested, and - optional. SimpleReport won’t accept files with missing or incorrect - headers and values in required fields. Requested fields are not - required by HHS, but the data is helpful to jurisdictions. The tags - next to data element names listed below show field type: -

-

- - Required - - - Requested - - - Optional - + The data template has three field types: Required, Required for + Positives, and Optional. SimpleReport won’t accept files with + missing or incorrect headers and values in required fields. You'll + find these tags throughout the template to guide you through data + requirements:

+
+
+ + Required + +
+
+ "Required" fields are legally required by HHS. +
+
+
+
+ + Required for Positives + +
+
+ "Required for Positives" fields are legally required by HHS for + positive test results. +
+
+
+
+ + Optional + +
+
+ "Optional" fields are not legally required by HHS, but the data is + helpful to jurisdictions. +
+
@@ -365,6 +448,45 @@ const CsvSchemaDocumentation: React.FC = ({ className="margin-bottom-5" > {field.sections?.map((section) => { + let sectionToRender = section; + let tabHeading; + if (section.tabs && section.tabs.length > 0) { + let tabIds = ""; + section.tabs.forEach((tabSection) => { + tabIds = tabIds + `${section.slug}-${tabSection.slug}-tab `; + }); + tabHeading = ( + + ); + sectionToRender = section.tabs.filter( + (tabSection) => + tabSectionState[section.slug] === tabSection.title + )[0]; + } return (
= ({ >

{section.title}

- {section.items?.map((item) => { + {tabHeading} + + {sectionToRender.items?.map((item) => { return (

- The data template has three field types: required, requested, and optional. SimpleReport won’t accept files with missing or incorrect headers and values in required fields. Requested fields are not required by HHS, but the data is helpful to jurisdictions. The tags next to data element names listed below show field type: + The data template has three field types: Required, Required for Positives, and Optional. SimpleReport won’t accept files with missing or incorrect headers and values in required fields. You'll find these tags throughout the template to guide you through data requirements:

-

- +

- Required - - + Required + +
+
- Requested - - +
+
+
- Optional - -

+ + Required for Positives + +
+
+ "Required for Positives" fields are legally required by HHS for positive test results. +
+
+
+
+ + Optional + +
+
+ "Optional" fields are not legally required by HHS, but the data is helpful to jurisdictions. +
+
- Requested + Optional
Ask on entry (AOE) +
@@ -4803,7 +4875,7 @@ exports[`CsvSchemaDocumentation tests CsvSchemaDocumentation matches snapshot 1` - Requested + Optional
- Requested + Optional
- Requested + Optional
- Requested + Optional
- Requested + Optional
- Requested + Optional
- Requested + Optional
{ +const aoeDocumententationItems: Record = { + pregnant: { + name: "Pregnant", + colHeader: "pregnant", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + acceptedValues: [ + "Y or YES", + "N or NO", + "U or UNK", + ], + format: "Use one of the accepted values listed below", + }, + employed_in_healthcare: { + name: "Employed in healthcare", + colHeader: "employed_in_healthcare", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + acceptedValues: [ + "Y or YES", + "N or NO", + "U or UNK", + ], + format: "Use one of the accepted values listed below", + }, + symptomatic_for_disease: { + name: "Symptomatic for disease", + colHeader: "symptomatic_for_disease", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + acceptedValues: [ + "Y or YES", + "N or NO", + "U or UNK", + ], + format: "Use one of the accepted values listed below.", + }, + illness_onset_date: { + name: "Illness onset date", + colHeader: "illness_onset_date", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + format: "M/D/YYYY", + examples: ["9/2/2022", "10/13/2021"], + description: ["Date"], + }, + resident_congregate_setting: { + name: "Resident congregate setting", + colHeader: "resident_congregate_setting", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + acceptedValues: [ + "Y or YES", + "N or NO", + "U or UNK", + ], + format: + "If the patient lives in a setting with shared group spaces, such as assisted living or a prison.
Use one of the accepted values listed below.", + }, + residence_type: { + name: "Residence type", + colHeader: "residence_type", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + format: "Use one of the accepted values listed below", + acceptedValues: [ + "Hospital or 22232009", + "Hospital Ship or 2081004", + "Long Term Care Hospital or 32074000", + "Secure Hospital or 224929004", + "Nursing Home or 42665001", + "Retirement Home or 30629002", + "Orphanage or 74056004", + "Prison-based Care Site or 722173008", + "Substance Abuse Treatment Center or 20078004", + "Boarding House or 257573002", + "Military Accommodation or 224683003", + "Hospice or 284546000", + "Hostel or 257628001", + "Sheltered Housing or 310207003", + "Penal Institution or 57656006", + "Religious Institutional Residence or 285113009", + "Work (environment) or 285141008", + "Homeless or 32911000", + ], + description: [ + "If the resident congregate setting is “Y” or “Yes,” then provide residence type", + ], + }, + hospitalized: { + name: "Hospitalized", + colHeader: "hospitalized", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + acceptedValues: [ + "Y or YES", + "N or NO", + "U or UNK", + ], + format: + "If the patient tested was admitted to a hospital for treatment.
Use one of the accepted values listed below.", + }, + icu: { + name: "Intensive care unit", + colHeader: "icu", + requiredStatusTag: RequiredStatusTag.OPTIONAL, + acceptedValues: [ + "Y or YES", + "N or NO", + "U or UNK", + ], + format: "Use one of the accepted values listed below", + }, +}; + +export const specificSchemaBuilder = (facilityId: string | null): CsvSchema => { const validUuid = facilityId && validate(facilityId) ? facilityId : ""; const deviceCodeLookupLink = `device code lookup tool`; const livdSpreadsheetLink = @@ -42,8 +150,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient ID", colHeader: "patient_id", - required: false, - requested: true, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: ["1234", "P2300"], description: [ "Enter unique patient identifier. This is typically the Medical Record Number. Do not send a Social Security Number.", @@ -53,29 +160,25 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient last name", colHeader: "patient_last_name", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, description: ["Last name, separated from first name"], }, { name: "Patient first name", colHeader: "patient_first_name", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, description: ["First name, separated from last name"], }, { name: "Patient middle name", colHeader: "patient_middle_name", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, description: ["Middle name, if known"], }, { name: "Patient street address", colHeader: "patient_street", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, acceptedValues: [ "Example: 1234 America Ln", "** Unknown / Not Given **", @@ -88,15 +191,13 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient street address line 2", colHeader: "patient_street2", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: ["Apartment 4C"], }, { name: "Patient city", colHeader: "patient_city", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["Los Angeles", "Madison"], description: [ 'If a patient’s city is unknown or they’re experiencing homelessness, use ordering facility city', @@ -105,24 +206,21 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient state", colHeader: "patient_state", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "Two-character state abbreviation", examples: ["TX", "CA"], }, { name: "Patient county", colHeader: "patient_county", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["Kings County", "Allen Parish"], description: ["County or parish name"], }, { name: "Patient zip code", colHeader: "patient_zip_code", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "5 or 9 digit zip code", examples: ["12345", "12345-6789"], description: [ @@ -132,8 +230,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient phone number", colHeader: "patient_phone_number", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "000-000-0000", examples: ["123-456-7890"], description: [ @@ -143,16 +240,14 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient date of birth", colHeader: "patient_dob", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "M/D/YYYY", examples: ["3/30/1972", "12/8/2002"], }, { name: "Patient gender", colHeader: "patient_gender", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, acceptedValues: [ "M or Male", "F or Female", @@ -168,8 +263,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient race", colHeader: "patient_race", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, acceptedValues: [ "American Indian or Alaska Native or 1002-5", "Asian or 2028-9", @@ -187,8 +281,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient ethnicity", colHeader: "patient_ethnicity", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, acceptedValues: [ "2135-2 or Hispanic or Latino", "2186-5 or Not Hispanic or Latino", @@ -201,8 +294,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient preferred language ", colHeader: "patient_preferred_language", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: [ 'eng or English', 'spa or Spanish', @@ -214,8 +306,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Patient email", colHeader: "patient_email", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "Email address", examples: ["janedoe@person.com"], }, @@ -228,8 +319,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Accession number", colHeader: "accession_number ", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["ID12345-6789"], description: [ "A unique ID that identifies a single result, which allows public health departments to refer back to a test event.", @@ -238,8 +328,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Equipment model name", colHeader: "equipment_model_name", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: [ "ID NOW", "BD Veritor System for Rapid Detection of SARS-CoV-2*", @@ -254,8 +343,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Test kit name ID", colHeader: "test_kit_name_id", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: [ "CareStart COVID-19 IgM/IgG_Access Bio, Inc.", @@ -271,8 +359,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Equipment model ID", colHeader: "equipment_model_id", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: [ "No Equipment", @@ -288,8 +375,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Test performed LOINC code", colHeader: "test_performed_code", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "00000-0", examples: [ "94534-5", @@ -305,8 +391,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Test ordered LOINC code", colHeader: "test_ordered_code", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "00000-0", examples: [ "94534-5", @@ -320,8 +405,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Test result", colHeader: "test_result", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, acceptedValues: [ "Positive", "Negative", @@ -337,8 +421,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Order test date", colHeader: "order_test_date", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "M/D/YYYY HH:mm TZ is preferred, but M/D/YYYY HH:mm and M/D/YYYY are acceptable", examples: ["5/23/2023 4:30 CT", "11/2/2022 14:17", "9/21/2022"], @@ -350,8 +433,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Specimen collection date", colHeader: "specimen_collection_date", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "M/D/YYYY HH:mm TZ is preferred, but M/D/YYYY HH:mm and M/D/YYYY are also acceptable", examples: ["5/23/2023 4:30 CT", "11/2/2022 14:17", "9/21/2022"], @@ -364,8 +446,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Testing lab specimen received date", colHeader: "testing_lab_specimen_received_date", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "M/D/YYYY HH:mm TZ is preferred, but M/D/YYYY HH:mm and M/D/YYYY are also acceptable", examples: ["5/23/2023 4:30 CT", "11/2/2022 14:17", "9/21/2022"], @@ -378,8 +459,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Test result date", colHeader: "test_result_date", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "M/D/YYYY HH:mm TZ is preferred, but M/D/YYYY HH:mm and M/D/YYYY are also acceptable", examples: ["5/23/2023 4:30 CT", "11/2/2022 14:17", "9/21/2022"], @@ -391,8 +471,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Date result released", colHeader: "date_result_released", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "M/D/YYYY HH:mm TZ is preferred, but M/D/YYYY HH:mm and M/D/YYYY are also acceptable", examples: ["5/23/2023 4:30 CT", "11/2/2022 14:17", "9/21/2022"], @@ -411,8 +490,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Specimen type", colHeader: "specimen_type", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: [ "258607008", "258500001", @@ -433,8 +511,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering provider ID", colHeader: "ordering_provider_id", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: 'NPI number or local code', examples: [ @@ -448,66 +525,57 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering provider last name", colHeader: "ordering_provider_last_name", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, description: ["Last name, separated from first name"], }, { name: "Ordering provider first name", colHeader: "ordering_provider_first_name", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, description: ["First name, separated from last name"], }, { name: "Ordering provider middle name", colHeader: "ordering_provider_middle_name", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, description: ["Middle name, if known"], }, { name: "Ordering provider street address", colHeader: "ordering_provider_street", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["1234 America Ln"], }, { name: "Ordering provider street address line 2", colHeader: "ordering_provider_street2", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: ["Suite 5C"], }, { name: "Ordering provider city", colHeader: "ordering_provider_city", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["Los Angeles", "Madison"], }, { name: "Ordering provider state", colHeader: "ordering_provider_state", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "Two-character state abbreviation", examples: ["TX", "CA"], }, { name: "Ordering provider zip code", colHeader: "ordering_provider_zip_code", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "5 or 9 digit zip code", examples: ["12345", "12345-6789"], }, { name: "Ordering provider phone number", colHeader: "ordering_provider_phone_number", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "000-000-0000", examples: ["123-456-7890"], }, @@ -520,8 +588,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Testing lab CLIA number", colHeader: "testing_lab_clia", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["11D2030855"], description: [ 'CLIA number from the CDC Laboratory Search', @@ -530,52 +597,45 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Testing lab name", colHeader: "testing_lab_name", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, description: ["Name of facility that processed test results"], }, { name: "Testing lab street address", colHeader: "testing_lab_street", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["1234 America St"], }, { name: "Testing lab street address line 2", colHeader: "testing_lab_street2", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: ["Unit 4"], }, { name: "Testing lab city", colHeader: "testing_lab_city", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, examples: ["Dallas", "Madison"], }, { name: "Testing lab state", colHeader: "testing_lab_state", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "Two-character state abbreviation", examples: ["FL", "CA"], }, { name: "Testing lab zip code", colHeader: "testing_lab_zip_code", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "5 or 9 digit zip code", examples: ["54321", "12345-6789"], }, { name: "Testing lab phone number", colHeader: "testing_lab_phone_number", - required: true, - requested: false, + requiredStatusTag: RequiredStatusTag.REQUIRED, format: "000-000-0000", examples: ["123-654-7890"], }, @@ -584,121 +644,33 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { title: "Ask on entry (AOE)", slug: "ask-on-entry", - items: [ - { - name: "Pregnant", - colHeader: "pregnant", - required: false, - requested: true, - acceptedValues: [ - "Y or YES", - "N or NO", - "U or UNK", - ], - format: "Use one of the accepted values listed below", - }, - { - name: "Employed in healthcare", - colHeader: "employed_in_healthcare", - required: false, - requested: true, - acceptedValues: [ - "Y or YES", - "N or NO", - "U or UNK", - ], - format: "Use one of the accepted values listed below", - }, + tabs: [ { - name: "Symptomatic for disease", - colHeader: "symptomatic_for_disease", - required: false, - requested: true, - acceptedValues: [ - "Y or YES", - "N or NO", - "U or UNK", + title: MULTIPLEX_DISEASES.COVID_19, + slug: MULTIPLEX_DISEASES.COVID_19, + items: [ + aoeDocumententationItems.pregnant, + aoeDocumententationItems.employed_in_healthcare, + aoeDocumententationItems.symptomatic_for_disease, + aoeDocumententationItems.illness_onset_date, + aoeDocumententationItems.resident_congregate_setting, + aoeDocumententationItems.residence_type, + aoeDocumententationItems.hospitalized, + aoeDocumententationItems.icu, ], - format: "Use one of the accepted values listed below.", - }, - { - name: "Illness onset date", - colHeader: "illness_onset_date", - required: false, - requested: true, - format: "M/D/YYYY", - examples: ["9/2/2022", "10/13/2021"], - description: ["Date"], }, { - name: "Resident congregate setting", - colHeader: "resident_congregate_setting", - required: false, - requested: true, - acceptedValues: [ - "Y or YES", - "N or NO", - "U or UNK", - ], - format: - "If the patient lives in a setting with shared group spaces, such as assisted living or a prison.
Use one of the accepted values listed below.", - }, - { - name: "Residence type", - colHeader: "residence_type", - required: false, - requested: false, - format: "Use one of the accepted values listed below", - acceptedValues: [ - "Hospital or 22232009", - "Hospital Ship or 2081004", - "Long Term Care Hospital or 32074000", - "Secure Hospital or 224929004", - "Nursing Home or 42665001", - "Retirement Home or 30629002", - "Orphanage or 74056004", - "Prison-based Care Site or 722173008", - "Substance Abuse Treatment Center or 20078004", - "Boarding House or 257573002", - "Military Accommodation or 224683003", - "Hospice or 284546000", - "Hostel or 257628001", - "Sheltered Housing or 310207003", - "Penal Institution or 57656006", - "Religious Institutional Residence or 285113009", - "Work (environment) or 285141008", - "Homeless or 32911000", - ], - description: [ - "If the resident congregate setting is “Y” or “Yes,” then provide residence type", - ], - }, - { - name: "Hospitalized", - colHeader: "hospitalized", - required: false, - requested: true, - acceptedValues: [ - "Y or YES", - "N or NO", - "U or UNK", - ], - format: - "If the patient tested was admitted to a hospital for treatment.
Use one of the accepted values listed below.", - }, - { - name: "Intensive care unit", - colHeader: "icu", - required: false, - requested: true, - acceptedValues: [ - "Y or YES", - "N or NO", - "U or UNK", + title: MULTIPLEX_DISEASES.HIV, + slug: MULTIPLEX_DISEASES.HIV, + items: [ + { + ...aoeDocumententationItems.pregnant, + requiredStatusTag: RequiredStatusTag.REQUIRED_FOR_POSITIVES, + }, ], - format: "Use one of the accepted values listed below", }, ], + items: [], }, { title: "Ordering facility", @@ -707,8 +679,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering facility name", colHeader: "ordering_facility_name", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, description: [ 'You can leave this field blank if it’s the same as testing_lab_name', ], @@ -716,8 +687,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering facility street address", colHeader: "ordering_facility_street", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, description: [ 'You can leave this field blank if it’s the same as testing_lab_street', ], @@ -725,15 +695,13 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering facility street address line 2", colHeader: "ordering_facility_street2", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, description: ["Address, continued"], }, { name: "Ordering facility city", colHeader: "ordering_facility_city", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, description: [ 'You can leave this field blank if it’s the same as testing_lab_city', ], @@ -741,8 +709,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering facility state", colHeader: "ordering_facility_state", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "Two-character state abbreviation", description: [ 'You can leave this field blank if it’s the same as testing_lab_state', @@ -752,8 +719,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering facility zip code", colHeader: "ordering_facility_zip_code", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "5 or 9 digit zip code", examples: ["12345", "12345-6789"], description: [ @@ -763,8 +729,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Ordering facility phone number", colHeader: "ordering_facility_phone_number", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, examples: ["123-456-7890"], format: "000-000-0000", description: [ @@ -780,8 +745,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Comment", colHeader: "comment", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "Do not include commas (,) in any comments", description: [ "If there are comments from a physician or lab technician you want to relay to your public health department, enter them here. This field isn't meant for characteristics of the condition tested or statements about false positive or negative results.", @@ -790,8 +754,7 @@ export const specificSchemaBuilder = (facilityId: string | null) => { { name: "Test result status", colHeader: "test_result_status ", - required: false, - requested: false, + requiredStatusTag: RequiredStatusTag.OPTIONAL, format: "Use one of the accepted values below", acceptedValues: [ "F = Final result",