Produced by Araxis Merge on 7/10/2017 1:01:44 PM 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 | C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\ImagingCommon\main\test\java\gov\va\med\imaging | StudyURNPatientIdentifierTest.java | Thu Jun 29 17:22:57 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\ImagingCommon\main\test\java\gov\va\med\imaging | StudyURNPatientIdentifierTest.java | Fri Jul 7 16:57:58 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 442 |
| Changed | 2 | 4 |
| 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 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: Jan 4, 2013 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.i maging; | |
| 27 | ||
| 28 | import gov .va.med.Pa tientIdent ifier; | |
| 29 | import gov .va.med.Pa tientIdent ifierType; | |
| 30 | import gov .va.med.SE RIALIZATIO N_FORMAT; | |
| 31 | import gov .va.med.UR NFactory; | |
| 32 | ||
| 33 | import org .junit.Tes t; | |
| 34 | import sta tic org.ju nit.Assert .*; | |
| 35 | ||
| 36 | /** | |
| 37 | * @author
|
|
| 38 | * | |
| 39 | */ | |
| 40 | public cla ss StudyUR NPatientId entifierTe st | |
| 41 | { | |
| 42 | ||
| 43 | @T est | |
| 44 | pu blic void testParsin gBhiePatie ntIdentifi er() | |
| 45 | { | |
| 46 | try | |
| 47 | { | |
| 48 | StudyU RN studyUr n = | |
| 49 | URNFactory .create("u rn:bhiestu dy:haims-e 15506fe-45 4f-4298-b3 28-93c34fd 9c3e3[1006 184063V088 473]", | |
| 50 | Stud yURN.class ); | |
| 51 | ||
| 52 | assert True(study Urn instan ceof BhieS tudyURN); | |
| 53 | BhieSt udyURN bhi eStudyUrn = (BhieStu dyURN)stud yUrn; | |
| 54 | assert Null(bhieS tudyUrn.ge tPatientId entifierTy pe()); | |
| 55 | assert Same(Patie ntIdentifi erType.icn , bhieStud yUrn.getPa tientIdent ifierTypeO rDefault() ); | |
| 56 | assert Equals("10 06184063V0 88473", bh ieStudyUrn .getPatien tId()); | |
| 57 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3", bhi eStudyUrn. toString() ); | |
| 58 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3", bhi eStudyUrn. toString(S ERIALIZATI ON_FORMAT. NATIVE)); | |
| 59 | assert Equals("ur n:vastudy: 200-haims% 2de15506fe %2d454f%2d 4298%2db32 8%2d93c34f d9c3e3[100 6184063V08 8473]", bh ieStudyUrn .toString( SERIALIZAT ION_FORMAT .CDTP)); | |
| 60 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3[10061 84063V0884 73]", bhie StudyUrn.t oString(SE RIALIZATIO N_FORMAT.R AW)); | |
| 61 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3%5b100 6184063V08 8473%5d", bhieStudyU rn.toStrin g(SERIALIZ ATION_FORM AT.VFTP)); | |
| 62 | ||
| 63 | } | |
| 64 | catc h(Exceptio n ex) | |
| 65 | { | |
| 66 | fail(e x.getMessa ge()); | |
| 67 | } | |
| 68 | } | |
| 69 | ||
| 70 | @T est | |
| 71 | pu blic void testCreati ngBhiePati entIdentif ier() | |
| 72 | { | |
| 73 | try | |
| 74 | { | |
| 75 | StudyU RN studyUr n = URNFac tory.creat e("urn:bhi estudy:hai ms-e15506f e-454f-429 8-b328-93c 34fd9c3e3" , | |
| 76 | Stud yURN.class ); | |
| 77 | assert True(study Urn instan ceof BhieS tudyURN); | |
| 78 | BhieSt udyURN bhi eStudyUrn = (BhieStu dyURN)stud yUrn; | |
| 79 | assert Null(bhieS tudyUrn.ge tPatientId entifierTy pe()); | |
| 80 | assert Null(bhieS tudyUrn.ge tPatientId ()); | |
| 81 | assert Null(bhieS tudyUrn.ge tPatientId entifier() ); | |
| 82 | ||
| 83 | bhieSt udyUrn.set PatientId( "12345"); | |
| 84 | ||
| 85 | assert Equals(Pat ientIdenti fierType.i cn, bhieSt udyUrn.get PatientIde ntifierTyp eOrDefault ()); | |
| 86 | ||
| 87 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3", bhi eStudyUrn. toString() ); | |
| 88 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3", bhi eStudyUrn. toString(S ERIALIZATI ON_FORMAT. NATIVE)); | |
| 89 | assert Equals("ur n:vastudy: 200-haims% 2de15506fe %2d454f%2d 4298%2db32 8%2d93c34f d9c3e3[123 45]", bhie StudyUrn.t oString(SE RIALIZATIO N_FORMAT.C DTP)); | |
| 90 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3[12345 ]", bhieSt udyUrn.toS tring(SERI ALIZATION_ FORMAT.RAW )); | |
| 91 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3%5b123 45%5d", bh ieStudyUrn .toString( SERIALIZAT ION_FORMAT .VFTP)); | |
| 92 | ||
| 93 | ||
| 94 | ||
| 95 | bhieSt udyUrn.set PatientIde ntifierTyp e(PatientI dentifierT ype.dfn); | |
| 96 | assert NotNull(bh ieStudyUrn .getPatien tId()); | |
| 97 | assert NotNull(bh ieStudyUrn .getPatien tIdentifie r()); | |
| 98 | assert NotNull(bh ieStudyUrn .getPatien tIdentifie rType()); | |
| 99 | assert Equals(Pat ientIdenti fierType.d fn, bhieSt udyUrn.get PatientIde ntifierTyp e()); | |
| 100 | assert Equals("12 345", bhie StudyUrn.g etPatientI d()); | |
| 101 | ||
| 102 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3", bhi eStudyUrn. toString() ); | |
| 103 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3", bhi eStudyUrn. toString(S ERIALIZATI ON_FORMAT. NATIVE)); | |
| 104 | assert Equals("ur n:vastudy: 200-haims% 2de15506fe %2d454f%2d 4298%2db32 8%2d93c34f d9c3e3[123 45][dfn]", bhieStudy Urn.toStri ng(SERIALI ZATION_FOR MAT.CDTP)) ; | |
| 105 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3[12345 ][dfn]", b hieStudyUr n.toString (SERIALIZA TION_FORMA T.RAW)); | |
| 106 | assert Equals("ur n:bhiestud y:haims-e1 5506fe-454 f-4298-b32 8-93c34fd9 c3e3%5b123 45%5d%5bdf n%5d", bhi eStudyUrn. toString(S ERIALIZATI ON_FORMAT. VFTP)); | |
| 107 | ||
| 108 | /* | |
| 109 | System .out.print ln("toStri ng(): " + bhieStudyU rn.toStrin g()); | |
| 110 | System .out.print ln("toStri ngCDTP(): " + bhieSt udyUrn.toS tring(SERI ALIZATION_ FORMAT.CDT P)); | |
| 111 | System .out.print ln("toStri ng(RAW): " + bhieStu dyUrn.toSt ring(SERIA LIZATION_F ORMAT.RAW) ); | |
| 112 | System .out.print ln("toStri ng(VFTP): " + bhieSt udyUrn.toS tring(SERI ALIZATION_ FORMAT.VFT P)); | |
| 113 | */ | |
| 114 | } | |
| 115 | catc h(Exceptio n ex) | |
| 116 | { | |
| 117 | fail(e x.getMessa ge()); | |
| 118 | } | |
| 119 | } | |
| 120 | ||
| 121 | @T est | |
| 122 | pu blic void testCreati ngStudyURN PatientIde ntifier() | |
| 123 | { | |
| 124 | try | |
| 125 | { | |
| 126 | StudyU RN studyUr n = StudyU RN.create( "660", "12 3", "456V7 89"); | |
| 127 | assert Null(study Urn.getPat ientIdenti fierType() ); | |
| 128 | assert Equals(Pat ientIdenti fierType.i cn, studyU rn.getPati entIdentif ierTypeOrD efault()); | |
| 129 | Patien tIdentifie r expected PatientIde ntifier = new Patien tIdentifie r("456V789 ", Patient Identifier Type.icn); | |
| 130 | assert Equals(exp ectedPatie ntIdentifi er, studyU rn.getTheP atientIden tifier()); | |
| 131 | ||
| 132 | assert Equals("ur n:vastudy: 660-123-45 6V789", st udyUrn.toS tring()); | |
| 133 | assert Equals("ur n:vastudy: 660-123-45 6V789", st udyUrn.toS tring(SERI ALIZATION_ FORMAT.NAT IVE)); | |
| 134 | assert Equals("ur n:vastudy: 660-123-45 6V789", st udyUrn.toS tring(SERI ALIZATION_ FORMAT.CDT P)); | |
| 135 | assert Equals("ur n:vastudy: 660-123-45 6V789", st udyUrn.toS tring(SERI ALIZATION_ FORMAT.RAW )); | |
| 136 | assert Equals("ur n:vastudy: 660-123-45 6V789", st udyUrn.toS tring(SERI ALIZATION_ FORMAT.VFT P)); | |
| 137 | ||
| 138 | studyU rn.setPati entIdentif ierType(Pa tientIdent ifierType. icn); | |
| 139 | assert Equals(Pat ientIdenti fierType.i cn, studyU rn.getPati entIdentif ierType()) ; | |
| 140 | ||
| 141 | assert Equals("ur n:vastudy: 660-123-45 6V789", st udyUrn.toS tring()); | |
| 142 | assert Equals("ur n:vastudy: 660-123-45 6V789", st udyUrn.toS tring(SERI ALIZATION_ FORMAT.NAT IVE)); | |
| 143 | assert Equals("ur n:vastudy: 660-123-45 6V789[icn] ", studyUr n.toString (SERIALIZA TION_FORMA T.CDTP)); | |
| 144 | assert Equals("ur n:vastudy: 660-123-45 6V789[icn] ", studyUr n.toString (SERIALIZA TION_FORMA T.RAW)); | |
| 145 | assert Equals("ur n:vastudy: 660-123-45 6V789%5bic n%5d", stu dyUrn.toSt ring(SERIA LIZATION_F ORMAT.VFTP )); | |
| 146 | ||
| 147 | // DFN | |
| 148 | studyU rn = Study URN.create ("660", "1 23", "456" ); | |
| 149 | assert Null(study Urn.getPat ientIdenti fierType() ); | |
| 150 | studyU rn.setPati entIdentif ierType(Pa tientIdent ifierType. dfn); | |
| 151 | assert Equals(Pat ientIdenti fierType.d fn, studyU rn.getPati entIdentif ierTypeOrD efault()); | |
| 152 | expect edPatientI dentifier = new Pati entIdentif ier("456", PatientId entifierTy pe.dfn); | |
| 153 | assert Equals(exp ectedPatie ntIdentifi er, studyU rn.getTheP atientIden tifier()); | |
| 154 | ||
| 155 | assert Equals("ur n:vastudy: 660-123-45 6", studyU rn.toStrin g()); | |
| 156 | assert Equals("ur n:vastudy: 660-123-45 6", studyU rn.toStrin g(SERIALIZ ATION_FORM AT.NATIVE) ); | |
| 157 | assert Equals("ur n:vastudy: 660-123-45 6[dfn]", s tudyUrn.to String(SER IALIZATION _FORMAT.CD TP)); | |
| 158 | assert Equals("ur n:vastudy: 660-123-45 6[dfn]", s tudyUrn.to String(SER IALIZATION _FORMAT.RA W)); | |
| 159 | assert Equals("ur n:vastudy: 660-123-45 6%5bdfn%5d ", studyUr n.toString (SERIALIZA TION_FORMA T.VFTP)); | |
| 160 | ||
| 161 | /* | |
| 162 | System .out.print ln("toStri ng(): " + studyUrn.t oString()) ; | |
| 163 | System .out.print ln("toStri ng(NATIVE) : " + stud yUrn.toStr ing(SERIAL IZATION_FO RMAT.NATIV E)); | |
| 164 | System .out.print ln("toStri ngCDTP(): " + studyU rn.toStrin g(SERIALIZ ATION_FORM AT.CDTP)); | |
| 165 | System .out.print ln("toStri ng(RAW): " + studyUr n.toString (SERIALIZA TION_FORMA T.RAW)); | |
| 166 | System .out.print ln("toStri ng(VFTP): " + studyU rn.toStrin g(SERIALIZ ATION_FORM AT.VFTP)); | |
| 167 | */ | |
| 168 | } | |
| 169 | catc h(Exceptio n ex) | |
| 170 | { | |
| 171 | fail(e x.getMessa ge()); | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 175 | @T est | |
| 176 | pu blic void testParsin gStudyURNP atientIden tifier() | |
| 177 | { | |
| 178 | try | |
| 179 | { | |
| 180 | StudyU RN studyUr n = URNFac tory.creat e("urn:vas tudy:660-1 23-456V789 ", StudyUR N.class); | |
| 181 | assert Null(study Urn.getPat ientIdenti fierType() ); | |
| 182 | assert Equals(Pat ientIdenti fierType.i cn, studyU rn.getDefa ultPatient Identifier Type()); | |
| 183 | assert Equals("45 6V789", st udyUrn.get PatientId( )); | |
| 184 | ||
| 185 | studyU rn = URNFa ctory.crea te("urn:va study:660- 123-456V78 9[icn]", S tudyURN.cl ass); | |
| 186 | assert NotNull(st udyUrn.get PatientIde ntifierTyp e()); | |
| 187 | assert Equals(Pat ientIdenti fierType.i cn, studyU rn.getPati entIdentif ierType()) ; | |
| 188 | assert Equals("45 6V789", st udyUrn.get PatientId( )); | |
| 189 | ||
| 190 | studyU rn = URNFa ctory.crea te("urn:va study:660- 123-456[df n]", Study URN.class) ; | |
| 191 | assert NotNull(st udyUrn.get PatientIde ntifierTyp e()); | |
| 192 | assert Equals(Pat ientIdenti fierType.d fn, studyU rn.getPati entIdentif ierType()) ; | |
| 193 | assert Equals("45 6", studyU rn.getPati entId()); | |
| 194 | } | |
| 195 | catc h(Exceptio n ex) | |
| 196 | { | |
| 197 | fail(e x.getMessa ge()); | |
| 198 | } | |
| 199 | } | |
| 200 | ||
| 201 | /* | |
| 202 | @T est | |
| 203 | pu blic void testCreati ngHaimsPat ientIdenti fier() | |
| 204 | { | |
| 205 | try | |
| 206 | { | |
| 207 | //urn: paid:2.16. 840.1.1138 83.3.198-2 .16.840.1. 113883.3.1 98.1-45678 9012110220 10134659 | |
| 208 | Global ArtifactId entifier g aid = Glo balArtifac tIdentifie rFactory.c reate("2.1 6.840.1.11 3883.3.198 ", "2.16.8 40.1.11388 3.3.198.1" , "4567890 1211022010 134659"); | |
| 209 | Patien tArtifactI dentifier paid = Pat ientArtifa ctIdentifi erImpl.cre ate(gaid, "100618406 3V088473") ; | |
| 210 | ||
| 211 | System .out.print ln("toStri ng(): " + paid.toStr ing()); | |
| 212 | System .out.print ln("toStri ng(NATIVE) : " + paid .toString( SERIALIZAT ION_FORMAT .NATIVE)); | |
| 213 | System .out.print ln("toStri ngCDTP(): " + paid.t oString(SE RIALIZATIO N_FORMAT.C DTP)); | |
| 214 | System .out.print ln("toStri ng(RAW): " + paid.to String(SER IALIZATION _FORMAT.RA W)); | |
| 215 | System .out.print ln("toStri ng(VFTP): " + paid.t oString(SE RIALIZATIO N_FORMAT.V FTP)); | |
| 216 | } | |
| 217 | catc h(Exceptio n ex) | |
| 218 | { | |
| 219 | fail(e x.getMessa ge()); | |
| 220 | } | |
| 221 | }* / | |
| 222 | ||
| 223 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.