Class GroupUtility

java.lang.Object
com.imsweb.mph.mpgroups.GroupUtility

public class GroupUtility extends Object
  • 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

      public static boolean validateSite(String site)
      Validates primary site
    • validateHistology

      public static boolean validateHistology(String hist)
      Validates histology
    • validateBehavior

      public static boolean validateBehavior(String behavior)
      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

      public static boolean sameHistologies(String icd1, String icd2)
      checks if two morphologies are same except 8000 and 8010.
    • sameKnownDateParts

      public static boolean sameKnownDateParts(MphInput i1, MphInput i2)
      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

      public static List<String> expandList(List<String> list)
      Expands list of string splitted by commas and ranges.
    • expandList

      public static List<String> expandList(String rawValue)
      Expands list of string splitted by commas and ranges.
    • isSiteContained

      public static boolean isSiteContained(String list, String site)
      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

      public static boolean isPairedSites(String site1, String site2, List<String> pairedSites)
      checks if 2 sites are paired
    • validPairedSiteLaterality

      public static boolean validPairedSiteLaterality(String lat1, String lat2)
      checks if lateralities are valid for paired sites, if they are either left or right
    • validateLaterality

      public static boolean validateLaterality(String lat)
      checks if laterality is valid
    • areOppositeSides

      public static boolean areOppositeSides(String lat1, String lat2)
      checks if cancers are left and right side
    • areSameSide

      public static boolean areSameSide(String lat1, String lat2)
      checks if cancers are both on the left or right side
    • sameAndValidMainFields

      public static boolean sameAndValidMainFields(MphInput i1, MphInput i2)
      checks if two cases have same and valid site, hist, behavior, date, laterality
    • compareDxDate

      public static int compareDxDate(MphInput input1, MphInput input2)
      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

      public static int verifyYearsApart(MphInput input1, MphInput input2, int yearsApart)
      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

      public static int verifyDaysApart(MphInput input1, MphInput input2, int days)
      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

      public static String getSiteHistInfo(String site, String hist, String beh, int year)
      Returns the site, hist/beh information of the input