Skip to content
Chuck May edited this page Apr 14, 2015 · 7 revisions

API

public StagingData stage(StagingData data)

Description

Staging a case requires first knowing which schema you are working with. Once you determine the schema (using lookupSchema) you can determine which fields (keys) need to be collected and supplied to the stage method call.

A StagingData object is used to make staging calls. All inputs to staging should be set on the StagingData object and the staging call will add the results. The results include:

output - all output values resulting from the calculation
errors - a list of errors and their descriptions
path - an ordered list of the tables that were used in the calculation

Each algorithm has a specific StagingData entity which helps with preparing and evaluating staging calls. For Collaborative Staging, use CsStagingData. You only need to include inputs that are used in the schema being staged.

Examples

Staging staging = Staging.getInstance(CsDataProvider.getInstance(CsVersion.v020550));

CsStagingData data = new CsStagingData();
data.setInput(CsInput.PRIMARY_SITE, "C680");
data.setInput(CsInput.HISTOLOGY, "8000");
data.setInput(CsInput.BEHAVIOR, "3");
data.setInput(CsInput.GRADE, "9");
data.setInput(CsInput.DX_YEAR, "2013");
data.setInput(CsInput.CS_VERSION_ORIGINAL, "020550");
data.setInput(CsInput.TUMOR_SIZE, "075");
data.setInput(CsInput.EXTENSION, "100");
data.setInput(CsInput.EXTENSION_EVAL, "9");
data.setInput(CsInput.LYMPH_NODES, "100");
data.setInput(CsInput.LYMPH_NODES_EVAL, "9");
data.setInput(CsInput.REGIONAL_NODES_POSITIVE, "99");
data.setInput(CsInput.REGIONAL_NODES_EXAMINED, "99");
data.setInput(CsInput.METS_AT_DX, "10");
data.setInput(CsInput.METS_EVAL, "9");
data.setInput(CsInput.LVI, "9");
data.setInput(CsInput.AGE_AT_DX, "060");
data.setSsf(1, "020");

// perform the staging
staging.stage(data);

// check results
Assert.assertEquals(Result.STAGED, data.getResult());
Assert.assertEquals("urethra", data.getSchemaId());
Assert.assertEquals(0, data.getErrors().size());
Assert.assertEquals(37, data.getPath().size());

// check output
Assert.assertEquals("129", data.getOutput(CsOutput.SCHEMA_NUMBER));
Assert.assertEquals("020550", data.getOutput(CsOutput.CSVER_DERIVED));

// AJCC 6
Assert.assertEquals("T1", data.getOutput(CsOutput.AJCC6_T));
Assert.assertEquals("c", data.getOutput(CsOutput.AJCC6_TDESCRIPTOR));
Assert.assertEquals("N1", data.getOutput(CsOutput.AJCC6_N));
Assert.assertEquals("c", data.getOutput(CsOutput.AJCC6_NDESCRIPTOR));
Assert.assertEquals("M1", data.getOutput(CsOutput.AJCC6_M));
Assert.assertEquals("c", data.getOutput(CsOutput.AJCC6_MDESCRIPTOR));
Assert.assertEquals("IV", data.getOutput(CsOutput.AJCC6_STAGE));
Assert.assertEquals("10", data.getOutput(CsOutput.STOR_AJCC6_T));
Assert.assertEquals("c", data.getOutput(CsOutput.STOR_AJCC6_TDESCRIPTOR));
Assert.assertEquals("10", data.getOutput(CsOutput.STOR_AJCC6_N));
Assert.assertEquals("c", data.getOutput(CsOutput.STOR_AJCC6_NDESCRIPTOR));
Assert.assertEquals("10", data.getOutput(CsOutput.STOR_AJCC6_M));
Assert.assertEquals("c", data.getOutput(CsOutput.STOR_AJCC6_MDESCRIPTOR));
Assert.assertEquals("70", data.getOutput(CsOutput.STOR_AJCC6_STAGE));

// AJCC 7
Assert.assertEquals("T1", data.getOutput(CsOutput.AJCC7_T));
Assert.assertEquals("c", data.getOutput(CsOutput.AJCC7_TDESCRIPTOR));
Assert.assertEquals("N1", data.getOutput(CsOutput.AJCC7_N));
Assert.assertEquals("c", data.getOutput(CsOutput.AJCC7_NDESCRIPTOR));
Assert.assertEquals("M1", data.getOutput(CsOutput.AJCC7_M));
Assert.assertEquals("c", data.getOutput(CsOutput.AJCC7_MDESCRIPTOR));
Assert.assertEquals("IV", data.getOutput(CsOutput.AJCC7_STAGE));
Assert.assertEquals("100", data.getOutput(CsOutput.STOR_AJCC7_T));
Assert.assertEquals("c", data.getOutput(CsOutput.STOR_AJCC6_TDESCRIPTOR));
Assert.assertEquals("100", data.getOutput(CsOutput.STOR_AJCC7_N));
Assert.assertEquals("c", data.getOutput(CsOutput.STOR_AJCC7_NDESCRIPTOR));
Assert.assertEquals("100", data.getOutput(CsOutput.STOR_AJCC7_M));
Assert.assertEquals("c", data.getOutput(CsOutput.STOR_AJCC7_MDESCRIPTOR));
Assert.assertEquals("700", data.getOutput(CsOutput.STOR_AJCC7_STAGE));

// Summary Stage
Assert.assertEquals("L", data.getOutput(CsOutput.SS1977_T));
Assert.assertEquals("RN", data.getOutput(CsOutput.SS1977_N));
Assert.assertEquals("D", data.getOutput(CsOutput.SS1977_M));
Assert.assertEquals("D", data.getOutput(CsOutput.SS1977_STAGE));
Assert.assertEquals("L", data.getOutput(CsOutput.SS2000_T));
Assert.assertEquals("RN", data.getOutput(CsOutput.SS2000_N));
Assert.assertEquals("D", data.getOutput(CsOutput.SS2000_M));
Assert.assertEquals("D", data.getOutput(CsOutput.SS2000_STAGE));
Assert.assertEquals("7", data.getOutput(CsOutput.STOR_SS1977_STAGE));
Assert.assertEquals("7", data.getOutput(CsOutput.STOR_SS2000_STAGE));
Clone this wiki locally