001package org.hl7.fhir.dstu2016may.model.codesystems;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum MapTransform {
041
042        /**
043         * create(type : string) - type is passed through to the application on the standard API, and must be known by it
044         */
045        CREATE, 
046        /**
047         * copy(source)
048         */
049        COPY, 
050        /**
051         * truncate(source, length) - source must be stringy type
052         */
053        TRUNCATE, 
054        /**
055         * escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped
056         */
057        ESCAPE, 
058        /**
059         * cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known
060         */
061        CAST, 
062        /**
063         * append(source...) - source is element or string
064         */
065        APPEND, 
066        /**
067         * translate(source, uri_of_map) - use the translate operation
068         */
069        TRANSLATE, 
070        /**
071         * reference(source : object) - return a string that references the provided tree properly
072         */
073        REFERENCE, 
074        /**
075         * something
076         */
077        DATEOP, 
078        /**
079         * something
080         */
081        UUID, 
082        /**
083         * something
084         */
085        POINTER, 
086        /**
087         * something
088         */
089        EVALUATE, 
090        /**
091         * added to help the parsers
092         */
093        NULL;
094        public static MapTransform fromCode(String codeString) throws FHIRException {
095            if (codeString == null || "".equals(codeString))
096                return null;
097        if ("create".equals(codeString))
098          return CREATE;
099        if ("copy".equals(codeString))
100          return COPY;
101        if ("truncate".equals(codeString))
102          return TRUNCATE;
103        if ("escape".equals(codeString))
104          return ESCAPE;
105        if ("cast".equals(codeString))
106          return CAST;
107        if ("append".equals(codeString))
108          return APPEND;
109        if ("translate".equals(codeString))
110          return TRANSLATE;
111        if ("reference".equals(codeString))
112          return REFERENCE;
113        if ("dateOp".equals(codeString))
114          return DATEOP;
115        if ("uuid".equals(codeString))
116          return UUID;
117        if ("pointer".equals(codeString))
118          return POINTER;
119        if ("evaluate".equals(codeString))
120          return EVALUATE;
121        throw new FHIRException("Unknown MapTransform code '"+codeString+"'");
122        }
123        public String toCode() {
124          switch (this) {
125            case CREATE: return "create";
126            case COPY: return "copy";
127            case TRUNCATE: return "truncate";
128            case ESCAPE: return "escape";
129            case CAST: return "cast";
130            case APPEND: return "append";
131            case TRANSLATE: return "translate";
132            case REFERENCE: return "reference";
133            case DATEOP: return "dateOp";
134            case UUID: return "uuid";
135            case POINTER: return "pointer";
136            case EVALUATE: return "evaluate";
137            case NULL: return null;
138            default: return "?";
139          }
140        }
141        public String getSystem() {
142          return "http://hl7.org/fhir/map-transform";
143        }
144        public String getDefinition() {
145          switch (this) {
146            case CREATE: return "create(type : string) - type is passed through to the application on the standard API, and must be known by it";
147            case COPY: return "copy(source)";
148            case TRUNCATE: return "truncate(source, length) - source must be stringy type";
149            case ESCAPE: return "escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped";
150            case CAST: return "cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known";
151            case APPEND: return "append(source...) - source is element or string";
152            case TRANSLATE: return "translate(source, uri_of_map) - use the translate operation";
153            case REFERENCE: return "reference(source : object) - return a string that references the provided tree properly";
154            case DATEOP: return "something";
155            case UUID: return "something";
156            case POINTER: return "something";
157            case EVALUATE: return "something";
158            case NULL: return null;
159            default: return "?";
160          }
161        }
162        public String getDisplay() {
163          switch (this) {
164            case CREATE: return "create";
165            case COPY: return "copy";
166            case TRUNCATE: return "truncate";
167            case ESCAPE: return "escape";
168            case CAST: return "cast";
169            case APPEND: return "append";
170            case TRANSLATE: return "translate";
171            case REFERENCE: return "reference";
172            case DATEOP: return "dateOp";
173            case UUID: return "uuid";
174            case POINTER: return "pointer";
175            case EVALUATE: return "evaluate";
176            case NULL: return null;
177            default: return "?";
178          }
179    }
180
181
182}