/**
  * The list is in ascending (time) order, i.e., patient matrix would come before follow-up
  * matrices.
  */
 @Override
 public SurvivalStatus computeSurvivalData(List<DataMatrix> dataMatrices) {
   canonicalPatientList = getPatientIds(dataMatrices.get(0));
   SurvivalStatus oss = new SurvivalStatus();
   computeSurvivalData(oss, getSurvivalData(dataMatrices));
   computeDiseaseFreeData(oss, getDiseaseFreeData(dataMatrices));
   return oss;
 }
  private Map<String, DiseaseFreeData> getDiseaseFreeDataForMatrix(DataMatrix dataMatrix) {
    Map<String, DiseaseFreeData> diseaseFreeDataMap = new HashMap<String, DiseaseFreeData>();

    List<String> patientIds = getPatientIds(dataMatrix);
    for (int lc = 0; lc < patientIds.size(); lc++) {
      String patientId = patientIds.get(lc);
      DiseaseFreeData df = getDiseaseFreeDataForPatient(lc, dataMatrix);
      if (diseaseFreeDataMap.containsKey(patientId)) {
        df = mergeDiseaseFreeData(diseaseFreeDataMap.get(patientId), df);
      }
      diseaseFreeDataMap.put(patientId, df);
    }

    return diseaseFreeDataMap;
  }
  private Map<String, SurvivalData> getSurvivalDataForMatrix(DataMatrix dataMatrix) {
    Map<String, SurvivalData> survivalDataMap = new HashMap<String, SurvivalData>();

    List<String> patientIds = getPatientIds(dataMatrix);
    for (int lc = 0; lc < patientIds.size(); lc++) {
      String patientId = patientIds.get(lc);
      SurvivalData sd = getSurvivalDataForPatient(lc, dataMatrix);
      if (survivalDataMap.containsKey(patientId)) {
        sd = mergeSurvivalData(survivalDataMap.get(patientId), sd);
      }
      survivalDataMap.put(patientId, sd);
    }

    return survivalDataMap;
  }