42. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/21/2017 6:15:13 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

42.1 Files compared

# Location File Last Modified
1 Genisis_2.0_v7_bld7.zip\TS\Service\term-service\src\main\java\gov\va\genisis2\ts\converter SolrConceptDocumentConverter.java Thu Dec 14 19:57:15 2017 UTC
2 Genisis_2.0_v7_bld7.zip\TS\Service\term-service\src\main\java\gov\va\genisis2\ts\converter SolrConceptDocumentConverter.java Thu Dec 21 22:10:43 2017 UTC

42.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 220
Changed 1 2
Inserted 0 0
Removed 0 0

42.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

42.4 Active regular expressions

No regular expressions were active.

42.5 Comparison detail

  1   package go v.va.genis is2.ts.con verter;
  2  
  3   import jav a.util.Arr ays;
  4   import jav a.util.Lis t;
  5   import jav a.util.Opt ional;
  6   import jav a.util.str eam.Collec tors;
  7  
  8   import org .springfra mework.bea ns.factory .annotatio n.Autowire d;
  9   import org .springfra mework.cor e.convert. converter. Converter;
  10   import org .springfra mework.ste reotype.Co mponent;
  11  
  12   import gov .va.genisi s2.ts.dto. ConceptCar dDTO;
  13   import gov .va.genisi s2.ts.dto. ConceptPre dicateUriV alueDTO;
  14   import gov .va.genisi s2.ts.dto. Relationsh ipClassTyp eDTO;
  15   import gov .va.genisi s2.ts.serv ice.impl.C onceptCard Helper;
  16   import gov .va.genisi s2.ts.serv ice.impl.S olrConcept Document;
  17   import gov .va.genisi s2.ts.util s.TSProper tiesUtil;
  18  
  19   /**
  20    * @author   PII
  21    *
  22    */
  23   @Component
  24   public cla ss SolrCon ceptDocume ntConverte r implemen ts Convert er<Concept CardDTO, S olrConcept Document>{
  25  
  26           @A utowired
  27           pr ivate Conc eptCardHel per concep tCardHelpe r;
  28           
  29           @A utowired
  30           pr ivate TSPr opertiesUt il propsUt il;
  31           
  32           @O verride
  33           pu blic SolrC onceptDocu ment conve rt(Concept CardDTO co nceptCardD to) {
  34                    Solr ConceptDoc ument docu ment = new  SolrConce ptDocument ();
  35                    
  36                    docu ment.setId (conceptCa rdDto.getU ri());
  37                    docu ment.setLa bel(concep tCardDto.g etName());
  38                    
  39                    docu ment.setDe finition(
  40                                      String.j oin(" ", g etValuesFr omConceptP redicate(
  41                                                       Op tional.ofN ullable( c onceptCard Dto
  42                                                       .g etDescript ion()
  43                                                       .g etDefiniti ons()))));
  44                    
  45                    docu ment.setAl tDefinitio n(
  46                                      String.j oin(" ", g etValuesFr omConceptP redicate(
  47                                                       Op tional.ofN ullable( c onceptCard Dto
  48                                                       .g etDescript ion()
  49                                                       .g etAltDefin itions())) ));
  50                    
  51                    docu ment.setSy nonyms(Str ing.join("  ", getVal uesFromCon ceptPredic ate(
  52                                      Optional .ofNullabl e( concept CardDto
  53                                      .getDesc ription()
  54                                      .getSyno nyms())))) ;
  55                    
  56                    docu ment.setPa rent(
  57                                      String.j oin(" ", g etValuesFr omConceptR elationshi p(
  58                                                       Op tional.ofN ullable( c onceptCard Dto
  59                                                       .g etRelation ships()
  60                                                       .g etSuperCla sses())))) ;
  61                    
  62                    docu ment.setCh ild(
  63                                      String.j oin(" ", g etValuesFr omConceptR elationshi p(
  64                                                       Op tional.ofN ullable( c onceptCard Dto
  65                                                       .g etRelation ships()
  66                                                       .g etSubClass es()))));
  67                    
  68                    docu ment.setSo urceOntolo gy(
  69                                      conceptC ardHelper
  70                                      .getOnto logyNameFo rConceptUr i(
  71                                                       co nceptCardD to.getUri( )));
  72                    /** 
  73                     * F or build 7  it is nec essary, to  boost onl y mvp data  elements
  74                     */
  75                    if(  isDataElem entPrefix( conceptCar dDto.getUr i()))
  76                             docume nt.setData ElementMap ping(true) ;
  77                    
  78                    retu rn documen t;
  79           }
  80           
  81           /* *
  82            *  Checks fo r an appro pirate pre fix for a  give conce pt uri
  83            *  @param ur i
  84            *  @return
  85            * /
  86           pu blic boole an isDataE lementPref ix(String  uri) {
  87                    retu rn uri.sta rtsWith(pr opsUtil.ge tBaselineS urveyPrefi x());
  88           }
  89  
  90           pu blic List< String> ge tValuesFro mConceptPr edicate( O ptional<Li st<Concept PredicateU riValueDTO >> predica teValues )  {
  91                    if(p redicateVa lues.isPre sent() ) {
  92                             return  predicate Values
  93                                               .get()
  94                                               .stream()
  95                                               .map(Conce ptPredicat eUriValueD TO::getVal ue)
  96                                               .collect(C ollectors. toList());
  97                    }
  98                    retu rn Arrays. asList("") ;
  99           }
  100           
  101           pu blic List< String> ge tValuesFro mConceptRe lationship (Optional< List<Relat ionshipCla ssTypeDTO> > relation shipValues  ){
  102                    if(r elationshi pValues.is Present()  ) {
  103                             return  relations hipValues
  104                                               .get()
  105                                               .stream()
  106                                               .map(Relat ionshipCla ssTypeDTO: :getName)
  107                                               .collect(C ollectors. toList());
  108                    }
  109                    retu rn Arrays. asList("") ;
  110           }
  111   }