Data Cleaning

Herald has logic to transform the values of risk, coverage, and admin parameters. These rules are applied when submitting values in an application, and when making a submission. These rules are enforced to ensure that every value submitted to an institution is formatted correctly.

Rules

This is the full list of rules that Herald applies to values. Below, you can see the list of rules applied based on the input_type of a parameter.

This is the full set of rules as of 03/28/2024

TransformationDescriptionExamplesNotes
stringToNumberConvert string to number"1,000,000" → 1000000
"$100" → 100
Only cleans up correctly-spaced commas and single leading “$”. Does not handle "10,00" or "$$100".
cleanCharacterTranslates certain Unicode characters to ASCII replacements.” (U+201D) → " (U+0022)
‘ (U+201D) → ' (U+0022)
See the full list of UNICODE Translations.
handleNoneHandles situations where people submit none of the above along with another selection["None of the above", "Foobar"] → ["None of the above"]
cleanDomainRemoves http:// and https:// from beginning"https://foo.com" → "foo.com"
cleanDateConverts dates to match the pattern YYYY-MM-DD"2023-11-4" → "2023-11-04"
trimWhiteSpaceRemoves leading and trailing whitespace" foo " → "foo"
cleanPhoneRemoves non-digit characters and, if present, a leading 1 (country code)"+1 (222) 333-4444" → "2223334444"
cleanStateConverts full state names and state codes with malformed capitalization to well formed state codes"mA" → MA
"Massachusetts" → MA
cleanPostalCodeRemoves non-digit any anything after first 5 digits"02144-1234" → "02144"
emptyStringToNullConverts empty string to null"" → null⚠️ This only applies to address and claim_event today.

Input Types

Based on a parameters input type, the following rules will will be applied.

Input TypeTransformation (s)
integerstringToNumber
currencystringToNumber
stringtrimWhiteSpace
cleanCharacter
emailtrimWhiteSpace
domaincleanDomain
trimWhiteSpace
select_manyhandleNone
phonecleanPhone
address.line1trimWhiteSpace
cleanCharacter
address.line2trimWhiteSpace
emptyStringToNull
cleanCharacter
address.line3trimWhiteSpace
emptyStringToNull
cleanCharacter
address.organizationtrimWhiteSpace
cleanCharacter
address.citytrimWhiteSpace
cleanCharacter
address.statetrimWhiteSpace
cleanState
address.postal_codecleanPostalCode
address.country_codetrimWhiteSpace
claim_event.descriptiontrimWhiteSpace
emptyStringToNull
cleanCharacter

Unicode Translations

UNICODE characters that are translated as a part of the cleanCharacter transformation, and what characters they are replaced with.

CodeGlyphNameRep. CodeRep. GlyphRep. Name
U+2013–En DashU+002D-Hyphen-minus
U+2014—Em DashU+002D-Hyphen-minus
U+2015―Horizontal BarU+002D-Hyphen-minus
U+2018‘Left single quotation markU+0027'Apostrophe
U+2019’Right single quotation markU+0027'Apostrophe
U+201A‚Single low-9 quotation markU+0027'Apostrophe
U+201B‛Single high-reversed-9 quotation markU+0027'Apostrophe
U+201C“Left double quotation markU+0022"Quotation mark
U+201D”Right double quotation markU+0022"Quotation mark
U+201E„Double low-9 quotation markU+0022"Quotation mark
U+2022•BulletU+002D-Hyphen-minus
U+2032′PrimeU+0027'Apostrophe
U+2033″Double primeU+0022"Quotation mark
U+00E0àLowercase A with grave accentU+0061aLatin Small Letter A
U+00E1áLowercase A with acute accentU+0061aLatin Small Letter A
U+00E7çLowercase C with cedillaU+0063cLatin Small Letter C
U+00E8èLowercase E with grave accentU+0065eLatin Small Letter E
U+00E9éLowercase E with acute accentU+0065eLatin Small Letter E
U+00EAêLowercase E with circumflexU+0065eLatin Small Letter E
U+00EBëLowercase E with diaeresisU+0065eLatin Small Letter E
U+00EDíLowercase I with acute accentU+0069iLatin Small Letter I
U+00EEîLowercase I with circumflexU+0069iLatin Small Letter I
U+00EFïLowercase I with diaeresisU+0069iLatin Small Letter I
U+00F1ñLowercase N with tildeU+006EnLatin Small Letter N
U+00F3óLowercase O with acute accentU+006FoLatin Small Letter O
U+00F4ôLowercase O with circumflexU+006FoLatin Small Letter O
U+00FAúLowercase U with acute accentU+0075uLatin Small Letter U
U+00FBûLowercase U with circumflexU+0075uLatin Small Letter U
U+00FCüLowercase U with diaeresisU+0075uLatin Small Letter U