001package org.hl7.fhir.r5.utils;
002
003import org.hl7.fhir.exceptions.FHIRException;
004import org.hl7.fhir.r5.model.Base;
005import org.hl7.fhir.r5.model.Configuration;
006import org.hl7.fhir.r5.model.EnumFactory;
007import org.hl7.fhir.r5.model.Enumeration;
008import org.hl7.fhir.r5.model.PrimitiveType;
009
010public enum GuideParameterCode {
011  /**
012   * If the value of this string 0..* parameter is one of the metadata fields then all conformance resources will have any specified [Resource].[field] overwritten with the ImplementationGuide.[field], where field is one of: version, date, status, publisher, contact, copyright, experimental, jurisdiction, useContext.
013   */
014  APPLY, 
015  /**
016   * The value of this string 0..* parameter is a subfolder of the build context's location that is to be scanned to load resources. Scope is (if present) a particular resource type.
017   */
018  PATHRESOURCE, 
019  /**
020   * The value of this string 0..1 parameter is a subfolder of the build context's location that contains files that are part of the html content processed by the builder.
021   */
022  PATHPAGES, 
023  /**
024   * The value of this string 0..1 parameter is a subfolder of the build context's location that is used as the terminology cache. If this is not present, the terminology cache is on the local system, not under version control.
025   */
026  PATHTXCACHE, 
027  /**
028   * The value of this string 0..* parameter is a parameter (name=value) when expanding value sets for this implementation guide. This is particularly used to specify the versions of published terminologies such as SNOMED CT.
029   */
030  EXPANSIONPARAMETER, 
031  /**
032   * The value of this string 0..1 parameter is either "warning" or "error" (default = "error"). If the value is "warning" then IG build tools allow the IG to be considered successfully build even when there is no internal broken links.
033   */
034  RULEBROKENLINKS, 
035  /**
036   * The value of this boolean 0..1 parameter specifies whether the IG publisher creates examples in XML format. If not present, the Publication Tool decides whether to generate XML.
037   */
038  GENERATEXML, 
039  /**
040   * The value of this boolean 0..1 parameter specifies whether the IG publisher creates examples in JSON format. If not present, the Publication Tool decides whether to generate JSON.
041   */
042  GENERATEJSON, 
043  /**
044   * The value of this boolean 0..1 parameter specifies whether the IG publisher creates examples in Turtle format. If not present, the Publication Tool decides whether to generate Turtle.
045   */
046  GENERATETURTLE, 
047  /**
048   * The value of this string singleton parameter is the name of the file to use as the builder template for each generated page (see templating).
049   */
050  HTMLTEMPLATE, 
051  /**
052   * added to help the parsers with the generic types
053   */
054  NULL;
055  public static GuideParameterCode fromCode(String codeString) throws FHIRException {
056    if (codeString == null || "".equals(codeString))
057      return null;
058    if ("apply".equals(codeString))
059      return APPLY;
060    if ("path-resource".equals(codeString))
061      return PATHRESOURCE;
062    if ("path-pages".equals(codeString))
063      return PATHPAGES;
064    if ("path-tx-cache".equals(codeString))
065      return PATHTXCACHE;
066    if ("expansion-parameter".equals(codeString))
067      return EXPANSIONPARAMETER;
068    if ("rule-broken-links".equals(codeString))
069      return RULEBROKENLINKS;
070    if ("generate-xml".equals(codeString))
071      return GENERATEXML;
072    if ("generate-json".equals(codeString))
073      return GENERATEJSON;
074    if ("generate-turtle".equals(codeString))
075      return GENERATETURTLE;
076    if ("html-template".equals(codeString))
077      return HTMLTEMPLATE;
078    if (Configuration.isAcceptInvalidEnums())
079      return null;
080    else
081      throw new FHIRException("Unknown GuideParameterCode code '"+codeString+"'");
082  }
083  public String toCode() {
084    switch (this) {
085    case APPLY: return "apply";
086    case PATHRESOURCE: return "path-resource";
087    case PATHPAGES: return "path-pages";
088    case PATHTXCACHE: return "path-tx-cache";
089    case EXPANSIONPARAMETER: return "expansion-parameter";
090    case RULEBROKENLINKS: return "rule-broken-links";
091    case GENERATEXML: return "generate-xml";
092    case GENERATEJSON: return "generate-json";
093    case GENERATETURTLE: return "generate-turtle";
094    case HTMLTEMPLATE: return "html-template";
095    case NULL: return null;
096    default: return "?";
097    }
098  }
099  public String getSystem() {
100    switch (this) {
101    case APPLY: return "http://hl7.org/fhir/guide-parameter-code";
102    case PATHRESOURCE: return "http://hl7.org/fhir/guide-parameter-code";
103    case PATHPAGES: return "http://hl7.org/fhir/guide-parameter-code";
104    case PATHTXCACHE: return "http://hl7.org/fhir/guide-parameter-code";
105    case EXPANSIONPARAMETER: return "http://hl7.org/fhir/guide-parameter-code";
106    case RULEBROKENLINKS: return "http://hl7.org/fhir/guide-parameter-code";
107    case GENERATEXML: return "http://hl7.org/fhir/guide-parameter-code";
108    case GENERATEJSON: return "http://hl7.org/fhir/guide-parameter-code";
109    case GENERATETURTLE: return "http://hl7.org/fhir/guide-parameter-code";
110    case HTMLTEMPLATE: return "http://hl7.org/fhir/guide-parameter-code";
111    case NULL: return null;
112    default: return "?";
113    }
114  }
115  public String getDefinition() {
116    switch (this) {
117    case APPLY: return "If the value of this string 0..* parameter is one of the metadata fields then all conformance resources will have any specified [Resource].[field] overwritten with the ImplementationGuide.[field], where field is one of: version, date, status, publisher, contact, copyright, experimental, jurisdiction, useContext.";
118    case PATHRESOURCE: return "The value of this string 0..* parameter is a subfolder of the build context's location that is to be scanned to load resources. Scope is (if present) a particular resource type.";
119    case PATHPAGES: return "The value of this string 0..1 parameter is a subfolder of the build context's location that contains files that are part of the html content processed by the builder.";
120    case PATHTXCACHE: return "The value of this string 0..1 parameter is a subfolder of the build context's location that is used as the terminology cache. If this is not present, the terminology cache is on the local system, not under version control.";
121    case EXPANSIONPARAMETER: return "The value of this string 0..* parameter is a parameter (name=value) when expanding value sets for this implementation guide. This is particularly used to specify the versions of published terminologies such as SNOMED CT.";
122    case RULEBROKENLINKS: return "The value of this string 0..1 parameter is either \"warning\" or \"error\" (default = \"error\"). If the value is \"warning\" then IG build tools allow the IG to be considered successfully build even when there is no internal broken links.";
123    case GENERATEXML: return "The value of this boolean 0..1 parameter specifies whether the IG publisher creates examples in XML format. If not present, the Publication Tool decides whether to generate XML.";
124    case GENERATEJSON: return "The value of this boolean 0..1 parameter specifies whether the IG publisher creates examples in JSON format. If not present, the Publication Tool decides whether to generate JSON.";
125    case GENERATETURTLE: return "The value of this boolean 0..1 parameter specifies whether the IG publisher creates examples in Turtle format. If not present, the Publication Tool decides whether to generate Turtle.";
126    case HTMLTEMPLATE: return "The value of this string singleton parameter is the name of the file to use as the builder template for each generated page (see templating).";
127    case NULL: return null;
128    default: return "?";
129    }
130  }
131  public String getDisplay() {
132    switch (this) {
133    case APPLY: return "Apply Metadata Value";
134    case PATHRESOURCE: return "Resource Path";
135    case PATHPAGES: return "Pages Path";
136    case PATHTXCACHE: return "Terminology Cache Path";
137    case EXPANSIONPARAMETER: return "Expansion Profile";
138    case RULEBROKENLINKS: return "Broken Links Rule";
139    case GENERATEXML: return "Generate XML";
140    case GENERATEJSON: return "Generate JSON";
141    case GENERATETURTLE: return "Generate Turtle";
142    case HTMLTEMPLATE: return "HTML Template";
143    case NULL: return null;
144    default: return "?";
145    }
146  }
147  public class GuideParameterCodeEnumFactory implements EnumFactory<GuideParameterCode> {
148    public GuideParameterCode fromCode(String codeString) throws IllegalArgumentException {
149      if (codeString == null || "".equals(codeString))
150        if (codeString == null || "".equals(codeString))
151          return null;
152      if ("apply".equals(codeString))
153        return GuideParameterCode.APPLY;
154      if ("path-resource".equals(codeString))
155        return GuideParameterCode.PATHRESOURCE;
156      if ("path-pages".equals(codeString))
157        return GuideParameterCode.PATHPAGES;
158      if ("path-tx-cache".equals(codeString))
159        return GuideParameterCode.PATHTXCACHE;
160      if ("expansion-parameter".equals(codeString))
161        return GuideParameterCode.EXPANSIONPARAMETER;
162      if ("rule-broken-links".equals(codeString))
163        return GuideParameterCode.RULEBROKENLINKS;
164      if ("generate-xml".equals(codeString))
165        return GuideParameterCode.GENERATEXML;
166      if ("generate-json".equals(codeString))
167        return GuideParameterCode.GENERATEJSON;
168      if ("generate-turtle".equals(codeString))
169        return GuideParameterCode.GENERATETURTLE;
170      if ("html-template".equals(codeString))
171        return GuideParameterCode.HTMLTEMPLATE;
172      throw new IllegalArgumentException("Unknown GuideParameterCode code '"+codeString+"'");
173    }
174    public Enumeration<GuideParameterCode> fromType(Base code) throws FHIRException {
175      if (code == null)
176        return null;
177      if (code.isEmpty())
178        return new Enumeration<GuideParameterCode>(this);
179      String codeString = ((PrimitiveType) code).asStringValue();
180      if (codeString == null || "".equals(codeString))
181        return null;
182      if ("apply".equals(codeString))
183        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.APPLY);
184      if ("path-resource".equals(codeString))
185        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.PATHRESOURCE);
186      if ("path-pages".equals(codeString))
187        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.PATHPAGES);
188      if ("path-tx-cache".equals(codeString))
189        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.PATHTXCACHE);
190      if ("expansion-parameter".equals(codeString))
191        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.EXPANSIONPARAMETER);
192      if ("rule-broken-links".equals(codeString))
193        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.RULEBROKENLINKS);
194      if ("generate-xml".equals(codeString))
195        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.GENERATEXML);
196      if ("generate-json".equals(codeString))
197        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.GENERATEJSON);
198      if ("generate-turtle".equals(codeString))
199        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.GENERATETURTLE);
200      if ("html-template".equals(codeString))
201        return new Enumeration<GuideParameterCode>(this, GuideParameterCode.HTMLTEMPLATE);
202      throw new FHIRException("Unknown GuideParameterCode code '"+codeString+"'");
203    }
204    public String toCode(GuideParameterCode code) {
205      if (code == GuideParameterCode.APPLY)
206        return "apply";
207      if (code == GuideParameterCode.PATHRESOURCE)
208        return "path-resource";
209      if (code == GuideParameterCode.PATHPAGES)
210        return "path-pages";
211      if (code == GuideParameterCode.PATHTXCACHE)
212        return "path-tx-cache";
213      if (code == GuideParameterCode.EXPANSIONPARAMETER)
214        return "expansion-parameter";
215      if (code == GuideParameterCode.RULEBROKENLINKS)
216        return "rule-broken-links";
217      if (code == GuideParameterCode.GENERATEXML)
218        return "generate-xml";
219      if (code == GuideParameterCode.GENERATEJSON)
220        return "generate-json";
221      if (code == GuideParameterCode.GENERATETURTLE)
222        return "generate-turtle";
223      if (code == GuideParameterCode.HTMLTEMPLATE)
224        return "html-template";
225      return "?";
226    }
227    public String toSystem(GuideParameterCode code) {
228      return code.getSystem();
229    }
230  }
231}