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  
17  package org.openehealth.ipf.commons.audit.codes;
18  
19  import lombok.Getter;
20  import org.openehealth.ipf.commons.audit.types.ActiveParticipantRoleId;
21  import org.openehealth.ipf.commons.audit.types.EnumeratedCodedValue;
22  import org.openehealth.ipf.commons.audit.types.EnumeratedValueSet;
23  
24  /**
25   * Audit Active Participant Role ID Code as specified in
26   * http://dicom.nema.org/medical/dicom/current/output/html/part16.html#sect_CID_402
27   * 1.2.840.10008.6.1.905
28   * <p>
29   * ActiveParticipantRoleIdCode identifies which object took which role in the event.
30   * It also covers agents, multi-purpose entities, and multi-role entities.
31   * For the purpose of the event, one primary role is chosen.
32   * </p>
33   * <p>
34   * When describing a human user’s participation in an event, the RoleIDCode value should
35   * represent the access control roles/permissions that authorized the event.
36   * </p>
37   *
38   * @author Christian Ohr
39   * @since 3.5
40   */
41  public enum ActiveParticipantRoleIdCode implements ActiveParticipantRoleId, EnumeratedCodedValue<ActiveParticipantRoleId> {
42  
43      Application("110150", "Application"),
44      ApplicationLauncher("110151", "Application Launcher"),
45      Destination("110152", "Destination Role ID"),
46      Source("110153", "Source Role ID"),
47      DestinationMedia("110154", "Destination Media"),
48      SourceMedia("110155", "Source Media");
49  
50      @Getter
51      private ActiveParticipantRoleId value;
52  
53      ActiveParticipantRoleIdCode(String code, String displayName) {
54          this.value = ActiveParticipantRoleId.of(code, "DCM", displayName);
55      }
56  
57      public static ActiveParticipantRoleIdCode enumForCode(String code) {
58          return EnumeratedValueSet.enumForCode(ActiveParticipantRoleIdCode.class, code);
59      }
60  
61  }