View Javadoc
1   /*
2    * Copyright 2017 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.dicom.DICOMEventIdCodes;
19  import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes;
20  import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881ParticipantObjectCodes;
21  import org.openhealthtools.ihe.atna.auditor.events.ihe.GenericIHEAuditEventMessage;
22  import org.openhealthtools.ihe.atna.auditor.models.rfc3881.CodedValueType;
23  
24  import java.util.List;
25  
26  /**
27   * ATNA Audit event for ITI-59.
28   * @author Dmytro Rud
29   *
30   * @deprecated
31   */
32  public class HpdEvent extends GenericIHEAuditEventMessage {
33  
34      public HpdEvent(
35              boolean systemIsSource,
36              RFC3881EventCodes.RFC3881EventActionCodes actionCode,
37              RFC3881EventCodes.RFC3881EventOutcomeCodes outcome,
38              List<CodedValueType> purposesOfUse)
39      {
40          super(systemIsSource,
41                outcome,
42                systemIsSource ? RFC3881EventCodes.RFC3881EventActionCodes.READ : actionCode,
43                systemIsSource ? new DICOMEventIdCodes.Export() : new DICOMEventIdCodes.Import(),
44                new CustomIHETransactionEventTypeCodes.ProviderInformationFeed(),
45                purposesOfUse);
46      }
47  
48      public void addProviderParticipantObject(String providerId) {
49          addParticipantObjectIdentification(
50                  CustomParticipantObjectIDTypeCodes.ISO21091_IDENTIFIER,
51                  null,
52                  null,
53                  null,
54                  providerId,
55                  RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeCodes.ORGANIZATION,
56                  RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeRoleCodes.PROVIDER,
57                  null,
58                  null);
59      }
60  
61      public void addEntryParticipantObject(String dn) {
62          addParticipantObjectIdentification(
63                  CustomParticipantObjectIDTypeCodes.LDAP_DN,
64                  null,
65                  null,
66                  null,
67                  dn,
68                  RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeCodes.SYSTEM,
69                  RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeRoleCodes.RESOURCE,
70                  null,
71                  null);
72      }
73  
74  }