NIH | National Cancer Institute | NCI Wiki  

Error rendering macro 'rw-search'

null

Versions Compared

Key

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

...

Section
Column
Panel
titleContents of this Page
Table of Contents
minLevel2

 

 

 

LexEVS Authoring Service Management Methods

Currently restricted to the support of Mapping Authoring only.

...

The following examples show how to insert an entity and update an existing entity.

Insert Entity

Code Block
    private VersionableEventEntityService service;
	private AuthoringService authoringService;


	 
    CodingScheme scheme = new CodingScheme();
    scheme.setApproxNumConcepts(111l);
    scheme.setCodingSchemeName("testName");
    scheme.setCodingSchemeURI("uri");
    scheme.setRepresentsVersion("v1");
        
    authoringService.loadRevision(scheme, null, null);
        
    CodingScheme cs = codingSchemeservice.getCodingSchemeByUriAndVersion("uri", "v1");
    System.out.println(cs);
     
    // Create a new entity   
    Entity entity = new Entity();
    entity.setEntityCode("c1");
    entity.setEntityCodeNamespace("ns");
     entity.setIsDefined(false);   
    service.insertEntity("uri", "v1", entity);

Updating an Existing Entity

Code Block
  
    EntryStateprivate entryState = new EntryState();
    entryState.setChangeType(ChangeType.MODIFYVersionableEventEntityService service;
	private AuthoringService authoringService;


	CodingScheme scheme = new CodingScheme();
    entityscheme.setEntryStatesetApproxNumConcepts(entryState111l);
        
    EntityDescription ed = new EntityDescription(scheme.setCodingSchemeName("testName");
    edscheme.setContentsetCodingSchemeURI("pre-updateuri");
    entityscheme.setEntityDescriptionsetRepresentsVersion(ed"v1");
      
    // Insert the new entity
    serviceauthoringService.insertEntityloadRevision("uri"scheme, "v1"null, entitynull);
        
    //CodingScheme Updatecs the entity description= codingSchemeservice.getCodingSchemeByUriAndVersion("uri", "v1");
    entitySystem.getEntityDescription()out.setContent("post-update"println(cs);
      
    try {
		// Create Updatea thenew entity   
    Entity entity =  service.updateEntity("uri", "v1", entitynew Entity();
    entity.setEntityCode("c1");
    entity.setEntityCodeNamespace("ns");
    } catch (Exception e) {
entity.setIsDefined(false);
       
    }

EntryState entryState =  Entity modifiedEntity = service.getEntity("uri", "v1", "c1", "ns");

Insert Entity

Code Block
new EntryState();
    entryState.setChangeType(ChangeType.MODIFY);
    entity.setEntryState(entryState);
    private VersionableEventEntityService service;
	private AuthoringService authoringService;
 
    CodingSchemeEntityDescription schemeed = new CodingSchemeEntityDescription();
    schemeed.setApproxNumConcepts(111lsetContent("pre-update");
    schemeentity.setCodingSchemeNamesetEntityDescription("testName"ed);
    scheme.setCodingSchemeURI("uri");
    scheme.setRepresentsVersion("v1");
    // Insert the new entity
    authoringServiceservice.loadRevisioninsertEntity(scheme"uri", null"v1", nullentity);
        
    CodingScheme// csUpdate = codingSchemeservice.getCodingSchemeByUriAndVersion("uri", "v1");the entity description
    Systementity.outgetEntityDescription().println(cssetContent("post-update");
      
  
  try  Entity{
		// Update the entity
  = new Entity();
    entityservice.setEntityCodeupdateEntity("uri", "c1v1", entity);
    } catch entity.setEntityCodeNamespace("ns");
(Exception e) {
     
    }

    Entity modifiedEntity = service.insertEntitygetEntity("uri", "v1", "c1", entity"ns");

 

Scrollbar
iconsfalse