View Javadoc
1   /*
2    * Copyright 2009 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.commons.ihe.xds.iti41;
17  
18  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsSubmitAuditDataset;
19  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsSubmitAuditStrategy30;
20  import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLSubmitObjectsRequest;
21  import org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30;
22  import org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType;
23  import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest;
24  
25  import java.util.Map;
26  
27  
28  /**
29   * Audit strategy for ITI-41.
30   *
31   * @author Dmytro Rud
32   */
33  abstract class Iti41AuditStrategy extends XdsSubmitAuditStrategy30 {
34  
35      /**
36       * Constructs the audit strategy.
37       *
38       * @param serverSide whether this is a server-side or a client-side strategy.
39       */
40      public Iti41AuditStrategy(boolean serverSide) {
41          super(serverSide);
42      }
43  
44      @Override
45      public XdsSubmitAuditDataset enrichAuditDatasetFromRequest(XdsSubmitAuditDataset auditDataset, Object pojo, Map<String, Object> parameters) {
46          ProvideAndRegisterDocumentSetRequestType request = (ProvideAndRegisterDocumentSetRequestType) pojo;
47          SubmitObjectsRequest submitObjectsRequest = request.getSubmitObjectsRequest();
48          if (submitObjectsRequest != null) {
49              EbXMLSubmitObjectsRequest ebXML = new EbXMLSubmitObjectsRequest30(submitObjectsRequest);
50              enrichDatasetFromSubmitObjectsRequest(auditDataset, ebXML);
51          }
52          return auditDataset;
53      }
54  
55  }