Git Product home page Git Product logo

staging-algorithm-eod-public's Introduction

staging-algorithm-eod-public

integration Maven Central

This project has been moved to staging-client-java.

Extent of Disease (EOD) is a set of three data items that describe how far a cancer has spread at the time of diagnosis. EOD 2018 is effective for cases diagnosed in 2018 and later.

In each EOD schema, valid values, definitions, and registrar notes are provided for

  • EOD Primary Tumor
  • EOD Lymph Nodes
  • EOD Mets
  • Summary Stage 2018
  • Site-Specific Data Items (SSDIs), including grade, pertinent to the schema

For cancer cases diagnosed January 1, 2018 and later, the NCI SEER program will collect Extent of Disease (EOD) revised for 2018 and Summary Stage 2018. The schemas have been developed to be compatible with the AJCC 8th Edition chapter definitions.

All of the standard setting organizations will collect the predictive and prognostic factors through Site Specific Data Items (SSDIs). Unlike the SSFs, these data items have formats and code structures specific to the data item.

Download

Java 8 is the minimum version required to use the library.

Download the latest JAR or grab via Maven:

<dependency>
    <groupId>com.imsweb</groupId>
    <artifactId>staging-algorithm-eod-public</artifactId>
    <version>2.1.2</version>
</dependency>

or via Gradle:

compile 'com.imsweb.com:staging-algorithm-eod-public:2.1.2'

Usage

Full documentation can be found in the Wiki

Get a Staging instance

Everything starts with getting an instance of the Staging object. There are DataProvider objects for each staging algorithm and version. The Staging object is thread safe and cached so subsequent calls to Staging.getInstance() will return the same object.

For example, to get an instance of the EOD algorithm

Staging staging = Staging.getInstance(EodDataProvider.getInstance(EodVersion.LATEST));

Schemas

Schemas represent sets of specific staging instructions. Determining the schema to use for staging is based on primary site, histology and sometimes additional discrimator values. Schemas include the following information:

  • schema identifier (i.e. "prostate")
  • algorithm identifier (i.e. "eod_public")
  • algorithm version (i.e. "1.4")
  • name
  • title, subtitle, description and notes
  • schema selection criteria
  • input definitions describing the data needed for staging
  • list of table identifiers involved in the schema
  • a list of initial output values set at the start of staging
  • a list of mappings which represent the logic used to calculate staging output

To get a list of all schema identifiers,

Set<String> schemaIds = staging.getSchemaIds();

To get a single schema by identifer,

Schema schema = staging.getSchema("prostate");

Tables

Tables represent the building blocks of the staging instructions specified in schemas. Tables are used to define schema selection criteria, input validation and staging logic. Tables include the following information:

  • table identifier (i.e. "ajcc7_stage")
  • algorithm identifier (i.e. "eod_public")
  • algorithm version (i.e. "1.4")
  • name
  • title, subtitle, description, notes and footnotes
  • list of column definitions
  • list of table data

To get a list of all table identifiers,

Set<String> tableIds = staging.getTableIds();

That list will be quite large. To get a list of table indentifiers involved in a particular schema,

Set<String> tableIds = staging.getInvolvedTables("prostate");

To get a single table by identifer,

Table table = staging.getTable("ajcc7_stage");

Lookup a schema

A common operation is to look up a schema based on primary site, histology and optionally one or more discriminators. Each staging algorithm has a SchemaLookup object customized for the specific inputs needed to lookup a schema.

Here is a lookup based on site and histology.

// test valid combinations that do not require a discriminator
EodSchemaLookup lookup = staging.lookupSchema(new EodSchemaLookup("C629", "9231"));
assertEquals(1, lookup.size());
assertEquals("soft_tissue_other", lookup.get(0).getId());

If the call returns a single result, then it was successful. If it returns more than one result, then it needs a discriminator. Information about the required discriminator is included in the list of results. In the followung example, the field discriminator_1 and discriminator_2 are used as a discriminators.

lookup = staging.lookupSchema(new EodSchemaLookup("C111", "8200"));
assertEquals(3, lookup.size());
assertEquals(new HashSet<>(Arrays.asList("oropharynx_hpv_mediated_p16_pos", "nasopharynx", "oropharynx_p16_neg")),
        lookup.stream().map(StagingSchema::getId).collect(Collectors.toSet()));
