NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The validate method is not always implemented, but can and should be when a mechanism exists to insure that this is a correctly structured version of the source.  When source is XML formatted and has a schema or dtd document commonly available for validation, this is a relatively easy process.  However any free text files that do not have any associated java-based validation API, would rely on the developer to create validation functions.  The validation method is not required to create a loader for LexEVS. 

Code Block
languagejava
titleValidate the Source
 @Override
    public void validate(URI sourceDir, int validationLevel) throws LBParameterException {

Pass in the URI for the path to the source file and, if desired, provide an integer value for a level of validation for this source. (I.e. what level of errors or issues can this load live with.  This assumes a very detailed validation of source)

Implement the Abstract Method doLoad() (and possibly override the load() method)

The developer could at this point implement only doLoad by mapping content to a coding scheme object before pass control over to BaseLoader which will call the doLoad method and set default load options in its load method and kick off the processes to persist a coding scheme object to the database.  The other option is to implement doLoad and override the load method which sets up end user option choices for the loader.   Most loaders implement the load method, customizing load options to provide to the end user.  In the case of the MedDRA loader, a CUI load option is provided to the end user.

Code Block
languagejava
titleLoad Kickoff Implementation in doLoad
    @Override
    protected URNVersionPair[] doLoad() throws Exception{
        LgMessageDirectorIF messages = new CachingMessageDirectorImpl(this.getMessageDirector());
        MedDRA2LGMain mainTxfm = new MedDRA2LGMain();
        //Set the source for the CUI file when using the GUI
        if(UMLSCUISource == null){
            UMLSCUISource = this.getOptions().getURIOption(UMLSCUI_FILE_OPTION).getOptionValue();
        }
        CodingScheme codingScheme = mainTxfm.map(UMLSCUISource, this.getResourceUri(), this.getMessageDirector());
  
        if(codingScheme != null){
            messages.info("Completed mapping.  Now saving to database");
            this.persistCodingSchemeToDatabase(codingScheme);

            messages.info("Saved to database.  Now constructing version pairs");            
            return this.constructVersionPairsFromCodingSchemes(codingScheme);
        }
            
         return null;   
    }

This allows the BaseLoader functions to access the results of the load of the MedDRA source file into a LexEVS coding scheme object.

Less Structure Beyond the Loader, BaseLoader Implementation and Extension

...