Produced by Araxis Merge on 6/9/2017 3:51:15 PM 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jun 9 19:51:15 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-server\src\test\java\gov\va\nvap\service\permission | SampleXACMLRequestBuilder.java | Fri Apr 21 20:03:30 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 928 |
| 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 te mplate, ch oose Tools | Templat es | |||||
| 3 | * and ope n the temp late in th e editor. | |||||
| 4 | */ | |||||
| 5 | ||||||
| 6 | package go v.va.nvap. service.pe rmission; | |||||
| 7 | ||||||
| 8 | ||||||
| 9 | ||||||
| 10 | import gov .va.nvap.s erver.serv ice.permis sion.commo n.XACMLCon textConsta nts; | |||||
| 11 | import gov .va.nvap.s erver.serv ice.permis sion.commo n.XACMLCon textUtil; | |||||
| 12 | ||||||
| 13 | import jav a.util.Arr ayList; | |||||
| 14 | import jav a.util.Lis t; | |||||
| 15 | ||||||
| 16 | import jav ax.xml.bin d.JAXBCont ext; | |||||
| 17 | import jav ax.xml.bin d.JAXBElem ent; | |||||
| 18 | import jav ax.xml.bin d.JAXBExce ption; | |||||
| 19 | import jav ax.xml.bin d.Marshall er; | |||||
| 20 | import jav ax.xml.nam espace.QNa me; | |||||
| 21 | ||||||
| 22 | import oas is.names.t c.xacml._2 _0.context .schema.os .ActionTyp e; | |||||
| 23 | import oas is.names.t c.xacml._2 _0.context .schema.os .Attribute Type; | |||||
| 24 | import oas is.names.t c.xacml._2 _0.context .schema.os .Attribute ValueType; | |||||
| 25 | import oas is.names.t c.xacml._2 _0.context .schema.os .RequestTy pe; | |||||
| 26 | import oas is.names.t c.xacml._2 _0.context .schema.os .ResourceT ype; | |||||
| 27 | import oas is.names.t c.xacml._2 _0.context .schema.os .ResponseT ype; | |||||
| 28 | import oas is.names.t c.xacml._2 _0.context .schema.os .SubjectTy pe; | |||||
| 29 | ||||||
| 30 | /** | |||||
| 31 | * | |||||
| 32 | * @author Anand Sas try | |||||
| 33 | */ | |||||
| 34 | public cla ss SampleX ACMLReques tBuilder | |||||
| 35 | { | |||||
| 36 | private static fi nal String ACTION_AT TRIBUTE_ID = "urn:oa sis:names: tc:xacml:1 .0:action: action-id" ; | |||||
| 37 | private static fi nal String SUBJECT_H OME_COMMUN ITY_ATTRIB UTE_ID = " http://www .hhs.gov/h ealthit/nh in#HomeCom munityId"; | |||||
| 38 | private static fi nal String RESOURCE_ HOME_COMMU NITY_ATTRI BUTE_ID = "urn:gov:h hs:fha:nhi nc:home-co mmunity-id "; | |||||
| 39 | private static fi nal String SUBJECT_P URPOSE_FOR _USE_ATTRI BUTE_ID = "urn:oasis :names:tc: xspa:1.0:s ubject:pur poseofuse" ; | |||||
| 40 | private static fi nal String SUBJECT_S UBJECT_ID_ ATTRIBUTE_ ID = "urn: oasis:name s:tc:xacml :1.0:subje ct:subject -id"; | |||||
| 41 | private static fi nal String RESOURCE_ ATTRIBUTE_ ID = "urn: oasis:name s:tc:xacml :1.0:resou rce:resour ce-id"; | |||||
| 42 | ||||||
| 43 | public static Re questType buildNHINO utCheckPol icyRequest () | |||||
| 44 | { | |||||
| 45 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 46 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 47 | ||||||
| 48 | se tAction(re questType, "NHINOut" ); | |||||
| 49 | ||||||
| 50 | se tRequestor Subject(re questType, "TestUser ", ""); | |||||
| 51 | ||||||
| 52 | re turn reque stType; | |||||
| 53 | } | |||||
| 54 | ||||||
| 55 | public static Re questType buildBasic ValidInbou ndDocQuery InByDODReq uestor() | |||||
| 56 | { | |||||
| 57 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 58 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 59 | ||||||
| 60 | se tAction(re questType, "Document QueryIn"); | |||||
| 61 | ||||||
| 62 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 63 | ||||||
| 64 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.42.1000 1.100001.1 2"); | |||||
| 65 | ||||||
| 66 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 67 | ||||||
| 68 | re turn reque stType; | |||||
| 69 | } | |||||
| 70 | public static Re questType buildValid InboundDoc QueryInByR equestorIn PatientExc ludedOrgan ization() | |||||
| 71 | { | |||||
| 72 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 73 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 74 | ||||||
| 75 | se tAction(re questType, "Document QueryIn"); | |||||
| 76 | ||||||
| 77 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 78 | ||||||
| 79 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.715"); | |||||
| 80 | ||||||
| 81 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 82 | ||||||
| 83 | re turn reque stType; | |||||
| 84 | } | |||||
| 85 | ||||||
| 86 | public static Re questType buildValid InboundDoc QueryInByR equestorIn PatientAll owedOrgani zation() | |||||
| 87 | { | |||||
| 88 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 89 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 90 | ||||||
| 91 | se tAction(re questType, "Document QueryIn"); | |||||
| 92 | ||||||
| 93 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 94 | ||||||
| 95 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.424"); | |||||
| 96 | ||||||
| 97 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 98 | ||||||
| 99 | re turn reque stType; | |||||
| 100 | } | |||||
| 101 | ||||||
| 102 | public static Re questType buildValid InboundDoc QueryInByN onDODReque storPatien tOptedOut( ) | |||||
| 103 | { | |||||
| 104 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 105 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 106 | ||||||
| 107 | se tAction(re questType, "Document QueryIn"); | |||||
| 108 | ||||||
| 109 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 110 | ||||||
| 111 | se tRequestor Resource(r equestType , "123459" , "2.16.84 0.1.113883 .3.424"); | |||||
| 112 | ||||||
| 113 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 114 | ||||||
| 115 | re turn reque stType; | |||||
| 116 | } | |||||
| 117 | ||||||
| 118 | public static Re questType buildValid InboundDoc QueryInByD ODRequesto rPatientOp tedOut() | |||||
| 119 | { | |||||
| 120 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 121 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 122 | ||||||
| 123 | se tAction(re questType, "Document QueryIn"); | |||||
| 124 | ||||||
| 125 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 126 | ||||||
| 127 | se tRequestor Resource(r equestType , "123459" , "2.16.84 0.1.113883 .3.42.1000 1.100001.1 2"); | |||||
| 128 | ||||||
| 129 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 130 | ||||||
| 131 | re turn reque stType; | |||||
| 132 | } | |||||
| 133 | ||||||
| 134 | public static Re questType buildValid InboundDoc QueryOutBy RequestorI nPatientAl lowedOrgan ization() | |||||
| 135 | { | |||||
| 136 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 137 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 138 | ||||||
| 139 | se tAction(re questType, "Document QueryOut") ; | |||||
| 140 | ||||||
| 141 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 142 | ||||||
| 143 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.424"); | |||||
| 144 | ||||||
| 145 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 146 | ||||||
| 147 | re turn reque stType; | |||||
| 148 | } | |||||
| 149 | ||||||
| 150 | public static Re questType buildValid InboundDoc RetrieveIn ByRequesto rInPatient AllowedOrg anization( ) | |||||
| 151 | { | |||||
| 152 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 153 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 154 | ||||||
| 155 | se tAction(re questType, "Document RetrieveIn "); | |||||
| 156 | ||||||
| 157 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 158 | ||||||
| 159 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.424"); | |||||
| 160 | ||||||
| 161 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 162 | ||||||
| 163 | re turn reque stType; | |||||
| 164 | } | |||||
| 165 | ||||||
| 166 | public static Re questType buildValid InboundDoc RetrieveOu tByRequest orInPatien tAllowedOr ganization () | |||||
| 167 | { | |||||
| 168 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 169 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 170 | ||||||
| 171 | se tAction(re questType, "Document RetrieveOu t"); | |||||
| 172 | ||||||
| 173 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 174 | ||||||
| 175 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.424"); | |||||
| 176 | ||||||
| 177 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 178 | ||||||
| 179 | re turn reque stType; | |||||
| 180 | } | |||||
| 181 | ||||||
| 182 | public static Re questType buildValid InboundPat ientDiscov eryInByReq uestorInPa tientAllow edOrganiza tion() | |||||
| 183 | { | |||||
| 184 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 185 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 186 | ||||||
| 187 | se tAction(re questType, "PatientD iscoveryIn "); | |||||
| 188 | ||||||
| 189 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 190 | ||||||
| 191 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.424"); | |||||
| 192 | ||||||
| 193 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 194 | ||||||
| 195 | re turn reque stType; | |||||
| 196 | } | |||||
| 197 | ||||||
| 198 | public static Re questType buildValid InboundPat ientDiscov eryOutByRe questorInP atientAllo wedOrganiz ation() | |||||
| 199 | { | |||||
| 200 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 201 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 202 | ||||||
| 203 | se tAction(re questType, "PatientD iscoveryOu t"); | |||||
| 204 | ||||||
| 205 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 206 | ||||||
| 207 | se tRequestor Resource(r equestType , "123457" , "2.16.84 0.1.113883 .3.424"); | |||||
| 208 | ||||||
| 209 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 210 | ||||||
| 211 | re turn reque stType; | |||||
| 212 | } | |||||
| 213 | ||||||
| 214 | public static Re questType buildNHINO utWithVali dOrgId() | |||||
| 215 | { | |||||
| 216 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 217 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 218 | ||||||
| 219 | se tAction(re questType, "NHINOut" ); | |||||
| 220 | ||||||
| 221 | se tRequestor Subject(re questType, "983:1234 ", "TREATM ENT"); | |||||
| 222 | ||||||
| 223 | se tRequestor Resource(r equestType , "", "2.1 6.840.1.11 3883.3.424 "); | |||||
| 224 | ||||||
| 225 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 226 | ||||||
| 227 | re turn reque stType; | |||||
| 228 | } | |||||
| 229 | ||||||
| 230 | public static Re questType buildNHINO utWithInVa lidOrgId() | |||||
| 231 | { | |||||
| 232 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 233 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 234 | ||||||
| 235 | se tAction(re questType, "NHINOut" ); | |||||
| 236 | ||||||
| 237 | se tRequestor Subject(re questType, "943:1234 ", "TREATM ENT"); | |||||
| 238 | ||||||
| 239 | se tRequestor Resource(r equestType , "", "2.1 6.840.1.11 3883.3.424 "); | |||||
| 240 | ||||||
| 241 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 242 | ||||||
| 243 | re turn reque stType; | |||||
| 244 | } | |||||
| 245 | ||||||
| 246 | public static Re questType buildDocQu eryInByDOD RequestorW ithInvalid Patient() | |||||
| 247 | { | |||||
| 248 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 249 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 250 | ||||||
| 251 | se tAction(re questType, "Document QueryIn"); | |||||
| 252 | ||||||
| 253 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 254 | ||||||
| 255 | se tRequestor Resource(r equestType , "123", " 2.16.840.1 .113883.3. 42.10001.1 00001.12") ; | |||||
| 256 | ||||||
| 257 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 258 | ||||||
| 259 | re turn reque stType; | |||||
| 260 | } | |||||
| 261 | ||||||
| 262 | public static Re questType buildDocQu eryInByDOD RequestorW ithMissing Patient() | |||||
| 263 | { | |||||
| 264 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 265 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 266 | ||||||
| 267 | se tAction(re questType, "Document QueryIn"); | |||||
| 268 | ||||||
| 269 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 270 | ||||||
| 271 | St ring patie nt = null; | |||||
| 272 | se tRequestor Resource(r equestType , patient, "2.16.840 .1.113883. 3.42.10001 .100001.12 "); | |||||
| 273 | ||||||
| 274 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 275 | ||||||
| 276 | re turn reque stType; | |||||
| 277 | } | |||||
| 278 | ||||||
| 279 | public static Re questType buildDocQu eryInByDOD RequestorW ithMissing Action() | |||||
| 280 | { | |||||
| 281 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 282 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 283 | ||||||
| 284 | se tAction(re questType, ""); | |||||
| 285 | ||||||
| 286 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 287 | ||||||
| 288 | St ring patie nt = null; | |||||
| 289 | se tRequestor Resource(r equestType , patient, "2.16.840 .1.113883. 3.42.10001 .100001.12 "); | |||||
| 290 | ||||||
| 291 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 292 | ||||||
| 293 | re turn reque stType; | |||||
| 294 | } | |||||
| 295 | ||||||
| 296 | public static Re questType buildDocQu eryInByDOD RequestorW ithMissing POU() | |||||
| 297 | { | |||||
| 298 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 299 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 300 | ||||||
| 301 | se tAction(re questType, "Document QueryIn"); | |||||
| 302 | ||||||
| 303 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", ""); | |||||
| 304 | ||||||
| 305 | se tRequestor Resource(r equestType , "123456" , "2.16.84 0.1.113883 .3.42.1000 1.100001.1 2"); | |||||
| 306 | ||||||
| 307 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 308 | ||||||
| 309 | re turn reque stType; | |||||
| 310 | } | |||||
| 311 | ||||||
| 312 | public static Re questType buildDocQu eryInByDOD RequestorW ithInvalid POU() | |||||
| 313 | { | |||||
| 314 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 315 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 316 | ||||||
| 317 | se tAction(re questType, "Document QueryIn"); | |||||
| 318 | ||||||
| 319 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "INVALIDPO U"); | |||||
| 320 | ||||||
| 321 | se tRequestor Resource(r equestType , "123456" , "2.16.84 0.1.113883 .3.42.1000 1.100001.1 2"); | |||||
| 322 | ||||||
| 323 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 324 | ||||||
| 325 | re turn reque stType; | |||||
| 326 | } | |||||
| 327 | ||||||
| 328 | public static Re questType buildDocQu eryInByDOD RequestorW ithMissing HCID() | |||||
| 329 | { | |||||
| 330 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 331 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 332 | ||||||
| 333 | se tAction(re questType, "Document QueryIn"); | |||||
| 334 | ||||||
| 335 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 336 | ||||||
| 337 | se tRequestor Resource(r equestType , "123456" , ""); | |||||
| 338 | ||||||
| 339 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 340 | ||||||
| 341 | re turn reque stType; | |||||
| 342 | } | |||||
| 343 | ||||||
| 344 | public static Re questType buildDocQu eryInByDOD RequestorW ithUnsuppo rtedHCID() | |||||
| 345 | { | |||||
| 346 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 347 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 348 | ||||||
| 349 | se tAction(re questType, "Document QueryIn"); | |||||
| 350 | ||||||
| 351 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 352 | ||||||
| 353 | se tRequestor Resource(r equestType , "123456" , "1.2.3") ; | |||||
| 354 | ||||||
| 355 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 356 | ||||||
| 357 | re turn reque stType; | |||||
| 358 | } | |||||
| 359 | ||||||
| 360 | ||||||
| 361 | public static Re questType buildDocQu eryInByDOD RequestorW ithUnsuppo rtedAction () | |||||
| 362 | { | |||||
| 363 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 364 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 365 | ||||||
| 366 | se tAction(re questType, "Unsuppor ted"); | |||||
| 367 | ||||||
| 368 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 369 | ||||||
| 370 | se tRequestor Resource(r equestType , "123456" , "2.16.84 0.1.113883 .3.42.1000 1.100001.1 2"); | |||||
| 371 | ||||||
| 372 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 373 | ||||||
| 374 | re turn reque stType; | |||||
| 375 | } | |||||
| 376 | ||||||
| 377 | ||||||
| 378 | public static Re questType buildPatie ntDiscover yOutCheckP olicyReque st(String userId, St ring patie ntId, Stri ng pou, St ring hcid) | |||||
| 379 | { | |||||
| 380 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 381 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 382 | ||||||
| 383 | se tAction(re questType, "PatientD iscoveryOu t"); | |||||
| 384 | ||||||
| 385 | se tRequestor Subject(re questType, userId, p ou); | |||||
| 386 | ||||||
| 387 | se tRequestor Resource(r equestType , patientI d, hcid); | |||||
| 388 | ||||||
| 389 | re turn reque stType; | |||||
| 390 | } | |||||
| 391 | ||||||
| 392 | public static Re questType buildDocum entQueryOu tCheckPoli cyRequest( String use rId, Strin g patientI d, String pou, Strin g hcid) | |||||
| 393 | { | |||||
| 394 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 395 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 396 | ||||||
| 397 | se tAction(re questType, "Document QueryOut") ; | |||||
| 398 | ||||||
| 399 | se tRequestor Subject(re questType, userId, p ou); | |||||
| 400 | ||||||
| 401 | se tRequestor Resource(r equestType , patientI d, hcid); | |||||
| 402 | ||||||
| 403 | re turn reque stType; | |||||
| 404 | } | |||||
| 405 | ||||||
| 406 | public static Re questType buildValid InboundDoc QueryInByD ODRequesto rNoOptIn() | |||||
| 407 | { | |||||
| 408 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 409 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 410 | ||||||
| 411 | se tAction(re questType, "Document QueryIn"); | |||||
| 412 | ||||||
| 413 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 414 | ||||||
| 415 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.42.1 0001.10000 1.12"); | |||||
| 416 | ||||||
| 417 | // DOD opt-in not speci fied | |||||
| 418 | ||||||
| 419 | se tAllowedHC IDs(reques tType); | |||||
| 420 | ||||||
| 421 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 422 | ||||||
| 423 | re turn reque stType; | |||||
| 424 | } | |||||
| 425 | ||||||
| 426 | public static Re questType buildValid OutboundDo cQueryOutB yDODReques torNoOptIn () | |||||
| 427 | { | |||||
| 428 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 429 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 430 | ||||||
| 431 | se tAction(re questType, "Document QueryOut") ; | |||||
| 432 | ||||||
| 433 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 434 | ||||||
| 435 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.42.1 0001.10000 1.12"); | |||||
| 436 | ||||||
| 437 | // DOD opt-in not speci fied | |||||
| 438 | ||||||
| 439 | se tAllowedHC IDs(reques tType); | |||||
| 440 | ||||||
| 441 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 442 | ||||||
| 443 | re turn reque stType; | |||||
| 444 | } | |||||
| 445 | ||||||
| 446 | public static Re questType buildValid InboundDoc QueryInByD ODRequesto rWithOptIn () | |||||
| 447 | { | |||||
| 448 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 449 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 450 | ||||||
| 451 | se tAction(re questType, "Document QueryIn"); | |||||
| 452 | ||||||
| 453 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 454 | ||||||
| 455 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.42.1 0001.10000 1.12"); | |||||
| 456 | ||||||
| 457 | // DOD opt-in specified | |||||
| 458 | ||||||
| 459 | se tAllowedHC IDs(reques tType); | |||||
| 460 | ||||||
| 461 | se tOptIn(req uestType, "YES"); | |||||
| 462 | ||||||
| 463 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 464 | ||||||
| 465 | re turn reque stType; | |||||
| 466 | } | |||||
| 467 | ||||||
| 468 | public static Re questType buildValid OutboundDo cQueryOutB yDODReques torWithOpt In() | |||||
| 469 | { | |||||
| 470 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 471 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 472 | ||||||
| 473 | se tAction(re questType, "Document QueryOut") ; | |||||
| 474 | ||||||
| 475 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 476 | ||||||
| 477 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.42.1 0001.10000 1.12"); | |||||
| 478 | ||||||
| 479 | // DOD opt-in specified | |||||
| 480 | ||||||
| 481 | se tAllowedHC IDs(reques tType); | |||||
| 482 | ||||||
| 483 | se tOptIn(req uestType, "YES"); | |||||
| 484 | ||||||
| 485 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 486 | ||||||
| 487 | re turn reque stType; | |||||
| 488 | } | |||||
| 489 | ||||||
| 490 | ||||||
| 491 | public static Re questType buildValid InboundDoc QueryInByN onDODReque storWithOp tIn() | |||||
| 492 | { | |||||
| 493 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 494 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 495 | ||||||
| 496 | se tAction(re questType, "Document QueryIn"); | |||||
| 497 | ||||||
| 498 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 499 | ||||||
| 500 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 501 | ||||||
| 502 | // DOD opt-in specified | |||||
| 503 | ||||||
| 504 | se tAllowedHC IDs(reques tType); | |||||
| 505 | ||||||
| 506 | se tOptIn(req uestType, "YES"); | |||||
| 507 | ||||||
| 508 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 509 | ||||||
| 510 | re turn reque stType; | |||||
| 511 | } | |||||
| 512 | ||||||
| 513 | public static Re questType buildValid OutboundDo cQueryOutB yNonDODReq uestorWith OptIn() | |||||
| 514 | { | |||||
| 515 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 516 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 517 | ||||||
| 518 | se tAction(re questType, "Document QueryOut") ; | |||||
| 519 | ||||||
| 520 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 521 | ||||||
| 522 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 523 | ||||||
| 524 | // DOD opt-in specified | |||||
| 525 | ||||||
| 526 | se tAllowedHC IDs(reques tType); | |||||
| 527 | ||||||
| 528 | se tOptIn(req uestType, "YES"); | |||||
| 529 | ||||||
| 530 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 531 | ||||||
| 532 | re turn reque stType; | |||||
| 533 | } | |||||
| 534 | ||||||
| 535 | public static Re questType buildValid InboundDoc RetrieveIn ByNonDODRe questorWit hOptIn() | |||||
| 536 | { | |||||
| 537 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 538 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 539 | ||||||
| 540 | se tAction(re questType, "Document RetrieveIn "); | |||||
| 541 | ||||||
| 542 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 543 | ||||||
| 544 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 545 | ||||||
| 546 | // DOD opt-in specified | |||||
| 547 | ||||||
| 548 | se tAllowedHC IDs(reques tType); | |||||
| 549 | ||||||
| 550 | se tOptIn(req uestType, "YES"); | |||||
| 551 | ||||||
| 552 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 553 | ||||||
| 554 | re turn reque stType; | |||||
| 555 | } | |||||
| 556 | ||||||
| 557 | public static Re questType buildValid OutboundDo cRetrieveO utByNonDOD RequestorW ithOptIn() | |||||
| 558 | { | |||||
| 559 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 560 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 561 | ||||||
| 562 | se tAction(re questType, "Document RetrieveOu t"); | |||||
| 563 | ||||||
| 564 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 565 | ||||||
| 566 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 567 | ||||||
| 568 | // DOD opt-in specified | |||||
| 569 | ||||||
| 570 | se tAllowedHC IDs(reques tType); | |||||
| 571 | ||||||
| 572 | se tOptIn(req uestType, "YES"); | |||||
| 573 | ||||||
| 574 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 575 | ||||||
| 576 | re turn reque stType; | |||||
| 577 | } | |||||
| 578 | ||||||
| 579 | public static Re questType buildValid InboundPat ientDiscov eryInByNon DODRequest orWithOptI n() | |||||
| 580 | { | |||||
| 581 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 582 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 583 | ||||||
| 584 | se tAction(re questType, "PatientD iscoveryIn "); | |||||
| 585 | ||||||
| 586 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 587 | ||||||
| 588 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 589 | ||||||
| 590 | // DOD opt-in specified | |||||
| 591 | ||||||
| 592 | se tAllowedHC IDs(reques tType); | |||||
| 593 | ||||||
| 594 | se tOptIn(req uestType, "YES"); | |||||
| 595 | ||||||
| 596 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 597 | ||||||
| 598 | re turn reque stType; | |||||
| 599 | } | |||||
| 600 | ||||||
| 601 | public static Re questType buildValid OutboundPa tientDisco veryOutByN onDODReque storWithOp tIn() | |||||
| 602 | { | |||||
| 603 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 604 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 605 | ||||||
| 606 | se tAction(re questType, "PatientD iscoveryOu t"); | |||||
| 607 | ||||||
| 608 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 609 | ||||||
| 610 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 611 | ||||||
| 612 | // DOD opt-in specified | |||||
| 613 | ||||||
| 614 | se tAllowedHC IDs(reques tType); | |||||
| 615 | ||||||
| 616 | se tOptIn(req uestType, "YES"); | |||||
| 617 | ||||||
| 618 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 619 | ||||||
| 620 | re turn reque stType; | |||||
| 621 | } | |||||
| 622 | ||||||
| 623 | public static Re questType buildInval idInboundD ocQueryInB yNonDODReq uestorEmpt yOptIn() | |||||
| 624 | { | |||||
| 625 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 626 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 627 | ||||||
| 628 | se tAction(re questType, "Document QueryIn"); | |||||
| 629 | ||||||
| 630 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 631 | ||||||
| 632 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 633 | ||||||
| 634 | // DOD opt-in not speci fied | |||||
| 635 | ||||||
| 636 | se tAllowedHC IDs(reques tType); | |||||
| 637 | ||||||
| 638 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 639 | ||||||
| 640 | re turn reque stType; | |||||
| 641 | } | |||||
| 642 | ||||||
| 643 | public static Re questType buildInval idOutbound DocQueryOu tByNonDODR equestorEm ptyOptIn() | |||||
| 644 | { | |||||
| 645 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 646 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 647 | ||||||
| 648 | se tAction(re questType, "Document QueryOut") ; | |||||
| 649 | ||||||
| 650 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 651 | ||||||
| 652 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 653 | ||||||
| 654 | // DOD opt-in not speci fied | |||||
| 655 | ||||||
| 656 | se tAllowedHC IDs(reques tType); | |||||
| 657 | ||||||
| 658 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 659 | ||||||
| 660 | re turn reque stType; | |||||
| 661 | } | |||||
| 662 | ||||||
| 663 | public static Re questType buildInval idOutbound PatientDis coveryOutB yNonDODReq uestorEmpt yOptIn() | |||||
| 664 | { | |||||
| 665 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 666 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 667 | ||||||
| 668 | se tAction(re questType, "PatientD iscoveryOu t"); | |||||
| 669 | ||||||
| 670 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 671 | ||||||
| 672 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 673 | ||||||
| 674 | // DOD opt-in not speci fied | |||||
| 675 | ||||||
| 676 | se tAllowedHC IDs(reques tType); | |||||
| 677 | ||||||
| 678 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 679 | ||||||
| 680 | re turn reque stType; | |||||
| 681 | } | |||||
| 682 | ||||||
| 683 | public static Re questType buildInval idInboundD ocQueryInB yNonDODReq uestorNoOp tIn() | |||||
| 684 | { | |||||
| 685 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 686 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 687 | ||||||
| 688 | se tAction(re questType, "Document QueryIn"); | |||||
| 689 | ||||||
| 690 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 691 | ||||||
| 692 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 693 | ||||||
| 694 | // DOD opt-in not speci fied | |||||
| 695 | ||||||
| 696 | se tAllowedHC IDs(reques tType); | |||||
| 697 | ||||||
| 698 | se tOptIn(req uestType, "NO"); | |||||
| 699 | ||||||
| 700 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 701 | ||||||
| 702 | re turn reque stType; | |||||
| 703 | } | |||||
| 704 | ||||||
| 705 | public static Re questType buildInval idOutbound DocQueryOu tByNonDODR equestorNo OptIn() | |||||
| 706 | { | |||||
| 707 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 708 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 709 | ||||||
| 710 | se tAction(re questType, "Document QueryOut") ; | |||||
| 711 | ||||||
| 712 | se tRequestor Subject(re questType, "UserId-D oes-Not-Ma tter-For-T his-txn", "TREATMENT "); | |||||
| 713 | ||||||
| 714 | se tRequestor Resource(r equestType , "patient Id", "2.16 .840.1.113 883.3.488. 1"); | |||||
| 715 | ||||||
| 716 | // DOD opt-in not speci fied | |||||
| 717 | ||||||
| 718 | se tAllowedHC IDs(reques tType); | |||||
| 719 | ||||||
| 720 | se tOptIn(req uestType, "NO"); | |||||
| 721 | ||||||
| 722 | du mpRequestC ontents("R equestType ", request Type); | |||||
| 723 | ||||||
| 724 | re turn reque stType; | |||||
| 725 | } | |||||
| 726 | ||||||
| 727 | public static Re questType buildReque stWithoutA ction() | |||||
| 728 | { | |||||
| 729 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 730 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 731 | ||||||
| 732 | re turn reque stType; | |||||
| 733 | } | |||||
| 734 | ||||||
| 735 | public static Re questType buildReque stWithUnsu pportedAct ion() | |||||
| 736 | { | |||||
| 737 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 738 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 739 | ||||||
| 740 | se tAction(re questType, "Unsuppor ted"); | |||||
| 741 | se tRequestor Subject(re questType, "TestUser ", "Purpos eOfUse"); | |||||
| 742 | re turn reque stType; | |||||
| 743 | } | |||||
| 744 | ||||||
| 745 | public static Re questType buildReque stWithMiss ingPOU() | |||||
| 746 | { | |||||
| 747 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 748 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 749 | ||||||
| 750 | se tAction(re questType, "Unsuppor ted"); | |||||
| 751 | se tRequestor Subject(re questType, "TestUser ", ""); | |||||
| 752 | re turn reque stType; | |||||
| 753 | } | |||||
| 754 | ||||||
| 755 | public static Re questType buildWitho utHCID() | |||||
| 756 | { | |||||
| 757 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 758 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 759 | ||||||
| 760 | se tRequestor Subject(re questType, "TestUser ", "TREATM ENT"); | |||||
| 761 | ||||||
| 762 | se tRequestor Resource(r equestType , "patient Id", ""); | |||||
| 763 | ||||||
| 764 | re turn reque stType; | |||||
| 765 | } | |||||
| 766 | ||||||
| 767 | public static Re questType buildWitho utPatientI d() | |||||
| 768 | { | |||||
| 769 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 770 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 771 | ||||||
| 772 | se tRequestor Subject(re questType, "TestUser ", "TREATM ENT"); | |||||
| 773 | ||||||
| 774 | se tRequestor Resource(r equestType , "", "HCI D"); | |||||
| 775 | ||||||
| 776 | re turn reque stType; | |||||
| 777 | } | |||||
| 778 | ||||||
| 779 | ||||||
| 780 | public static Re questType buildWitho utPOU() | |||||
| 781 | { | |||||
| 782 | oa sis.names. tc.xacml._ 2_0.contex t.schema.o s.ObjectFa ctory objF actory = n ew oasis.n ames.tc.xa cml._2_0.c ontext.sch ema.os.Obj ectFactory (); | |||||
| 783 | Re questType requestTyp e = objFac tory.creat eRequestTy pe(); | |||||
| 784 | ||||||
| 785 | se tRequestor Subject(re questType, "TestUser ", ""); | |||||
| 786 | ||||||
| 787 | se tRequestor Resource(r equestType , "patient Id", "HCID "); | |||||
| 788 | ||||||
| 789 | re turn reque stType; | |||||
| 790 | } | |||||
| 791 | ||||||
| 792 | privat e static v oid setAct ion(Reques tType requ estType, S tring acti on) { | |||||
| 793 | At tributeVal ueType act ionAttribu teValue = new Attrib uteValueTy pe(); | |||||
| 794 | ac tionAttrib uteValue.g etContent( ).add(acti on); | |||||
| 795 | ||||||
| 796 | At tributeTyp e actionAt tribute = new Attrib uteType(); | |||||
| 797 | ac tionAttrib ute.setAtt ributeId(A CTION_ATTR IBUTE_ID); | |||||
| 798 | ac tionAttrib ute.getAtt ributeValu e().add(ac tionAttrib uteValue); | |||||
| 799 | ||||||
| 800 | Ac tionType a ctionType = new Acti onType(); | |||||
| 801 | ac tionType.g etAttribut e().add(ac tionAttrib ute); | |||||
| 802 | ||||||
| 803 | re questType. setAction( actionType ); | |||||
| 804 | } | |||||
| 805 | ||||||
| 806 | ||||||
| 807 | privat e static v oid setReq uestorSubj ect(Reques tType requ estType, | |||||
| 808 | Stri ng userId, String po u) { | |||||
| 809 | Su bjectType subject = new Subjec tType(); | |||||
| 810 | if (userId ! = null && userId.tri m().length () > 0) { | |||||
| 811 | Attr ibuteValue Type subje ctUserIdAt tributeVal ue = new A ttributeVa lueType(); | |||||
| 812 | subjectU serIdAttri buteValue. getContent ().add(use rId); | |||||
| 813 | ||||||
| 814 | Attribut eType subj ectUserIdA ttribute = new Attri buteType() ; | |||||
| 815 | subjectU serIdAttri bute.setAt tributeId( SUBJECT_SU BJECT_ID_A TTRIBUTE_I D); | |||||
| 816 | subjectU serIdAttri bute.getAt tributeVal ue().add(s ubjectUser IdAttribut eValue); | |||||
| 817 | ||||||
| 818 | subject. getAttribu te().add(s ubjectUser IdAttribut e); | |||||
| 819 | } | |||||
| 820 | ||||||
| 821 | ||||||
| 822 | if (pou != n ull && pou .trim().le ngth() > 0 ) { | |||||
| 823 | Attribut eValueType subjectPu rposeForUs eAttribute Value = ne w Attribut eValueType (); | |||||
| 824 | subjectP urposeForU seAttribut eValue.get Content(). add(pou); | |||||
| 825 | ||||||
| 826 | Attribut eType subj ectPurpose ForUseAttr ibute = ne w Attribut eType(); | |||||
| 827 | subjectP urposeForU seAttribut e.setAttri buteId(SUB JECT_PURPO SE_FOR_USE _ATTRIBUTE _ID); | |||||
| 828 | subjectP urposeForU seAttribut e.getAttri buteValue( ).add(subj ectPurpose ForUseAttr ibuteValue ); | |||||
| 829 | ||||||
| 830 | subject. getAttribu te().add(s ubjectPurp oseForUseA ttribute); | |||||
| 831 | } | |||||
| 832 | ||||||
| 833 | ||||||
| 834 | re questType. getSubject ().add(sub ject); | |||||
| 835 | } | |||||
| 836 | ||||||
| 837 | privat e static v oid setReq uestorReso urce(Reque stType req uestType, | |||||
| 838 | Stri ng patient Id, String hcid) { | |||||
| 839 | Re sourceType resource = new Reso urceType() ; | |||||
| 840 | if (patientI d != null && patient Id.trim(). length() > 0) { | |||||
| 841 | Attr ibuteValue Type resou rcePatient IdAttribut eValue = n ew Attribu teValueTyp e(); | |||||
| 842 | resource PatientIdA ttributeVa lue.getCon tent().add (patientId ); | |||||
| 843 | ||||||
| 844 | Attribut eType reso urcePatien tIdAttribu te = new A ttributeTy pe(); | |||||
| 845 | resource PatientIdA ttribute.s etAttribut eId(RESOUR CE_ATTRIBU TE_ID); | |||||
| 846 | resource PatientIdA ttribute.g etAttribut eValue().a dd(resourc ePatientId AttributeV alue); | |||||
| 847 | ||||||
| 848 | resource .getAttrib ute().add( resourcePa tientIdAtt ribute); | |||||
| 849 | } | |||||
| 850 | ||||||
| 851 | if (hcid != null && hc id.trim(). length() > 0) { | |||||
| 852 | ||||||
| 853 | Attribut eValueType resourceH omeCommuni tyIdAttrib uteValue = new Attri buteValueT ype(); | |||||
| 854 | resource HomeCommun ityIdAttri buteValue. getContent ().add(hci d); | |||||
| 855 | ||||||
| 856 | Attribut eType reso urceHomeCo mmunityIdA ttribute = new Attri buteType() ; | |||||
| 857 | resource HomeCommun ityIdAttri bute.setAt tributeId( RESOURCE_H OME_COMMUN ITY_ATTRIB UTE_ID); | |||||
| 858 | resource HomeCommun ityIdAttri bute.getAt tributeVal ue().add(r esourceHom eCommunity IdAttribut eValue); | |||||
| 859 | ||||||
| 860 | ||||||
| 861 | resource .getAttrib ute().add( resourceHo meCommunit yIdAttribu te); | |||||
| 862 | } | |||||
| 863 | ||||||
| 864 | ||||||
| 865 | ||||||
| 866 | re questType. getResourc e().add(re source); | |||||
| 867 | } | |||||
| 868 | ||||||
| 869 | privat e static v oid setAll owedHCIDs( RequestTyp e request) { | |||||
| 870 | Li st<String> patientAl lowedOrgs = new Arra yList<Stri ng>(); | |||||
| 871 | pa tientAllow edOrgs.add ("2.16.840 .1.113883. 3.190.6.10 0.1"); | |||||
| 872 | pa tientAllow edOrgs.add ("1.3.6.1. 4.1.26580" ); | |||||
| 873 | pa tientAllow edOrgs.add ("2.16.840 .1.113883. 3.715"); | |||||
| 874 | pa tientAllow edOrgs.add ("2.16.840 .1.113883. 3.488.1"); | |||||
| 875 | // even DOD h as to be a llowed | |||||
| 876 | pa tientAllow edOrgs.add ("2.16.840 .1.113883. 3.42.10001 .100001.12 "); | |||||
| 877 | ||||||
| 878 | XACM LContextUt il.addReso urceAttrib uteValues( | |||||
| 879 | XACMLCon textConsta nts.RESOUR CE_PATIENT _ALLOWED_O RGS_ATTR_I D, | |||||
| 880 | XACMLCon textConsta nts.STRING _ATTR_DATA _TYPE, | |||||
| 881 | patientA llowedOrgs , request) ; | |||||
| 882 | } | |||||
| 883 | ||||||
| 884 | privat e static v oid setOpt In(Request Type reque st, String value) { | |||||
| 885 | XA CMLContext Util.addRe sourceAttr ibuteValue ( | |||||
| 886 | XACMLC ontextCons tants.RESO URCE_OPTIN _ATTR_ID, | |||||
| 887 | XACMLC ontextCons tants.STRI NG_ATTR_DA TA_TYPE, | |||||
| 888 | value, request); | |||||
| 889 | } | |||||
| 890 | privat e static v oid dumpRe questConte nts(String context, RequestTyp e req) { | |||||
| 891 | try { | |||||
| 892 | JAXBCo ntext jaxb Context = JAXBContex t.newInsta nce(Reques tType.clas s); | |||||
| 893 | Marsha ller m = j axbContext .createMar shaller(); | |||||
| 894 | m.setPrope rty(Marsha ller.JAXB_ FORMATTED_ OUTPUT, tr ue); | |||||
| 895 | ||||||
| 896 | System.out .println(c ontext + " <<<" ); | |||||
| 897 | / / m.marsha l(req, Sys tem.out); | |||||
| 898 | ||||||
| 899 | m.marshal( new JAXBE lement( | |||||
| 900 | new QN ame("uri", "local"), RequestTyp e.class, r eq ), Syst em.out); | |||||
| 901 | System.out .println(c ontext + " >>>" ); | |||||
| 902 | } ca tch (JAXBE xception e ) { | |||||
| 903 | // TOD O Auto-gen erated cat ch block | |||||
| 904 | e.prin tStackTrac e(); | |||||
| 905 | } | |||||
| 906 | ||||||
| 907 | ||||||
| 908 | } | |||||
| 909 | ||||||
| 910 | pr ivate void dumpRspon seContents (String co ntext, Res ponseType req) { | |||||
| 911 | try { | |||||
| 912 | JAXBCo ntext jaxb Context = JAXBContex t.newInsta nce(Respon seType.cla ss); | |||||
| 913 | Marsha ller m = j axbContext .createMar shaller(); | |||||
| 914 | m.setPrope rty(Marsha ller.JAXB_ FORMATTED_ OUTPUT, tr ue); | |||||
| 915 | ||||||
| 916 | System.out .println(c ontext + " <<<" ); | |||||
| 917 | / / m.marsha l(req, Sys tem.out); | |||||
| 918 | ||||||
| 919 | m.marshal( new JAXBE lement( | |||||
| 920 | new QN ame("uri", "local"), ResponseTy pe.class, req ), Sys tem.out); | |||||
| 921 | System.out .println(c ontext + " >>>" ); | |||||
| 922 | } ca tch (JAXBE xception e ) { | |||||
| 923 | // TOD O Auto-gen erated cat ch block | |||||
| 924 | e.prin tStackTrac e(); | |||||
| 925 | } | |||||
| 926 | } | |||||
| 927 | ||||||
| 928 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.