assertEquals(new HashSet<>(Arrays.asList("discriminator_1", "discriminator_2")), 
        lookup.stream().flatMap(d -> d.getSchemaDiscriminators().stream()).collect(Collectors.toSet()));

// test valid combination that requires discriminator and a good discriminator is supplied
schemaLookup = new EodSchemaLookup("C111", "8200");
schemaLookup.setInput(EodInput.DISCRIMINATOR_1.toString(), "1");
lookup = staging.lookupSchema(schemaLookup);
assertEquals(1, lookup.size());
assertEquals(new HashSet<>(Collections.singletonList("discriminator_1")), 
        lookup.stream().flatMap(d -> d.getSchemaDiscriminators().stream()).collect(Collectors.toSet()));
assertEquals("nasopharynx", lookup.get(0).getId());

schemaLookup.setInput(EodInput.DISCRIMINATOR_1.toString(), "2");
schemaLookup.setInput(EodInput.DISCRIMINATOR_2.toString(), "1");
lookup = staging.lookupSchema(schemaLookup);
assertEquals(1, lookup.size());
assertEquals(new HashSet<>(Arrays.asList("discriminator_1", "discriminator_2")), 
        lookup.stream().flatMap(d -> d.getSchemaDiscriminators().stream()).collect(Collectors.toSet()));
assertEquals("oropharynx_p16_neg", lookup.get(0).getId());

Calculate stage

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

An EodStagingData object is used to make staging calls. All inputs to staging should be set on the EodStagingData 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
EodStagingData data = new EodStagingInputBuilder()
		.withInput(EodInput.PRIMARY_SITE, "C250")
		.withInput(EodInput.HISTOLOGY, "8154")
		.withInput(EodInput.DX_YEAR, "2018")
		.withInput(EodInput.TUMOR_SIZE_SUMMARY, "004")
		.withInput(EodInput.NODES_POS, "03")
		.withInput(EodInput.EOD_PRIMARY_TUMOR, "500")
		.withInput(EodInput.EOD_REGIONAL_NODES, "300")
		.withInput(EodInput.EOD_METS, "10").build();

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

assertEquals(StagingData.Result.STAGED, data.getResult());
assertEquals("pancreas", data.getSchemaId());
assertEquals(0, data.getErrors().size());
assertEquals(12, data.getPath().size());
assertEquals(8, data.getOutput().size());

// check outputs
assertEquals(EodDataProvider.EodVersion.LATEST.getVersion(), data.getOutput(EodOutput.DERIVED_VERSION));
assertEquals("7", data.getOutput(EodOutput.SS_2018_DERIVED));
assertEquals("00280", data.getOutput(EodOutput.NAACCR_SCHEMA_ID));
assertEquals("4", data.getOutput(EodOutput.EOD_2018_STAGE_GROUP));
assertEquals("T1", data.getOutput(EodOutput.EOD_2018_T));
assertEquals("N1", data.getOutput(EodOutput.EOD_2018_N));
assertEquals("M1", data.getOutput(EodOutput.EOD_2018_M));
assertEquals("28", data.getOutput(EodOutput.AJCC_ID));

About SEER

The Surveillance, Epidemiology and End Results (SEER) Program is a premier source for cancer statistics in the United States. The SEER Program collects information on incidence, prevalence and survival from specific geographic areas representing 28 percent of the US population and reports on all these data plus cancer mortality data for the entire country.

staging-algorithm-eod-public's People

Contributors

ctmay4 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

rmoldwin

staging-algorithm-eod-public's Issues

Behavior needed as a input for EOD schema lookups

There are some EOD schemas (e.g. brain) that require behavior to differentiate, but the EODSchemaLookup doesn't allow behavior as an input key. I could be missing something, as I'm new to working with the staging libraries. I could get what I needed by using a generic SchemaLookup and including behavior as an input, but I thought I'd mention it.

Readme shows an example of a constructor that doesnt exist

In the Readme.md under "Lookup a schema", there is an example of a constructor with 3 arguments that does not exist, also, the example is for a TNM schema, not EOD:

// supply a discriminator
lookup = staging.lookupSchema(new TnmSchemaLookup("C111", "8200", "010"));

EOD 1.4

Update to version 1.4 of the EOD algorithm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.