Produced by Araxis Merge on 3/1/2018 12:13:17 PM Central 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | ehealth_xchange_cif.zip\NHIN_adapter\AdapterLIB\src\main\java\gov\va\med\nhin\adapter\datamanager\translators | XMLFragmentDataTranslator.java | Thu Feb 22 14:26:44 2018 UTC |
| 2 | ehealth_xchange_cif.zip\NHIN_adapter\AdapterLIB\src\main\java\gov\va\med\nhin\adapter\datamanager\translators | XMLFragmentDataTranslator.java | Tue Feb 27 14:29:00 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 120 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | /* | |
| 2 | * To chan ge this li cense head er, choose License H eaders in Project Pr operties. | |
| 3 | * To chan ge this te mplate fil e, choose Tools | Te mplates | |
| 4 | * and ope n the temp late in th e editor. | |
| 5 | */ | |
| 6 | package go v.va.med.n hin.adapte r.datamana ger.transl ators; | |
| 7 | ||
| 8 | import gov .va.med.nh in.adapter .datamanag er.DataMan agerExcept ion; | |
| 9 | import gov .va.med.nh in.adapter .datamanag er.DataQue ry; | |
| 10 | import gov .va.med.nh in.adapter .datamanag er.DataTra nslator; | |
| 11 | import gov .va.med.nh in.adapter .datamanag er.Referen ce; | |
| 12 | import gov .va.med.nh in.adapter .utils.Nul lChecker; | |
| 13 | import jav a.io.IOExc eption; | |
| 14 | import org .apache.co mmons.lang 3.StringEs capeUtils; | |
| 15 | ||
| 16 | /** | |
| 17 | * | |
| 18 | * @author DN S VAZQUD | |
| 19 | */ | |
| 20 | public cla ss XMLFrag mentDataTr anslator i mplements DataTransl ator | |
| 21 | { | |
| 22 | static public fi nal String DEFAULT_N AMESPACE = "urn:hl7- org:v3"; | |
| 23 | @Overr ide | |
| 24 | public Object tr anslate(Ob ject input , Object r esult, Ref erence tra nslation, DataQuery dataQuery) throws IO Exception | |
| 25 | { | |
| 26 | St ring ret; | |
| 27 | St ring enclo singElemen tName = tr anslation. getPropert y("enclosi ngElementN ame"); | |
| 28 | St ring conve rtLineFeed sToElement = transla tion.getPr operty("co nvertLineF eedsToElem ent"); | |
| 29 | St ring defau ltNamespac e = transl ation.getP roperty("d efaultName space"); | |
| 30 | if (NullCheck er.isNullO rEmpty(def aultNamesp ace)) { de faultNames pace = DEF AULT_NAMES PACE; } | |
| 31 | St ring[] wor kingSet; | |
| 32 | ||
| 33 | if (!(input instanceof String)) { | |
| 34 | throw ne w DataMana gerExcepti on("input must be of type java .lang.Stri ng."); | |
| 35 | } | |
| 36 | ||
| 37 | if (NullChec ker.isNotN ullOrEmpty (convertLi neFeedsToE lement)) { | |
| 38 | workingS et = ((Str ing)input) .split("(\ \n|\\r|\\r \\n)"); | |
| 39 | } | |
| 40 | el se { | |
| 41 | workingS et = new S tring[]{(S tring)inpu t}; | |
| 42 | } | |
| 43 | ||
| 44 | St ringBuilde r resultSt ring = new StringBui lder(); | |
| 45 | fo r (int i = 0; i < w orkingSet. length; + +i) { | |
| 46 | if (i > 0) { | |
| 47 | resu ltString.a ppend(conv ertLineFee dsToElemen t); | |
| 48 | } | |
| 49 | resultSt ring.appen d(StringEs capeUtils. escapeXml( workingSet [i])); | |
| 50 | } | |
| 51 | ||
| 52 | if (NullChec ker.isNotN ullOrEmpty (enclosing ElementNam e)) { | |
| 53 | ret = St ring.forma t("<%s xml ns='%s'>%s </%s>", en closingEle mentName, defaultNam espace, re sultString .toString( ), enclosi ngElementN ame); | |
| 54 | } | |
| 55 | el se { | |
| 56 | ret = re sultString .toString( ); | |
| 57 | } | |
| 58 | ||
| 59 | re turn ret; | |
| 60 | } | |
| 61 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.