141. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/11/2019 10:54:12 AM Eastern Daylight 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.

141.1 Files compared

# Location File Last Modified
1 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\hl7 SegmentFactory.java Wed May 29 15:26:00 2019 UTC
2 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\hl7 SegmentFactory.java Mon Jun 10 19:27:47 2019 UTC

141.2 Comparison summary

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

141.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

141.4 Active regular expressions

No regular expressions were active.

141.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** *********
  2    * Copyrii ght 2004 V HA. All ri ghts reser ved
  3    ********* ********** ********** ********** ********** ********** *********/
  4   package go v.va.med.f w.hl7;
  5  
  6   // Java cl asses
  7   import jav a.util.Res ourceBundl e;
  8  
  9   import gov .va.med.fw .util.Refl ector;
  10  
  11   /**
  12    * @author   DN S
  13    * @versio n 1.0
  14    */
  15   public cla ss Segment Factory {
  16  
  17           pr ivate stat ic final S tring SEGM ENT_CLASS_ PROPERTIES  = "segmen ts";
  18  
  19           /* *
  20            *  Comment f or <code>i nstance</c ode>
  21            * /
  22           pr ivate stat ic Segment Factory in stance = n ull;
  23  
  24           /* *
  25            *  Comment f or <code>s em</code>
  26            * /
  27           pr ivate stat ic ThreadL ocal sem =  new Threa dLocal();
  28  
  29           /* *
  30            *  A private  construct or to prev ent other  classes fr om instant iating thi s
  31            *  class dir ectly
  32            * /
  33           pr otected Se gmentFacto ry() {
  34                    supe r();
  35           }
  36  
  37           /* *
  38            *  Returns a  single in stance of  a segment  factory
  39            *  
  40            *  @return A  single in stance of  a segment  factory
  41            * /
  42           pu blic stati c SegmentF actory get Instance()  {
  43  
  44                    if ( sem.get()  == null) {
  45                             synchr onized (Se gmentFacto ry.class)  {
  46                                      if (inst ance == nu ll) {
  47                                               instance =  new Segme ntFactory( );
  48                                               sem.set(Bo olean.TRUE );
  49                                      }
  50                             }
  51                    }
  52                    retu rn instanc e;
  53           }
  54  
  55           pu blic Segme nt createS egment(Str ing[] enco ders, Stri ng delimit er, String  data)
  56                             throws  InvalidSe gmentExcep tion {
  57  
  58                    Segm ent s = nu ll;
  59                    try  {
  60                             s = (S egment) Re flector.in stantiate(
  61                                               getSegment ClassName( getSegment Name(data,  delimiter )), new Ob ject[] { e ncoders,
  62                                                                deli miter, dat a });
  63                    } ca tch (Excep tion e) {
  64                             throw  new Invali dSegmentEx ception("F ailed to c reate a se gment", e) ;
  65                    }
  66                    retu rn s;
  67           }
  68  
  69           pr otected St ring getSe gmentName( String dat a, String  delimiter)  throws In validSegme ntExceptio n {
  70  
  71                    if ( data == nu ll || deli miter == n ull) {
  72                             throw  new Illega lArgumentE xception(" Missing a  segment da ta & delim iter");
  73                    }
  74  
  75                    int  pos = data .indexOf(d elimiter);
  76                    if ( pos == -1)  {
  77                             throw  new Invali dSegmentEx ception("I nvalid seg ment delim iter in se gment: " +  data);
  78                    }
  79                    retu rn data.su bstring(0,  pos);
  80           }
  81  
  82           pr otected St ring getSe gmentClass Name(Strin g segmentN ame) {
  83                    // i f a concre te segment  class is  not specif ied, use a  generic s egment
  84                    Stri ng value =  Segment.c lass.getNa me();
  85  
  86                    try  {
  87                             Resour ceBundle b undle = Re sourceBund le.getBund le(SEGMENT _CLASS_PRO PERTIES);
  88                             value  = bundle.g etString(s egmentName );
  89                    } ca tch (Excep tion e) {
  90                             // Fai led to fin d a concre te segment  class so
  91                             // use  a generic  segment c lass inste ad
  92                    }
  93                    retu rn value;
  94           }
  95   }