Package com.imsweb.mph.mpgroups
Class GroupUtility
java.lang.Object
com.imsweb.mph.mpgroups.GroupUtility
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareOppositeSides(String lat1, String lat2) checks if cancers are left and right sidestatic booleanareSameSide(String lat1, String lat2) checks if cancers are both on the left or right sidestatic intcompareDxDate(MphInput input1, MphInput input2) checks which tumor is diagnosed later.computeRange(String rawValue, boolean isSite) computes list of range values from stringstatic booleanchecks if one property belongs to some category and the other to different categoryexpandList(String rawValue) Expands list of string splitted by commas and ranges.expandList(List<String> list) Expands list of string splitted by commas and ranges.static StringgetSiteHistInfo(String site, String hist, String beh, int year) Returns the site, hist/beh information of the inputstatic booleanisContained(List<org.apache.commons.lang3.Range<Integer>> list, Integer value) Checks if integer value is in a list of rangesstatic booleanisPairedSites(String site1, String site2, List<String> pairedSites) checks if 2 sites are pairedstatic booleanisSiteContained(String list, String site) Checks if primary site is in rangestatic booleansameAndValidMainFields(MphInput i1, MphInput i2) checks if two cases have same and valid site, hist, behavior, date, lateralitystatic booleansameHistologies(String icd1, String icd2) checks if two morphologies are same except 8000 and 8010.static booleansameKnownDateParts(MphInput i1, MphInput i2) check if diagnosis dates are valid and samestatic booleansameValidDates(Integer year1, Integer month1, Integer day1, Integer year2, Integer month2, Integer day2) check if diagnosis dates are valid and samestatic booleanvalidateBehavior(String behavior) Validates behaviorstatic booleanvalidateHistology(String hist) Validates histologystatic booleanvalidateLaterality(String lat) checks if laterality is validstatic booleanvalidateProperties(String primarySite, String histology, String behavior, int year) Validates the provided input's primary site, histology, behavior and diagnosis year.static booleanvalidateSite(String site) Validates primary sitestatic booleanvalidateYear(int year) Validates diagnosis yearstatic booleanvalidPairedSiteLaterality(String lat1, String lat2) checks if lateralities are valid for paired sites, if they are either left or rightstatic intverifyDaysApart(MphInput input1, MphInput input2, int days) checks if the two tumors are diagnosed "x" days apart.static intverifyYearsApart(MphInput input1, MphInput input2, int yearsApart) checks if the two tumors are diagnosed "x" years apart.
-
Method Details
-
validateProperties
public static boolean validateProperties(String primarySite, String histology, String behavior, int year) Validates the provided input's primary site, histology, behavior and diagnosis year. These properties are required to determine the cancer group and used at least in one of the rules in each group. -
validateSite
Validates primary site -
validateHistology
Validates histology -
validateBehavior
Validates behavior -
validateYear
public static boolean validateYear(int year) Validates diagnosis year -
sameValidDates
public static boolean sameValidDates(Integer year1, Integer month1, Integer day1, Integer year2, Integer month2, Integer day2) check if diagnosis dates are valid and same -
sameHistologies
checks if two morphologies are same except 8000 and 8010. -
sameKnownDateParts
check if diagnosis dates are valid and same -
isContained
public static boolean isContained(List<org.apache.commons.lang3.Range<Integer>> list, Integer value) Checks if integer value is in a list of ranges -
computeRange
public static List<org.apache.commons.lang3.Range<Integer>> computeRange(String rawValue, boolean isSite) computes list of range values from string -
expandList
Expands list of string splitted by commas and ranges. -
expandList
Expands list of string splitted by commas and ranges. -
isSiteContained
Checks if primary site is in range -
differentCategory
public static boolean differentCategory(String prop1, String prop2, List<String> cat1, List<String> cat2) checks if one property belongs to some category and the other to different category -
isPairedSites
checks if 2 sites are paired -
validPairedSiteLaterality
checks if lateralities are valid for paired sites, if they are either left or right -
validateLaterality
checks if laterality is valid -
areOppositeSides
checks if cancers are left and right side -
areSameSide
checks if cancers are both on the left or right side -
sameAndValidMainFields
checks if two cases have same and valid site, hist, behavior, date, laterality -
compareDxDate
checks which tumor is diagnosed later. It returns 1 (if tumor 1 is diagnosed after tumor 2), 2 (if tumor 2 is diagnosed after tumor 1), 0 (if the diagnosis takes at the same day) or -1 (if there is insufficient information e.g if both year is 2007, but month and day is unknown) -
verifyYearsApart
checks if the two tumors are diagnosed "x" years apart. It returns Yes (1), No (0) or Unknown (-1) (If there is no enough information) -
verifyDaysApart
checks if the two tumors are diagnosed "x" days apart. It returns Yes (1), No (0) or Unknown (-1) (If there is no enough information) -
getSiteHistInfo
Returns the site, hist/beh information of the input
-