Class MphUtils

java.lang.Object
com.imsweb.mph.MphUtils

public final class MphUtils extends Object
This class is used to determine single versus multiple primaries. More information can be found on the following websites: SEER 1998 multiple primary rules for hematopoietic cancer

SEER 2001 multiple primary rules for hematopoietic cancer

SEER multiple primary rules for hematopoietic cancer for cases diagnosed in 2010 and later

SEER 2004 multiple primary rules

SEER 2007 multiple primary rules 2018 Solid Tumor Rules

This Java implementation is based on the documentation provided on the above websites. Created in December 2013 by Sewbesew Bekele
  • Constructor Details

    • MphUtils

      public MphUtils()
      Constructor This will use the default hemato db provider
    • MphUtils

      public MphUtils(HematoDataProvider provider)
      Constructor with a provider
      Parameters:
      provider - the provider to use for this instance, if it is null the default hemato db provider will be used
  • Method Details

    • initialize

      public static void initialize(HematoDataProvider provider)
      Initialized the instance with the given hemato db data provider; this allows to use a customized provider instead of the default one. This method must be called before trying to get an instance, of the default provider will be used instead.
      Parameters:
      provider - hemato database data provider interface
    • isInitialized

      public static boolean isInitialized()
      Returns true if the instance has been initialized, false otherwise.
    • getInstance

      public static MphUtils getInstance()
      Returns the instance of MPH utils.
    • computePrimaries

      public MphOutput computePrimaries(MphInput input1, MphInput input2)
      Determines whether two input objects of solid tumors are single or multiple primary. It returns "questionable" if there is no enough information to decide.



      The provided record dto has the following parameters:
      • primarySite (#400)
      • histologyIcdO3 (#522)
      • behaviorIcdO3 (#523)
      • histologyIcdO2 (#420)
      • behaviorIcdO2 (#430)
      • laterality (#410)
      • dateOfDiagnosisYear (#390)
      • dateOfDiagnosisMonth (#390)
      • dateOfDiagnosisDay (#390)
      • rxSummTreatmentStatus (#1285)


      All those properties are defined as constants in this class.

      Parameters:
      input1 - an input dto which has a list of parameters used in the calculation.
      input2 - an input dto which has a list of parameters used in the calculation.
      Returns:
      the computed output which is an object which has result (Single Primary, Multiple Primaries or Questionable), reason and rules applied to make a decision.
    • findCancerGroup

      public MphGroup findCancerGroup(String primarySite, String histology, String behavior, int year)
      Calculates the cancer group for the provided naaccr properties.
      Parameters:
      primarySite - primary site
      histology - histology ICD-O-3
      behavior - behavior ICD-O-3
      Returns:
      the corresponding cancer group, null if not found
    • getAllGroups

      public Map<String,MphGroup> getAllGroups()
      Returns a map of all groups of rules used by this instance.
    • getHematoDataLastUpdated

      public Date getHematoDataLastUpdated()
      Returns:
      the date when the hemato data is last updated
    • isHematoSamePrimary

      public boolean isHematoSamePrimary(String morph1, String morph2, int year1, int year2)
      Calculates if two hematopoietic diseases are same primaries based on Hemato DB.
      Parameters:
      morph1 - disease 1
      morph2 - disease 2
      year1 - diagnosis year 1
      year2 - disgnosis year 2
      Returns:
      true if two diseases are same primary and false otherwise.
    • isTransformation

      public boolean isTransformation(String leftCode, String rightCode, int leftYear, int rightYear)
    • isChronicToAcuteTransformation

      public boolean isChronicToAcuteTransformation(String earlierMorph, String laterMorph, int earlierYear, int laterYear)
    • isAcuteToChronicTransformation

      public boolean isAcuteToChronicTransformation(String earlierMorph, String laterMorph, int earlierYear, int laterYear)