Purpose: Visual verification of the combined IBHRS form.
Sections: Client Data, Treatment Episode, Service Event
File: combinediowareportingforms.json
Download JSON
Changelog / Applied Changes
v16 - Removed EMR Auto-Populated Client Fields
- Removed 13 client data fields that will be auto-populated from EMR Patients table:
firstName, middleName, lastName, suffix
birthDate, sex, genderIdentity, sexualOrientation
ethnicity, providerClientRaces
emailAddresses, providerClientIdentifiers, providerClientPhysicalAddresses
- Retained
providerClientPhones with updated label and description: "Please enter the patient's phone number(s). If a phone number exists in the EMR, re-enter it here to include it in the IBHRS submission."
- Added info message at top of Client Data section explaining that demographic info will be auto-populated from EMR
- Created
removed-emr-fields-metadata.json with full field definitions for reference
- Export note: When exporting, check EMR Patients table first for these fields. Only use form data if EMR field is null/empty.
v15 - Removed IBHRS Explanatory Content
- Cleared 8 IBHRS-specific explanatory content blocks that referenced the IBHRS Data Entry Screens
- Removed content blocks:
- Client Data Section: "Client Data Set" description, "Provider" description
- Treatment Episodes: "Treatment Episode Data Set" description, "Provider" description, "Provider Site" description, "Predecessor Care Status" description
- Service Events: "Service Event Data Set" description, "Provider" description
- These blocks contained instructions like "IBHRS will default to your Provider Agency..." which are not relevant for the form itself
- Content blocks are preserved (empty) to maintain form structure
v14 - Extended Conditional Fields
- Program Area Dependent Fields (6 fields):
daysSubstanceUsedInPast30Days - Show only for Substance Use Disorder Treatment
daysGambledInPast30Days - Show only for Gambling Treatment
everDeclaredBankruptcy - Show only for Gambling Treatment
moneyLostGamblingInPast30Days - Show only for Gambling Treatment
arrestsInPast30DaysKnown1 (Gambling Arrests) - Show when arrests known AND Gambling
arrestsInPast30DaysKnown2 (Substance Arrests) - Show when arrests known AND Substance Use
- Known Field Dependent Fields (6 fields):
monthlyHouseholdIncomeAmount - Show when income known
children17AndUnderCount, custodyOfChildren17AndUnderCount - Show when children known
arrestsInPast30Days - Show when arrests known
arrestsInPast30Days1 (Lifetime Overdoses) - Show when overdoses known
lifetimeTreatedOverdoses - Show when lifetime overdoses > 0
- Other Dependent Fields (3 fields):
childrenInCareWithClientCount - Show when Special Initiative is Women and Children
treatmentLocationType - Show when Was Treated is Yes
interestedInReceivingHelpWithSymptom - Show when Receiving Help is No
- Updated
conditional-fields-metadata.json with all conditional field definitions
- Documented key naming issues (e.g.,
arrestsInPast30Days1 should be lifetimeOverdosesCount)
v13 - Conditional Fields Metadata
- Created
conditional-fields-metadata.json for data export mappers
- Comprehensive documentation of all conditional field rules
- Helper function templates for export processing
v12 - Care Status Conditional Field Visibility
- Implemented IBHRS Care Status conditional requirements
- Pre-Admission: Only status, statusDate, careStatusIdentifier visible; ASAM fields hidden
- Admission: Prior episode fields visible and required; discharge fields hidden
- Transfer/Discharge: dischargeReason visible and required; prior episode fields hidden
- Discharge only: concernedPersonInvolved visible and required
- Fields implemented:
programArea, inCareForMentalHealthDisorder, priorSubstanceUseEpisodeKnown/Count, priorGamblingEpisodeKnown/Count, priorMentalHealthEpisodeKnown/Count, concernedPersonInvolved, dischargeReason, clinicalOverrideReason
- Container sections (columns11-19) also hidden appropriately
v11 - Pre-v12 Backup
- Backup created before implementing Care Status conditional visibility
v10 - Data Persistence (clearOnHide=false)
- Set
clearOnHide: false on all form components
- Ensures data is preserved when switching between Care Status types
- Set
validateWhenHidden: false to prevent validation errors on hidden fields
- Critical for IBHRS where users may need to switch between statuses without losing data
v9 - Editgrid Labels & Required Linkage
- Editgrid row templates now show labels instead of values (e.g., "Pre-Admission" instead of "preAdmission")
- Treatment Episodes: Status field displays human-readable labels
- Service Events: Service Type displays labels, Episode ID falls back to select value
- Added symmetric validation on Episode/Care Status linkage fields - at least one (select or manual) must be filled
v8 - Validation & Phone Fixes
- Fixed editgrid validation context:
data.fieldName → row.fieldName
- Manual entry fields (Episode ID, Care Status ID) now correctly check sibling select box values
- Fixed phone number input mask to
999-999-9999 format
- Removed obsolete "Service Event Care Status" info text
v7 - Email Field Conversion
v6 - Linkage Fields Fixes
careStatusIdentifier now auto-generates with CS- prefix (e.g., CS-A1B2C3D4-...)
- Episode select box label format:
EP-XXX (status) - no longer includes care status
- Care Status select box label format:
CS-XXX (status) [Episode: EP-XXX]
- Manual entry fields (Episode ID, Care Status ID) are now conditionally required:
- Only required if no selection made in the corresponding select box
- Validation message guides user to either select or enter manually
v5 - Repeatable Sections with Editgrid
- Wrapped Treatment Episode panel in
editgrid (key: treatmentEpisodes)
- Wrapped Service Event panel in
editgrid (key: serviceEvents)
- Added
careStatusIdentifier field to Treatment Episode
- Added select boxes for linkage:
linkedEpisodeIdentifierSelect - select episode from current submission
linkedCareStatusIdentifierSelect - select care status from current submission
- Kept text fields for manual entry (for linking to previous submissions)
v4 - Datagrid Attempt (Reverted)
- Changed editgrid to datagrid - columns were too condensed
- Removed section checkboxes
- Reverted back to editgrid in v5
v3 - Initial Repeatable Transformation
- First attempt at making Treatment Episodes and Service Events repeatable
- Added linkage select boxes
v2 - Before Repeatable Transformation
- Original combined form structure
- Single Treatment Episode and Service Event sections
v1 - Original Combined Form
- Initial combined form with Client Data, Treatment Episode, and Service Event sections
Linkage Priority Rules (for Export Code)
When processing ServiceEvent data in export mappers, linkage fields have TWO sources:
- Select box - for linking to episodes/care statuses in the CURRENT submission
- Text field - for manual entry (linking to PREVIOUS submissions)
Priority: Text field takes precedence over select box if both are filled.
// Episode linkage
const episodeId = data.linkedEpisodeIdentifier || data.linkedEpisodeIdentifierSelect;
// Care Status linkage
const careStatusId = data.linkedCareStatusIdentifier || data.linkedCareStatusIdentifierSelect;
See LINKAGE_PRIORITY.md for detailed documentation.
Conditional Fields Reference (for Export Code)
Many fields are conditionally visible based on:
- Care Status - Pre-Admission, Admission, Transfer, Discharge
- Program Area - Substance Use Disorder Treatment, Gambling Treatment
- Known Fields - Count fields show only when corresponding "Known" field is "yes"
- Other Dependencies - e.g., Treatment Location shows only when "Was Treated" is "yes"
Export mappers should check conditional visibility before including fields.
// Example: Check if field should be exported
const metadata = require('./conditional-fields-metadata.json');
const field = metadata.conditionalFields.treatmentEpisodes
.knownFieldDependentFields.find(f => f.key === 'monthlyHouseholdIncomeAmount');
// Only export if condition is met
if (rowData.monthlyHouseholdIncomeKnown === 'yes') {
// Export monthlyHouseholdIncomeAmount
}
See conditional-fields-metadata.json for complete field definitions and export notes.
Testing Conditional Fields
To test conditional field visibility:
- Load the form and expand the Treatment Episode section
- Change the Status field to different values:
- Pre-Admission: Most fields should be hidden
- Admission: Prior episode fields should appear
- Transfer/Discharge: Discharge Reason should appear, Prior fields hidden
- Change the Program Area field:
- Substance Use: Days Substance Used, Substance-related arrests visible
- Gambling: Days Gambled, Bankruptcy, Money Lost, Gambling arrests visible
- Toggle Known fields to Yes/No to see count fields appear/disappear