Skip to content

Commit

Permalink
cleaning up some descriptions (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
songa committed Nov 15, 2017
1 parent de26904 commit 204f6d2
Show file tree
Hide file tree
Showing 35 changed files with 125 additions and 120 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.imsweb.datagenerator.naaccr;

import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import java.time.LocalDate;

public abstract class NaaccrDataGeneratorRule {

// the unique ID of this rule
Expand Down Expand Up @@ -38,7 +37,7 @@ public String getName() {
return _name;
}

public String getCriteria() {
public String getDescription() {
return "No Description Available";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class AddressCurrentRule extends AddressRule {
// unique identifier for this rule
public static final String ID = "address-current";

private static final String _CRTIERIA = "Current Address is randomly generated based on SEER frequencies and the provided state";

/**
* Constructor.
*/
Expand All @@ -21,4 +23,9 @@ public AddressCurrentRule() {
"addressCurrentSupplementl",
"addressCurrentCounty");
}

@Override
public String getDescription() {
return _CRTIERIA;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class BirthRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "birth";

private static final String _CRITERIA = "Birthplace Country is always set to USA. If no state was selected, then all states have an equal chance to be assigned as Birthplace State.<br/>"
private static final String _DESCRIPTION = "Birthplace Country is always set to USA. If no state was selected, then all states have an equal chance to be assigned as Birthplace State.<br/>"
+ "If a state was selected, that state has a 90% chance of being assigned as Birthplace State. The other states have an equal chance of being assigned."
+ "Date of Birth is randomly generated between a minimum and maximum date. The minimum date is always 100 years before the current date to ensure that no patient is older than 100."
+ "The maximum date is 5 years prior to the January 1 of the minimum DX year. If no minimum DX year was provided, the minimum date is 15 years before the current date.";
Expand All @@ -27,8 +27,8 @@ public BirthRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ComputedEthnicityRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "computed-ethnicity";

private static final String _CRITERIA = "Computed Ethnicity is calculated based on Sex, Last Name, and Maiden Name.";
private static final String _DESCRIPTION = "Computed Ethnicity is calculated based on Sex, Last Name, and Maiden Name.";

// resource file containing list of spanish surnames
protected static final String _FILE_SPANISH_SURNAMES = "frequencies/spanish_surnames.csv";
Expand All @@ -41,8 +41,8 @@ public List<String> getRequiredProperties() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DeathRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "death";

private static final String _CRITERIA = "If Vital Status was set to 1, Cause of Death will be set to 0000 and ICD Revision Number will be set to 0.<br/>"
private static final String _DESCRIPTION = "If Vital Status was set to 1, Cause of Death will be set to 0000 and ICD Revision Number will be set to 0.<br/>"
+ "Otherwise these fields are not set";

/**
Expand All @@ -23,8 +23,8 @@ public DeathRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class HispanicOriginRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "spanish-hispanic-origin";

private static final String _CRITERIA = "Spanish/Hispanic Origin is randomly generated based on frequency";
private static final String _DESCRIPTION = "Spanish/Hispanic Origin is randomly generated based on SEER frequency";

/**
* Constructor.
Expand All @@ -22,8 +22,8 @@ public HispanicOriginRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class IhsRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "ihs";

private static final String _CRITERIA = "IHS is always left blank.";
private static final String _DESCRIPTION = "IHS is always left blank.";

/**
* Constructor.
Expand All @@ -21,8 +21,8 @@ public IhsRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public class NameRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "name";

private static final String _CRITERIA = "Last Name is randomly generated based on frequency. The frequency depends on Spanish/Hispanic Origin and Race 1.<br/>"
private static final String _DESCRIPTION = "Last Name is randomly generated based on SEER frequency, Spanish/Hispanic Origin, and Race 1.<br/>"
+ "First Name is randomly generated from a list based on Sex.<br/>"
+ "Middle Name is randomly generated from a list based on Sex. There is a 5% chance that Middle Name will be an initial.<br/>"
+ "Prefix is randomly generated from a list based on Sex. There is a 2% chance that a patient will have a prefix."
+ "Suffix is randomly generated from a list based on Sex. There is a 3% chance that a patient will have a suffix.";
// TODO maiden name, spouse name...why is maiden name = last name
+ "Middle Name is randomly generated from a list based on Sex.<br/>"
+ "Prefix is randomly generated from a list based on Sex.<br/>"
+ "Suffix is randomly generated from a list based on Sex."
+ "Maiden Name is set randomly if Sex is female. If it is set, it will always be the value of Last Name.";

// lists of valid name prefixes and suffixes
private static final String[] _VALUES_PREFIXES_MALE = {"Dr", "Rev", "Mr"};
Expand All @@ -40,8 +40,8 @@ public List<String> getRequiredProperties() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class PatientIdRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "patient-id-number";

private static final String _CRITERIA = "Patient ID starts at 00000001 and is incremented by 1 for each new patient. Records for the same patient will have the same Patient ID.";
private static final String _DESCRIPTION = "Patient ID starts at 00000001 and is incremented by 1 for each new patient.";

// current counter value
private int _currentValue;
Expand All @@ -25,8 +25,8 @@ public PatientIdRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class RaceRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "race";

private static final String _CRITERIA = "Race 1 is randomly generated based on frequency. If Race 1 is set to 99, Race 2-5 are set to 99 also.<br/>"
private static final String _DESCRIPTION = "Race 1 is randomly generated based on SEER frequency. If Race 1 is set to 99, Race 2-5 are set to 99 also.<br/>"
+ "Otherwise, Race 2-5 are set to 88.";

/**
Expand All @@ -24,8 +24,8 @@ public RaceRule() {


@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class SexRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "sex";

private static final String _CRITERIA = "Sex is randomly generated based on frequency";
private static final String _DESCRIPTION = "Sex is randomly generated based on SEER frequency";

/**
* Constructor.
Expand All @@ -22,8 +22,8 @@ public SexRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class SsnRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "social-security-number";

private static final String _CRITERIA = "The first three digits are randomly generated between 001 and 649.<br/>"
private static final String _DESCRIPTION = "The first three digits are randomly generated between 001 and 649.<br/>"
+ "The next two digits are randomly generated between 01 and 99.<br/>"
+ "The last four digits are randomly generated between 0001 and 9999.";

Expand All @@ -24,8 +24,8 @@ public SsnRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class VitalStatusRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "vital-status";

private static final String _CRITERIA = "Vital Status is randomly generated based on frequency.";
private static final String _DESCRIPTION = "Vital Status is randomly generated based on SEER frequency.";

/**
* Constructor.
Expand All @@ -22,8 +22,8 @@ public VitalStatusRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class AddressAtDxRule extends AddressRule {
// unique identifier for this rule
public static final String ID = "address-dx";

private static final String _DESCRIPTION = "Address at DX is randomly generated based on SEER frequencies and the provided state.";

/**
* Constructor.
*/
Expand All @@ -39,4 +41,9 @@ public void execute(Map<String, String> record, List<Map<String, String>> otherR
else
super.execute(record, otherRecords, options);
}

@Override
public String getDescription() {
return _DESCRIPTION;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class AgeRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "age-at-dx";

private static final String _CRITERIA = "Age at DX is calculated based on Date of Birth and Date of Diagnosis.";
private static final String _DESCRIPTION = "Age at DX is calculated based on Date of Birth and Date of Diagnosis.";

/**
* Constructor.
Expand All @@ -29,8 +29,8 @@ public List<String> getRequiredProperties() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CensusRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "census";

private static final String _CRITERIA = "Census Tract 1970, 1980, and 1990 are always set to blank. Census Tract 2000 and 2010 are always set to 999999.<br/>"
private static final String _DESCRIPTION = "Census Tract 1970, 1980, and 1990 are always set to blank. Census Tract 2000 and 2010 are always set to 999999.<br/>"
+ "Census Certainty 1970, 1980, and 1990 are always set to blank. Census Certainty 2000 and 2010 are always set to 9.<br/>"
+ "Census Poverty Indicator is always set to 9.";

Expand All @@ -23,8 +23,8 @@ public CensusRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DateOfConclusiveDxRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "date-conclusive-dx";

private static final String _CRITERIA = "Date of Conclusive DX is always set to the Date of Diagnosis.";
private static final String _DESCRIPTION = "Date of Conclusive DX is always set to the Date of Diagnosis.";

/**
* Constructor.
Expand All @@ -27,8 +27,8 @@ public List<String> getRequiredProperties() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ public class DateOfDiagnosisRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "date-of-diagnosis";

private static final String _CRITERIA = "Date of Diagnosis is randomly generated between January 1 of the minimum DX year and December 31 of the maximum DX year.<br/>"
private static final String _DESCRIPTION = "Date of Diagnosis is randomly generated between January 1 of the minimum DX year and December 31 of the maximum DX year.<br/>"
+ "If no minimum year was specified, then the current date minus 10 years is used as the minimum date.<br/>"
+ "If no maximum year was specified, then the current date is used as the maximum date.<br/>"
+ "If a patient has multiple tumors, each tumor after the first one will use the previous tumor's Date of Diagnosis as its minimum date.<br/>"
+ "This ensures that all tumors on a patient are in chronological order.";
+ "If no maximum year was specified, then the current date is used as the maximum date.<br/>";

/**
* Constructor.
Expand All @@ -29,8 +27,8 @@ public DateOfDiagnosisRule() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DateOfInitialRxRule extends NaaccrDataGeneratorRule {
// unique identifier for this rule
public static final String ID = "date-of-initial-rx";

private static final String _CRITERIA = "Date of Initial RX is always set to the Date of Diagnosis";
private static final String _DESCRIPTION = "Date of Initial RX is always set to the Date of Diagnosis";

/**
* Constructor.
Expand All @@ -27,8 +27,8 @@ public List<String> getRequiredProperties() {
}

@Override
public String getCriteria() {
return _CRITERIA;
public String getDescription() {
return _DESCRIPTION;
}

@Override
Expand Down
Loading

0 comments on commit 204f6d2

Please sign in to comment.