View Javadoc
1   /*
2    * Copyright 2010 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.core.atna.custom;
17  
18  import org.openhealthtools.ihe.atna.auditor.codes.ihe.IHETransactionEventTypeCodes;
19  import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes.RFC3881EventOutcomeCodes;
20  import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeCodes;
21  import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeRoleCodes;
22  import org.openhealthtools.ihe.atna.auditor.events.ihe.QueryEvent;
23  import org.openhealthtools.ihe.atna.auditor.models.rfc3881.CodedValueType;
24  import org.openhealthtools.ihe.atna.auditor.utils.EventUtils;
25  
26  import java.nio.charset.Charset;
27  import java.util.List;
28  
29  /**
30   * Special query event element type for ITI-56 (XCPD patient location query).
31   * @author Dmytro Rud
32   *
33   * @deprecated
34   */
35  public class Iti56QueryEvent extends QueryEvent {
36  
37      public Iti56QueryEvent(
38              boolean systemIsSource,
39              RFC3881EventOutcomeCodes outcome,
40              IHETransactionEventTypeCodes eventType,
41              List<CodedValueType> purposesOfUse)
42      {
43          super(systemIsSource, outcome, eventType, purposesOfUse);
44      }
45  
46      
47      protected void addQueryParametersObject(String payload) {
48          addParticipantObjectIdentification(
49                  this.eventType,
50                  null,
51                  EventUtils.encodeBase64(payload.getBytes(Charset.defaultCharset())),
52                  null,
53                  "PatientLocationQueryRequest",
54                  RFC3881ParticipantObjectTypeCodes.SYSTEM,
55                  RFC3881ParticipantObjectTypeRoleCodes.QUERY,
56                  null,
57                  null);
58      }
59      
60  }