source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Common/DocumentTransformEJB/src/java/gov/hhs/fha/nhinc/transform/document/DocumentTransformHelper.java@ 507

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: 2.6 KB
Line 
1package gov.hhs.fha.nhinc.transform.document;
2
3import gov.hhs.fha.nhinc.common.nhinccommondocumenttransform.ReplaceAdhocQueryPatientIdResponseType;
4import gov.hhs.fha.nhinc.common.nhinccommondocumenttransform.ReplaceAdhocQueryPatientIdRequestType;
5
6import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest;
7
8import org.apache.commons.logging.Log;
9import org.apache.commons.logging.LogFactory;
10
11/**
12 * Class to perform transform operations for document query messages.
13 *
14 * @author Neil Webb
15 */
16public class DocumentTransformHelper
17{
18 private static Log log = LogFactory.getLog(DocumentTransformHelper.class);
19
20 /**
21 * Replace the patient identifier information in an AdhocQuery message with the information
22 * provided in the request. The information replaced includes the community id, assigning
23 * authority, and patient identifier.
24 *
25 * @param replaceAdhocQueryPatientIdRequest Request message containing the AdhocQuery message
26 * and patient identifier information
27 * @return Altered AdhocQuery Message
28 */
29 public ReplaceAdhocQueryPatientIdResponseType replaceAdhocQueryPatientId(ReplaceAdhocQueryPatientIdRequestType replaceAdhocQueryPatientIdRequest)
30 {
31 log.debug("DocumentTransformHelper.replaceAdhocQueryPatientId() -- Begin");
32 ReplaceAdhocQueryPatientIdResponseType response = new ReplaceAdhocQueryPatientIdResponseType();
33
34 if ((replaceAdhocQueryPatientIdRequest != null) &&
35 (replaceAdhocQueryPatientIdRequest.getAdhocQueryRequest() != null))
36 {
37 // Collect input data
38 String homeCommunityId = replaceAdhocQueryPatientIdRequest.getHomeCommunityId();
39 String assigningAuthorityId = null;
40 String patientId = null;
41 if(replaceAdhocQueryPatientIdRequest.getQualifiedSubjectIdentifier() != null)
42 {
43 assigningAuthorityId = replaceAdhocQueryPatientIdRequest.getQualifiedSubjectIdentifier().getAssigningAuthorityIdentifier();
44 patientId = replaceAdhocQueryPatientIdRequest.getQualifiedSubjectIdentifier().getSubjectIdentifier();
45 }
46
47 // Call transform
48 DocumentQueryTransform transform = new DocumentQueryTransform();
49 AdhocQueryRequest adhocQueryRequest = transform.replaceAdhocQueryPatientId(replaceAdhocQueryPatientIdRequest.getAdhocQueryRequest(), homeCommunityId, assigningAuthorityId, patientId);
50 response.setAdhocQueryRequest(adhocQueryRequest);
51
52 }
53
54 log.debug("DocumentQueryTransform.replaceAdhocQueryPatientId() -- End");
55 return response;
56 }
57
58}
Note: See TracBrowser for help on using the repository browser.