Class TylerCodesParser
java.lang.Object
edu.suffolk.litlab.efsp.tyler.ecfcodes.TylerCodesParser
- All Implemented Interfaces:
CodesParser,AutoCloseable
All of the Tyler code specific conversions and logic checks from our objects (really light
wrappers over the JSON objects).
The `vetXYZ` functions here check that the given inputs work with Tyler's expectations. They return Results; ok for this is good, and an error (with the specific typed-reason) when it will be rejected.
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.suffolk.litlab.efsp.ecfcodes.CodesParser
CodesParser.AttorneyError, CodesParser.BadCode, CodesParser.CodeError, CodesParser.CrossReferenceError, CodesParser.CumulativeDocsTooBig, CodesParser.DocTooBig, CodesParser.DueDateRequired, CodesParser.FileExtensionNotAllowed, CodesParser.FileNameError, CodesParser.FileNameTextError, CodesParser.FilingDocError, CodesParser.InputOptionalService, CodesParser.InvalidFilingAction, CodesParser.MissingRequiredRefs, CodesParser.MissingVar, CodesParser.NoMatchingCode, CodesParser.NoMatchingRef, CodesParser.NoMultipleAttorneys, CodesParser.RequiredAttorneys, CodesParser.RequiredCodeNotPresent, CodesParser.TextVarError, CodesParser.ThingRequired, CodesParser.TooLongVar, CodesParser.WrongRefVal, CodesParser.WrongVar -
Constructor Summary
ConstructorsConstructorDescriptionTylerCodesParser(CodeDatabase cd, DevelopmentPolicyParametersType policy, CourtLocationInfo court, boolean isIndividual) TylerCodesParser(CodeDatabase cd, DevelopmentPolicyParametersType policy, CourtLocationInfo court, DataFields allDataFields, boolean isIndividual) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()com.hubspot.algebra.Result<Map<String, String>, CodesParser.CrossReferenceError> getCrossRefIds(Map<String, String> crossRefs, CaseType caseType) getDocumentDescription(String description, String firstFileName, FilingCode filing) static Optional<CodesParser> makeParser(CodeDatabase cd, DevelopmentPolicyParametersType policy, String courtId, boolean isIndividual) retrieveFilingComponents(FilingCode filingCode) com.hubspot.algebra.Result<List<FilingCode>, CodesParser.BadCode> retrieveFilingOptions(CaseCategory caseCategory, CaseType type, boolean isInitialFiling) booleanGet if we need to add an association between filings and case parties.com.hubspot.algebra.Result<Optional<BigDecimal>, CodesParser.ThingRequired> vetAmountInControversy(Optional<BigDecimal> amt, List<FilingCode> filings) com.hubspot.algebra.Result<CaseCategory, CodesParser.CodeError> vetCaseCat(String caseCategoryCode) com.hubspot.algebra.Result<CaseType, CodesParser.CodeError> vetCaseType(String caseTypeCode, CaseCategory caseCategory, boolean isInitialFiling) com.hubspot.algebra.Result<Optional<String>, CodesParser.TextVarError> vetComment(Optional<String> maybeComment) com.hubspot.algebra.Result<Optional<NameAndCode>, CodesParser.CodeError> vetDamageAmount(boolean initial, CaseCategory cat, Optional<String> maybeDamageAmount) com.hubspot.algebra.Result<Optional<DocumentTypeTableRow>, CodesParser.CodeError> vetDocType(String docTypeStr, FilingCode filing) com.hubspot.algebra.Result<Optional<LocalDate>, CodesParser.DueDateRequired> vetDueDate(Optional<LocalDate> dueDate, FilingCode filing) com.hubspot.algebra.Result<Optional<String>, CodesParser.TextVarError> Throws if something is wrong; otherwise, an optional email (empty does not mean error!).com.hubspot.algebra.Result<String, CodesParser.FileNameError> vetFileName(String fileName) com.hubspot.algebra.Result<Optional<FilerType>, CodesParser.CodeError> vetFilerType(Optional<String> maybeFilerType) com.hubspot.algebra.Result<Optional<FilingAction>, CodesParser.InvalidFilingAction> vetFilingAction(Optional<FilingAction> filingAction, boolean isInitialFiling, boolean hasServiceContacts) com.hubspot.algebra.Result<Optional<String>, CodesParser.TextVarError> vetFilingAttorney(Optional<String> filingAttorney) com.hubspot.algebra.Result<FilingComponent, CodesParser.CodeError> vetFilingComponent(String filingComponent, ArrayList<FilingComponent> components) NOTE: modifies the components list, removing the selected component if allowmultiple is false.com.hubspot.algebra.Result<com.hubspot.algebra.NullValue, CodesParser.FilingDocError> vetFilingDocSize(List<FilingDoc> docs) com.hubspot.algebra.Result<List<PartyId>, CodesParser.ThingRequired> vetFilingParties(List<PartyId> filingParties) com.hubspot.algebra.Result<Optional<String>, CodesParser.TextVarError> vetFilingRefNum(Optional<String> fileRefNum) com.hubspot.algebra.Result<FilingCode, CodesParser.CodeError> vetFilingType(Optional<String> filingStr, List<FilingCode> filingOptions) com.hubspot.algebra.Result<String, CodesParser.TextVarError> vetFirstName(Optional<String> name) com.hubspot.algebra.Result<Optional<Person.Gender>, CodesParser.TextVarError> com.hubspot.algebra.Result<Optional<String>, CodesParser.CodeError> vetLangCode(Optional<String> lang) com.hubspot.algebra.Result<String, CodesParser.TextVarError> vetLastName(Optional<String> name) vetMaxAmount(Optional<BigDecimal> maxAmount) com.hubspot.algebra.Result<String, CodesParser.TextVarError> vetMiddleName(Optional<String> name) com.hubspot.algebra.Result<Optional<NameAndCode>, CodesParser.CodeError> vetMotionCode(Optional<String> motionCode, FilingCode filing) com.hubspot.algebra.Result<List<OptionalService>, List<CodesParser.CodeError>> vetOptionalServices(List<CodesParser.InputOptionalService> servs, FilingCode filing) Checks all of the optional services in one go.com.hubspot.algebra.Result<String, CodesParser.TextVarError> vetOrgName(String name) Doesn't return optional because we can set the People names to null / blank.vetPartyAttorneyMap(Map<PartyId, List<String>> partyAttyMap, Collection<PartyId> partyIdSet, Collection<String> attySet) com.hubspot.algebra.Result<Map<PartyId, PartyInfo>, CodesParser.CodeError> vetPartyTypes(Collection<Person> existingParties, Collection<Person> newParties, CaseType type, boolean isFirstIndexedFiling) existingPartyCodes: str of Tyler party ID to their role code string newPartyCodes: str of our generated ID of party to their role code stringcom.hubspot.algebra.Result<List<String>, CodesParser.TextVarError> vetPhoneNumbers(List<String> numbers) com.hubspot.algebra.Result<Optional<NameAndCode>, CodesParser.CodeError> vetProcedureRemedy(Optional<String> maybeProRem, boolean initial, CaseCategory cat) com.hubspot.algebra.Result<String, CodesParser.CodeError> vetStateCode(String state, String countryString) com.hubspot.algebra.Result<Optional<NameAndCode>, CodesParser.NoMatchingCode> vetSubType(String subtypeCode, CaseType caseType) com.hubspot.algebra.Result<String, CodesParser.CodeError>
-
Constructor Details
-
TylerCodesParser
public TylerCodesParser(CodeDatabase cd, DevelopmentPolicyParametersType policy, CourtLocationInfo court, DataFields allDataFields, boolean isIndividual) -
TylerCodesParser
public TylerCodesParser(CodeDatabase cd, DevelopmentPolicyParametersType policy, CourtLocationInfo court, boolean isIndividual)
-
-
Method Details
-
makeParser
public static Optional<CodesParser> makeParser(CodeDatabase cd, DevelopmentPolicyParametersType policy, String courtId, boolean isIndividual) -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
SQLException
-
vetCaseCat
public com.hubspot.algebra.Result<CaseCategory,CodesParser.CodeError> vetCaseCat(String caseCategoryCode) - Specified by:
vetCaseCatin interfaceCodesParser
-
vetCaseType
public com.hubspot.algebra.Result<CaseType,CodesParser.CodeError> vetCaseType(String caseTypeCode, CaseCategory caseCategory, boolean isInitialFiling) - Specified by:
vetCaseTypein interfaceCodesParser
-
vetSubType
public com.hubspot.algebra.Result<Optional<NameAndCode>,CodesParser.NoMatchingCode> vetSubType(String subtypeCode, CaseType caseType) - Specified by:
vetSubTypein interfaceCodesParser
-
retrieveFilingOptions
public com.hubspot.algebra.Result<List<FilingCode>,CodesParser.BadCode> retrieveFilingOptions(CaseCategory caseCategory, CaseType type, boolean isInitialFiling) - Specified by:
retrieveFilingOptionsin interfaceCodesParser
-
vetFilingType
public com.hubspot.algebra.Result<FilingCode,CodesParser.CodeError> vetFilingType(Optional<String> filingStr, List<FilingCode> filingOptions) - Specified by:
vetFilingTypein interfaceCodesParser
-
vetSuffix
public com.hubspot.algebra.Result<String,CodesParser.CodeError> vetSuffix(Optional<String> maybeSuffix) - Specified by:
vetSuffixin interfaceCodesParser
-
vetLangCode
public com.hubspot.algebra.Result<Optional<String>,CodesParser.CodeError> vetLangCode(Optional<String> lang) - Specified by:
vetLangCodein interfaceCodesParser
-
vetStateCode
public com.hubspot.algebra.Result<String,CodesParser.CodeError> vetStateCode(String state, String countryString) - Specified by:
vetStateCodein interfaceCodesParser
-
getCrossRefIds
public com.hubspot.algebra.Result<Map<String,String>, getCrossRefIdsCodesParser.CrossReferenceError> (Map<String, String> crossRefs, CaseType caseType) - Specified by:
getCrossRefIdsin interfaceCodesParser
-
vetPartyTypes
public com.hubspot.algebra.Result<Map<PartyId,PartyInfo>, vetPartyTypesCodesParser.CodeError> (Collection<Person> existingParties, Collection<Person> newParties, CaseType type, boolean isFirstIndexedFiling) existingPartyCodes: str of Tyler party ID to their role code string newPartyCodes: str of our generated ID of party to their role code string- Specified by:
vetPartyTypesin interfaceCodesParser- Returns:
- the combined map of tyler ids and our ids to each party type
-
vetFilingParties
public com.hubspot.algebra.Result<List<PartyId>,CodesParser.ThingRequired> vetFilingParties(List<PartyId> filingParties) - Specified by:
vetFilingPartiesin interfaceCodesParser
-
vetMotionCode
public com.hubspot.algebra.Result<Optional<NameAndCode>,CodesParser.CodeError> vetMotionCode(Optional<String> motionCode, FilingCode filing) - Specified by:
vetMotionCodein interfaceCodesParser
-
vetOptionalServices
public com.hubspot.algebra.Result<List<OptionalService>,List<CodesParser.CodeError>> vetOptionalServices(List<CodesParser.InputOptionalService> servs, FilingCode filing) Checks all of the optional services in one go. Can't return OptionalServiceCode, since it doesn't have the selected multiplier / fee amount.- Specified by:
vetOptionalServicesin interfaceCodesParser
-
retrieveFilingComponents
- Specified by:
retrieveFilingComponentsin interfaceCodesParser
-
vetFilingComponent
public com.hubspot.algebra.Result<FilingComponent,CodesParser.CodeError> vetFilingComponent(String filingComponent, ArrayList<FilingComponent> components) NOTE: modifies the components list, removing the selected component if allowmultiple is false.- Specified by:
vetFilingComponentin interfaceCodesParser- Parameters:
filingComponent-components-collector-- Returns:
-
vetDocType
public com.hubspot.algebra.Result<Optional<DocumentTypeTableRow>,CodesParser.CodeError> vetDocType(String docTypeStr, FilingCode filing) - Specified by:
vetDocTypein interfaceCodesParser
-
vetFilerType
public com.hubspot.algebra.Result<Optional<FilerType>,CodesParser.CodeError> vetFilerType(Optional<String> maybeFilerType) - Specified by:
vetFilerTypein interfaceCodesParser
-
vetProcedureRemedy
public com.hubspot.algebra.Result<Optional<NameAndCode>,CodesParser.CodeError> vetProcedureRemedy(Optional<String> maybeProRem, boolean initial, CaseCategory cat) - Specified by:
vetProcedureRemedyin interfaceCodesParser
-
vetDamageAmount
public com.hubspot.algebra.Result<Optional<NameAndCode>,CodesParser.CodeError> vetDamageAmount(boolean initial, CaseCategory cat, Optional<String> maybeDamageAmount) - Specified by:
vetDamageAmountin interfaceCodesParser
-
vetPartyAttorneyMap
public com.hubspot.algebra.Result<Optional<Map<PartyId,List<String>>>, vetPartyAttorneyMapCodesParser.AttorneyError> (Map<PartyId, List<String>> partyAttyMap, Collection<PartyId> partyIdSet, Collection<String> attySet) - Specified by:
vetPartyAttorneyMapin interfaceCodesParser
-
vetFilingAttorney
public com.hubspot.algebra.Result<Optional<String>,CodesParser.TextVarError> vetFilingAttorney(Optional<String> filingAttorney) - Specified by:
vetFilingAttorneyin interfaceCodesParser
-
vetEmail
public com.hubspot.algebra.Result<Optional<String>,CodesParser.TextVarError> vetEmail(Optional<String> email) Throws if something is wrong; otherwise, an optional email (empty does not mean error!).Note that the collector type is what determines if it throws.
- Specified by:
vetEmailin interfaceCodesParser- Parameters:
email-collector-- Returns:
-
vetPhoneNumbers
public com.hubspot.algebra.Result<List<String>,CodesParser.TextVarError> vetPhoneNumbers(List<String> numbers) - Specified by:
vetPhoneNumbersin interfaceCodesParser
-
vetFirstName
public com.hubspot.algebra.Result<String,CodesParser.TextVarError> vetFirstName(Optional<String> name) - Specified by:
vetFirstNamein interfaceCodesParser
-
vetMiddleName
public com.hubspot.algebra.Result<String,CodesParser.TextVarError> vetMiddleName(Optional<String> name) - Specified by:
vetMiddleNamein interfaceCodesParser
-
vetLastName
public com.hubspot.algebra.Result<String,CodesParser.TextVarError> vetLastName(Optional<String> name) - Specified by:
vetLastNamein interfaceCodesParser
-
vetOrgName
Doesn't return optional because we can set the People names to null / blank.- Specified by:
vetOrgNamein interfaceCodesParser- Parameters:
name-row-collector-var-- Returns:
-
vetGender
public com.hubspot.algebra.Result<Optional<Person.Gender>,CodesParser.TextVarError> vetGender(Optional<String> gender) - Specified by:
vetGenderin interfaceCodesParser
-
vetFilingRefNum
public com.hubspot.algebra.Result<Optional<String>,CodesParser.TextVarError> vetFilingRefNum(Optional<String> fileRefNum) - Specified by:
vetFilingRefNumin interfaceCodesParser
-
vetComment
public com.hubspot.algebra.Result<Optional<String>,CodesParser.TextVarError> vetComment(Optional<String> maybeComment) - Specified by:
vetCommentin interfaceCodesParser
-
vetDueDate
public com.hubspot.algebra.Result<Optional<LocalDate>,CodesParser.DueDateRequired> vetDueDate(Optional<LocalDate> dueDate, FilingCode filing) - Specified by:
vetDueDatein interfaceCodesParser
-
vetFilingAction
public com.hubspot.algebra.Result<Optional<FilingAction>,CodesParser.InvalidFilingAction> vetFilingAction(Optional<FilingAction> filingAction, boolean isInitialFiling, boolean hasServiceContacts) - Specified by:
vetFilingActionin interfaceCodesParser
-
getDocumentDescription
public Optional<String> getDocumentDescription(String description, String firstFileName, FilingCode filing) - Specified by:
getDocumentDescriptionin interfaceCodesParser
-
vetFileName
- Specified by:
vetFileNamein interfaceCodesParser
-
vetFilingDocSize
public com.hubspot.algebra.Result<com.hubspot.algebra.NullValue,CodesParser.FilingDocError> vetFilingDocSize(List<FilingDoc> docs) - Specified by:
vetFilingDocSizein interfaceCodesParser
-
vetAmountInControversy
public com.hubspot.algebra.Result<Optional<BigDecimal>,CodesParser.ThingRequired> vetAmountInControversy(Optional<BigDecimal> amt, List<FilingCode> filings) - Specified by:
vetAmountInControversyin interfaceCodesParser
-
vetMaxAmount
- Specified by:
vetMaxAmountin interfaceCodesParser
-
useFilingAssociations
public boolean useFilingAssociations()Get if we need to add an association between filings and case parties. Is simply a boolean because there's no filing error that needs to be swallowed.- Specified by:
useFilingAssociationsin interfaceCodesParser- Returns:
-