001package org.hl7.fhir.r4.model.codesystems;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
033
034import org.hl7.fhir.exceptions.FHIRException;
035
036public enum UdiEntryType {
037
038  /**
039   * a barcodescanner captured the data from the device label.
040   */
041  BARCODE,
042  /**
043   * An RFID chip reader captured the data from the device label.
044   */
045  RFID,
046  /**
047   * The data was read from the label by a person and manually entered. (e.g. via
048   * a keyboard).
049   */
050  MANUAL,
051  /**
052   * The data originated from a patient's implant card and was read by an
053   * operator.
054   */
055  CARD,
056  /**
057   * The data originated from a patient source and was not directly scanned or
058   * read from a label or card.
059   */
060  SELFREPORTED,
061  /**
062   * The method of data capture has not been determined.
063   */
064  UNKNOWN,
065  /**
066   * added to help the parsers
067   */
068  NULL;
069
070  public static UdiEntryType fromCode(String codeString) throws FHIRException {
071    if (codeString == null || "".equals(codeString))
072      return null;
073    if ("barcode".equals(codeString))
074      return BARCODE;
075    if ("rfid".equals(codeString))
076      return RFID;
077    if ("manual".equals(codeString))
078      return MANUAL;
079    if ("card".equals(codeString))
080      return CARD;
081    if ("self-reported".equals(codeString))
082      return SELFREPORTED;
083    if ("unknown".equals(codeString))
084      return UNKNOWN;
085    throw new FHIRException("Unknown UdiEntryType code '" + codeString + "'");
086  }
087
088  public String toCode() {
089    switch (this) {
090    case BARCODE:
091      return "barcode";
092    case RFID:
093      return "rfid";
094    case MANUAL:
095      return "manual";
096    case CARD:
097      return "card";
098    case SELFREPORTED:
099      return "self-reported";
100    case UNKNOWN:
101      return "unknown";
102    case NULL:
103      return null;
104    default:
105      return "?";
106    }
107  }
108
109  public String getSystem() {
110    return "http://hl7.org/fhir/udi-entry-type";
111  }
112
113  public String getDefinition() {
114    switch (this) {
115    case BARCODE:
116      return "a barcodescanner captured the data from the device label.";
117    case RFID:
118      return "An RFID chip reader captured the data from the device label.";
119    case MANUAL:
120      return "The data was read from the label by a person and manually entered. (e.g.  via a keyboard).";
121    case CARD:
122      return "The data originated from a patient's implant card and was read by an operator.";
123    case SELFREPORTED:
124      return "The data originated from a patient source and was not directly scanned or read from a label or card.";
125    case UNKNOWN:
126      return "The method of data capture has not been determined.";
127    case NULL:
128      return null;
129    default:
130      return "?";
131    }
132  }
133
134  public String getDisplay() {
135    switch (this) {
136    case BARCODE:
137      return "Barcode";
138    case RFID:
139      return "RFID";
140    case MANUAL:
141      return "Manual";
142    case CARD:
143      return "Card";
144    case SELFREPORTED:
145      return "Self Reported";
146    case UNKNOWN:
147      return "Unknown";
148    case NULL:
149      return null;
150    default:
151      return "?";
152    }
153  }
154
155}