Produced by Araxis Merge on 10/2/2017 7:00:08 AM Central 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | cds.zip\cds\product\production\cdsinvocation\cds-invocation\src\test\java\com\cognitive\cds\invocation\engineplugins | OpenCDSFhirTest.java | Wed Jul 12 18:43:52 2017 UTC |
| 2 | cds.zip\cds\product\production\cdsinvocation\cds-invocation\src\test\java\com\cognitive\cds\invocation\engineplugins | OpenCDSFhirTest.java | Wed Sep 27 16:01:28 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 280 |
| Changed | 3 | 6 |
| 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 | * | |
| 3 | * COPYRIG HT STATUS: © 2015, 2 016. This work, aut hored by C ognitive M edical Sys tems | |
| 4 | * employe es, was fu nded in wh ole or in part by Th e Departme nt of Vete rans | |
| 5 | * Affairs under U.S . Governme nt contrac t VA118-11 -D-1011 / VA118-1011 -0013. | |
| 6 | * The cop yright hol der agrees to post o r allow th e Governme nt to post all or | |
| 7 | * part of this work in open-s ource repo sitories s ubject to the Apache License, | |
| 8 | * Version 2.0, date d January 2004. All other righ ts are res erved by t he | |
| 9 | * copyrig ht owner. | |
| 10 | * | |
| 11 | * For use outside t he Governm ent, the f ollowing n otice appl ies: | |
| 12 | * | |
| 13 | * Cop yright 201 5 © Cognit ive Medica l Systems | |
| 14 | * | |
| 15 | * Lic ensed unde r the Apac he License , Version 2.0 (the " License"); you may | |
| 16 | * not use this file excep t in compl iance with the Licen se. You ma y obtain | |
| 17 | * a c opy of the License a t http://w ww.apache. org/licens es/LICENSE -2.0 | |
| 18 | * | |
| 19 | * Unl ess requir ed by appl icable law or agreed to in wri ting, soft ware | |
| 20 | * dis tributed u nder the L icense is distribute d on an "A S IS" BASI S, | |
| 21 | * WIT HOUT WARRA NTIES OR C ONDITIONS OF ANY KIN D, either express or implied. | |
| 22 | * See the Licen se for the specific language g overning p ermissions and | |
| 23 | * lim itations u nder the L icense. | |
| 24 | * | |
| 25 | * | |
| 26 | ********* ********** ********** ********** ********** ********** ********** ********** / | |
| 27 | package co m.cognitiv e.cds.invo cation.eng ineplugins ; | |
| 28 | ||
| 29 | import com .cognitive .cds.invoc ation.Engi neInstance StateManag ementIFace ; | |
| 30 | import sta tic org.ju nit.Assert .assertTru e; | |
| 31 | ||
| 32 | import jav a.io.Buffe redReader; | |
| 33 | import jav a.io.IOExc eption; | |
| 34 | import jav a.util.Arr ayList; | |
| 35 | import jav a.util.Lis t; | |
| 36 | import jav a.util.Pro perties; | |
| 37 | ||
| 38 | import org .junit.Ign ore; | |
| 39 | import org .junit.Tes t; | |
| 40 | import org .junit.run ner.RunWit h; | |
| 41 | import org .springfra mework.tes t.annotati on.Dirties Context; | |
| 42 | import org .springfra mework.tes t.annotati on.Dirties Context.Cl assMode; | |
| 43 | import org .springfra mework.tes t.context. ContextCon figuration ; | |
| 44 | import org .springfra mework.tes t.context. junit4.Spr ingJUnit4C lassRunner ; | |
| 45 | ||
| 46 | import com .cognitive .cds.invoc ation.mode l.ResultBu ndle; | |
| 47 | import com .cognitive .cds.invoc ation.mode l.Rule; | |
| 48 | import jav a.io.Input Stream; | |
| 49 | import jav a.io.Input StreamRead er; | |
| 50 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 51 | import org .springfra mework.con text.Appli cationCont ext; | |
| 52 | //import o rg.cogmed. cds.invoca tion.frame work.VMRTr ansformTes t; | |
| 53 | ||
| 54 | ||
| 55 | @RunWith(S pringJUnit 4ClassRunn er.class) | |
| 56 | @ContextCo nfiguratio n(location s = {"clas spath:Test -CDSMockTe st.xml"}) | |
| 57 | @DirtiesCo ntext(clas sMode = Cl assMode.AF TER_EACH_T EST_METHOD ) | |
| 58 | ||
| 59 | public cla ss OpenCDS FhirTest{ | |
| 60 | ||
| 61 | @Autow ired | |
| 62 | Applic ationConte xt appCont ext; | |
| 63 | ||
| 64 | @Autow ired(requi red=false) | |
| 65 | privat e EngineIn stanceStat eManagemen tIFace eis m; | |
| 66 | ||
| 67 | @Ignor e("This is really an integrati on test") | |
| 68 | @Test | |
| 69 | public void xxte stFhirPayl oadAAA(){ | |
| 70 | Op enCDS open CDS = new OpenCDS(); | |
| 71 | openCDS.se tEndPoint( "http:// IP /opencds") ; | |
| 72 | Li st<Rule> r ules = new ArrayList <>(); | |
| 73 | Ru le rule = new Rule() ; | |
| 74 | Pr operties p rops = new Propertie s(); | |
| 75 | pr ops.put("s copingEnti tyId", "co m.cognitiv e"); | |
| 76 | pr ops.put("b usinessId" , "abdomin alAorticAn eurysmScre ening"); | |
| 77 | pr ops.put("v ersion","1 .0.0"); | |
| 78 | ru le.setProp erties(pro ps); | |
| 79 | ru les.add(ru le); | |
| 80 | St ring paylo ad = getFh irString(" patientObs .json"); | |
| 81 | Re sultBundle result = openCDS.in voke(rules , payload, "11111", eism); | |
| 82 | Sy stem.out.p rintln(res ult.getRes ults().get (0).getBod y()); | |
| 83 | St ring body = (String )result.ge tResults() .get(0).ge tBody(); | |
| 84 | as sertTrue(b ody.contai ns("Commun icationReq uest")); | |
| 85 | ||
| 86 | } | |
| 87 | @Ignor e("This is really an integrati on test") | |
| 88 | @Test | |
| 89 | public void xxte stFhirPayl oadGender( ){ | |
| 90 | Op enCDS open CDS = new OpenCDS(); | |
| 91 | openCDS.se tEndPoint( "http:// IP /opencds") ; | |
| 92 | ||
| 93 | Li st<Rule> r ules = new ArrayList <>(); | |
| 94 | Ru le rule = new Rule() ; | |
| 95 | Pr operties p rops = new Propertie s(); | |
| 96 | pr ops.put("s copingEnti tyId", "co m.cognitiv e"); | |
| 97 | pr ops.put("b usinessId" , "genderA ge"); | |
| 98 | pr ops.put("v ersion","1 .0.0"); | |
| 99 | ru le.setProp erties(pro ps); | |
| 100 | ru les.add(ru le); | |
| 101 | St ring paylo ad = getFh irString(" patientObs .json"); | |
| 102 | ||
| 103 | Re sultBundle result = openCDS.in voke(rules , payload, "11111", eism); | |
| 104 | Sy stem.out.p rintln(res ult.getRes ults().get (0).getBod y()); | |
| 105 | St ring body = (String )result.ge tResults() .get(0).ge tBody(); | |
| 106 | as sertTrue(b ody.contai ns("Commun icationReq uest")); | |
| 107 | } | |
| 108 | ||
| 109 | @Ignor e("This is really an integrati on test") | |
| 110 | @Test | |
| 111 | public void xtes tFhirPaylo adHTN(){ | |
| 112 | Op enCDS open CDS = new OpenCDS(); | |
| 113 | openCDS.se tEndPoint( "http:// IP /opencds") ; | |
| 114 | Li st<Rule> r ules = new ArrayList <>(); | |
| 115 | Ru le rule = new Rule() ; | |
| 116 | Pr operties p rops = new Propertie s(); | |
| 117 | pr ops.put("s copingEnti tyId", "co m.cognitiv e"); | |
| 118 | pr ops.put("b usinessId" , "hyperte nsion"); | |
| 119 | pr ops.put("v ersion","1 .0.0"); | |
| 120 | ru le.setProp erties(pro ps); | |
| 121 | ru les.add(ru le); | |
| 122 | St ring paylo ad = getFh irString(" vitals.jso n"); | |
| 123 | Re sultBundle result = openCDS.in voke(rules , payload, "11111", eism); | |
| 124 | Sy stem.out.p rintln(res ult.getRes ults().get (0).getBod y()); | |
| 125 | St ring body = (String )result.ge tResults() .get(0).ge tBody(); | |
| 126 | as sertTrue(b ody.contai ns("Commun icationReq uest")); | |
| 127 | } | |
| 128 | privat e String g etFhirStri ng(String file){ | |
| 129 | St ringBuilde r tmp = ne w StringBu ilder(); | |
| 130 | tr y { | |
| 131 | InputStr eam is = a ppContext. getResourc e("classpa th:" + fil e).getInpu tStream(); | |
| 132 | Buffered Reader br = new Buff eredReader (new Input StreamRead er(is)); | |
| 133 | String s CurrentLin e; | |
| 134 | while (( sCurrentLi ne = br.re adLine()) != null) { | |
| 135 | tmp.appe nd(sCurren tLine); | |
| 136 | } | |
| 137 | } ca tch (IOExc eption e) { | |
| 138 | e.prin tStackTrac e(); | |
| 139 | } | |
| 140 | retu rn tmp.toS tring(); | |
| 141 | } | |
| 142 | ||
| 143 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.