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  
20  import lombok.Getter;
21  import org.openehealth.ipf.commons.audit.types.EnumeratedCodedValue;
22  import org.openehealth.ipf.commons.audit.types.EnumeratedValueSet;
23  import org.openehealth.ipf.commons.audit.types.MediaType;
24  
25  /**
26   * Media Type Code as specified in
27   * http://dicom.nema.org/medical/dicom/current/output/html/part16.html#sect_CID_405
28   * 1.2.840.10008.6.1.908
29   *
30   * @author Christian Ohr
31   * @since 3.5
32   */
33  public enum MediaTypeCode implements MediaType, EnumeratedCodedValue<MediaType> {
34  
35      Usb("110030", "USB Disk Emulation"),
36      Email("110031", "Email"),
37      CD("110032", "CD"),
38      DVD("110033", "DVD"),
39      CompactFlash("110034", "Compact Flash"),
40      MMC("110035", "Multi-media Card"),
41      SD("110036", "Secure Digital Card"),
42      URI("110037", "URI"),
43      Film("110010", "Film"),
44      PaperDocument("110038", "Paper Document");
45  
46      @Getter
47      private MediaType value;
48  
49      MediaTypeCode(String code, String displayName) {
50          this.value = MediaType.of(code, "DCM", displayName);
51      }
52  
53      public static MediaTypeCode enumForCode(String code) {
54          return EnumeratedValueSet.enumForCode(MediaTypeCode.class, code);
55      }
56  }