Last change
on this file since 507 was 507, checked in by George Lilly, 15 years ago |
NHIN gateway and adaptor for use on linux with VistA EHR and RPMS
|
File size:
1.7 KB
|
Rev | Line | |
---|
[507] | 1 | /*
|
---|
| 2 | * To change this template, choose Tools | Templates
|
---|
| 3 | * and open the template in the editor.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | package gov.hhs.fha.nhinc.gateway.policyenginetransformation.Helpers;
|
---|
| 7 |
|
---|
| 8 | import gov.hhs.fha.nhinc.common.nhinccommon.AssertionType;
|
---|
| 9 |
|
---|
| 10 | /**
|
---|
| 11 | *
|
---|
| 12 | * @author rayj
|
---|
| 13 | */
|
---|
| 14 | public class AssertionHelper {
|
---|
| 15 | public static String extractUserName(AssertionType assertion) {
|
---|
| 16 | String username = null;
|
---|
| 17 | if ((assertion != null) && (assertion.getUserInfo() != null) && (assertion.getUserInfo().getUserName() != null)) {
|
---|
| 18 | username = assertion.getUserInfo().getUserName();
|
---|
| 19 | }
|
---|
| 20 | return username;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | public static String extractUserHomeCommunity(AssertionType assertion) {
|
---|
| 24 | String username = null;
|
---|
| 25 | if ((assertion != null) && (assertion.getUserInfo() != null) && (assertion.getUserInfo().getOrg() != null) && (assertion.getUserInfo().getOrg().getHomeCommunityId() != null)) {
|
---|
| 26 | username = assertion.getUserInfo().getOrg().getHomeCommunityId();
|
---|
| 27 | }
|
---|
| 28 | return username;
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | static String extractPurpose(AssertionType assertion) {
|
---|
| 32 | String purpose = null;
|
---|
| 33 | if ((assertion != null) && (assertion.getPurposeOfDisclosureCoded() != null) && (assertion.getPurposeOfDisclosureCoded().getCode() != null)) {
|
---|
| 34 | purpose = assertion.getPurposeOfDisclosureCoded().getCode();
|
---|
| 35 | }
|
---|
| 36 | return purpose;
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | static String extractUserRole(AssertionType assertion) {
|
---|
| 40 | String userRole = null;
|
---|
| 41 | if ((assertion != null) && (assertion.getUserInfo() != null) && (assertion.getUserInfo().getRoleCoded() != null) && (assertion.getUserInfo().getRoleCoded().getCode() != null)) {
|
---|
| 42 | userRole = assertion.getUserInfo().getRoleCoded().getCode();
|
---|
| 43 | }
|
---|
| 44 | return userRole;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.