001package org.hl7.fhir.r4.model;
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 Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.r4.model.Enumerations.PublicationStatus;
040import org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory;
041import org.hl7.fhir.r4.model.Enumerations.SearchParamType;
042import org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.ResourceDef;
050import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
051
052/**
053 * A search parameter that defines a named search item that can be used to
054 * search/filter on a resource.
055 */
056@ResourceDef(name = "SearchParameter", profile = "http://hl7.org/fhir/StructureDefinition/SearchParameter")
057@ChildOrder(names = { "url", "version", "name", "derivedFrom", "status", "experimental", "date", "publisher", "contact",
058    "description", "useContext", "jurisdiction", "purpose", "code", "base", "type", "expression", "xpath", "xpathUsage",
059    "target", "multipleOr", "multipleAnd", "comparator", "modifier", "chain", "component" })
060public class SearchParameter extends MetadataResource {
061
062  public enum XPathUsageType {
063    /**
064     * The search parameter is derived directly from the selected nodes based on the
065     * type definitions.
066     */
067    NORMAL,
068    /**
069     * The search parameter is derived by a phonetic transform from the selected
070     * nodes.
071     */
072    PHONETIC,
073    /**
074     * The search parameter is based on a spatial transform of the selected nodes.
075     */
076    NEARBY,
077    /**
078     * The search parameter is based on a spatial transform of the selected nodes,
079     * using physical distance from the middle.
080     */
081    DISTANCE,
082    /**
083     * The interpretation of the xpath statement is unknown (and can't be
084     * automated).
085     */
086    OTHER,
087    /**
088     * added to help the parsers with the generic types
089     */
090    NULL;
091
092    public static XPathUsageType fromCode(String codeString) throws FHIRException {
093      if (codeString == null || "".equals(codeString))
094        return null;
095      if ("normal".equals(codeString))
096        return NORMAL;
097      if ("phonetic".equals(codeString))
098        return PHONETIC;
099      if ("nearby".equals(codeString))
100        return NEARBY;
101      if ("distance".equals(codeString))
102        return DISTANCE;
103      if ("other".equals(codeString))
104        return OTHER;
105      if (Configuration.isAcceptInvalidEnums())
106        return null;
107      else
108        throw new FHIRException("Unknown XPathUsageType code '" + codeString + "'");
109    }
110
111    public String toCode() {
112      switch (this) {
113      case NORMAL:
114        return "normal";
115      case PHONETIC:
116        return "phonetic";
117      case NEARBY:
118        return "nearby";
119      case DISTANCE:
120        return "distance";
121      case OTHER:
122        return "other";
123      case NULL:
124        return null;
125      default:
126        return "?";
127      }
128    }
129
130    public String getSystem() {
131      switch (this) {
132      case NORMAL:
133        return "http://hl7.org/fhir/search-xpath-usage";
134      case PHONETIC:
135        return "http://hl7.org/fhir/search-xpath-usage";
136      case NEARBY:
137        return "http://hl7.org/fhir/search-xpath-usage";
138      case DISTANCE:
139        return "http://hl7.org/fhir/search-xpath-usage";
140      case OTHER:
141        return "http://hl7.org/fhir/search-xpath-usage";
142      case NULL:
143        return null;
144      default:
145        return "?";
146      }
147    }
148
149    public String getDefinition() {
150      switch (this) {
151      case NORMAL:
152        return "The search parameter is derived directly from the selected nodes based on the type definitions.";
153      case PHONETIC:
154        return "The search parameter is derived by a phonetic transform from the selected nodes.";
155      case NEARBY:
156        return "The search parameter is based on a spatial transform of the selected nodes.";
157      case DISTANCE:
158        return "The search parameter is based on a spatial transform of the selected nodes, using physical distance from the middle.";
159      case OTHER:
160        return "The interpretation of the xpath statement is unknown (and can't be automated).";
161      case NULL:
162        return null;
163      default:
164        return "?";
165      }
166    }
167
168    public String getDisplay() {
169      switch (this) {
170      case NORMAL:
171        return "Normal";
172      case PHONETIC:
173        return "Phonetic";
174      case NEARBY:
175        return "Nearby";
176      case DISTANCE:
177        return "Distance";
178      case OTHER:
179        return "Other";
180      case NULL:
181        return null;
182      default:
183        return "?";
184      }
185    }
186  }
187
188  public static class XPathUsageTypeEnumFactory implements EnumFactory<XPathUsageType> {
189    public XPathUsageType fromCode(String codeString) throws IllegalArgumentException {
190      if (codeString == null || "".equals(codeString))
191        if (codeString == null || "".equals(codeString))
192          return null;
193      if ("normal".equals(codeString))
194        return XPathUsageType.NORMAL;
195      if ("phonetic".equals(codeString))
196        return XPathUsageType.PHONETIC;
197      if ("nearby".equals(codeString))
198        return XPathUsageType.NEARBY;
199      if ("distance".equals(codeString))
200        return XPathUsageType.DISTANCE;
201      if ("other".equals(codeString))
202        return XPathUsageType.OTHER;
203      throw new IllegalArgumentException("Unknown XPathUsageType code '" + codeString + "'");
204    }
205
206    public Enumeration<XPathUsageType> fromType(PrimitiveType<?> code) throws FHIRException {
207      if (code == null)
208        return null;
209      if (code.isEmpty())
210        return new Enumeration<XPathUsageType>(this, XPathUsageType.NULL, code);
211      String codeString = code.asStringValue();
212      if (codeString == null || "".equals(codeString))
213        return new Enumeration<XPathUsageType>(this, XPathUsageType.NULL, code);
214      if ("normal".equals(codeString))
215        return new Enumeration<XPathUsageType>(this, XPathUsageType.NORMAL, code);
216      if ("phonetic".equals(codeString))
217        return new Enumeration<XPathUsageType>(this, XPathUsageType.PHONETIC, code);
218      if ("nearby".equals(codeString))
219        return new Enumeration<XPathUsageType>(this, XPathUsageType.NEARBY, code);
220      if ("distance".equals(codeString))
221        return new Enumeration<XPathUsageType>(this, XPathUsageType.DISTANCE, code);
222      if ("other".equals(codeString))
223        return new Enumeration<XPathUsageType>(this, XPathUsageType.OTHER, code);
224      throw new FHIRException("Unknown XPathUsageType code '" + codeString + "'");
225    }
226
227    public String toCode(XPathUsageType code) {
228      if (code == XPathUsageType.NORMAL)
229        return "normal";
230      if (code == XPathUsageType.PHONETIC)
231        return "phonetic";
232      if (code == XPathUsageType.NEARBY)
233        return "nearby";
234      if (code == XPathUsageType.DISTANCE)
235        return "distance";
236      if (code == XPathUsageType.OTHER)
237        return "other";
238      return "?";
239    }
240
241    public String toSystem(XPathUsageType code) {
242      return code.getSystem();
243    }
244  }
245
246  public enum SearchComparator {
247    /**
248     * the value for the parameter in the resource is equal to the provided value.
249     */
250    EQ,
251    /**
252     * the value for the parameter in the resource is not equal to the provided
253     * value.
254     */
255    NE,
256    /**
257     * the value for the parameter in the resource is greater than the provided
258     * value.
259     */
260    GT,
261    /**
262     * the value for the parameter in the resource is less than the provided value.
263     */
264    LT,
265    /**
266     * the value for the parameter in the resource is greater or equal to the
267     * provided value.
268     */
269    GE,
270    /**
271     * the value for the parameter in the resource is less or equal to the provided
272     * value.
273     */
274    LE,
275    /**
276     * the value for the parameter in the resource starts after the provided value.
277     */
278    SA,
279    /**
280     * the value for the parameter in the resource ends before the provided value.
281     */
282    EB,
283    /**
284     * the value for the parameter in the resource is approximately the same to the
285     * provided value.
286     */
287    AP,
288    /**
289     * added to help the parsers with the generic types
290     */
291    NULL;
292
293    public static SearchComparator fromCode(String codeString) throws FHIRException {
294      if (codeString == null || "".equals(codeString))
295        return null;
296      if ("eq".equals(codeString))
297        return EQ;
298      if ("ne".equals(codeString))
299        return NE;
300      if ("gt".equals(codeString))
301        return GT;
302      if ("lt".equals(codeString))
303        return LT;
304      if ("ge".equals(codeString))
305        return GE;
306      if ("le".equals(codeString))
307        return LE;
308      if ("sa".equals(codeString))
309        return SA;
310      if ("eb".equals(codeString))
311        return EB;
312      if ("ap".equals(codeString))
313        return AP;
314      if (Configuration.isAcceptInvalidEnums())
315        return null;
316      else
317        throw new FHIRException("Unknown SearchComparator code '" + codeString + "'");
318    }
319
320    public String toCode() {
321      switch (this) {
322      case EQ:
323        return "eq";
324      case NE:
325        return "ne";
326      case GT:
327        return "gt";
328      case LT:
329        return "lt";
330      case GE:
331        return "ge";
332      case LE:
333        return "le";
334      case SA:
335        return "sa";
336      case EB:
337        return "eb";
338      case AP:
339        return "ap";
340      case NULL:
341        return null;
342      default:
343        return "?";
344      }
345    }
346
347    public String getSystem() {
348      switch (this) {
349      case EQ:
350        return "http://hl7.org/fhir/search-comparator";
351      case NE:
352        return "http://hl7.org/fhir/search-comparator";
353      case GT:
354        return "http://hl7.org/fhir/search-comparator";
355      case LT:
356        return "http://hl7.org/fhir/search-comparator";
357      case GE:
358        return "http://hl7.org/fhir/search-comparator";
359      case LE:
360        return "http://hl7.org/fhir/search-comparator";
361      case SA:
362        return "http://hl7.org/fhir/search-comparator";
363      case EB:
364        return "http://hl7.org/fhir/search-comparator";
365      case AP:
366        return "http://hl7.org/fhir/search-comparator";
367      case NULL:
368        return null;
369      default:
370        return "?";
371      }
372    }
373
374    public String getDefinition() {
375      switch (this) {
376      case EQ:
377        return "the value for the parameter in the resource is equal to the provided value.";
378      case NE:
379        return "the value for the parameter in the resource is not equal to the provided value.";
380      case GT:
381        return "the value for the parameter in the resource is greater than the provided value.";
382      case LT:
383        return "the value for the parameter in the resource is less than the provided value.";
384      case GE:
385        return "the value for the parameter in the resource is greater or equal to the provided value.";
386      case LE:
387        return "the value for the parameter in the resource is less or equal to the provided value.";
388      case SA:
389        return "the value for the parameter in the resource starts after the provided value.";
390      case EB:
391        return "the value for the parameter in the resource ends before the provided value.";
392      case AP:
393        return "the value for the parameter in the resource is approximately the same to the provided value.";
394      case NULL:
395        return null;
396      default:
397        return "?";
398      }
399    }
400
401    public String getDisplay() {
402      switch (this) {
403      case EQ:
404        return "Equals";
405      case NE:
406        return "Not Equals";
407      case GT:
408        return "Greater Than";
409      case LT:
410        return "Less Than";
411      case GE:
412        return "Greater or Equals";
413      case LE:
414        return "Less of Equal";
415      case SA:
416        return "Starts After";
417      case EB:
418        return "Ends Before";
419      case AP:
420        return "Approximately";
421      case NULL:
422        return null;
423      default:
424        return "?";
425      }
426    }
427  }
428
429  public static class SearchComparatorEnumFactory implements EnumFactory<SearchComparator> {
430    public SearchComparator fromCode(String codeString) throws IllegalArgumentException {
431      if (codeString == null || "".equals(codeString))
432        if (codeString == null || "".equals(codeString))
433          return null;
434      if ("eq".equals(codeString))
435        return SearchComparator.EQ;
436      if ("ne".equals(codeString))
437        return SearchComparator.NE;
438      if ("gt".equals(codeString))
439        return SearchComparator.GT;
440      if ("lt".equals(codeString))
441        return SearchComparator.LT;
442      if ("ge".equals(codeString))
443        return SearchComparator.GE;
444      if ("le".equals(codeString))
445        return SearchComparator.LE;
446      if ("sa".equals(codeString))
447        return SearchComparator.SA;
448      if ("eb".equals(codeString))
449        return SearchComparator.EB;
450      if ("ap".equals(codeString))
451        return SearchComparator.AP;
452      throw new IllegalArgumentException("Unknown SearchComparator code '" + codeString + "'");
453    }
454
455    public Enumeration<SearchComparator> fromType(PrimitiveType<?> code) throws FHIRException {
456      if (code == null)
457        return null;
458      if (code.isEmpty())
459        return new Enumeration<SearchComparator>(this, SearchComparator.NULL, code);
460      String codeString = code.asStringValue();
461      if (codeString == null || "".equals(codeString))
462        return new Enumeration<SearchComparator>(this, SearchComparator.NULL, code);
463      if ("eq".equals(codeString))
464        return new Enumeration<SearchComparator>(this, SearchComparator.EQ, code);
465      if ("ne".equals(codeString))
466        return new Enumeration<SearchComparator>(this, SearchComparator.NE, code);
467      if ("gt".equals(codeString))
468        return new Enumeration<SearchComparator>(this, SearchComparator.GT, code);
469      if ("lt".equals(codeString))
470        return new Enumeration<SearchComparator>(this, SearchComparator.LT, code);
471      if ("ge".equals(codeString))
472        return new Enumeration<SearchComparator>(this, SearchComparator.GE, code);
473      if ("le".equals(codeString))
474        return new Enumeration<SearchComparator>(this, SearchComparator.LE, code);
475      if ("sa".equals(codeString))
476        return new Enumeration<SearchComparator>(this, SearchComparator.SA, code);
477      if ("eb".equals(codeString))
478        return new Enumeration<SearchComparator>(this, SearchComparator.EB, code);
479      if ("ap".equals(codeString))
480        return new Enumeration<SearchComparator>(this, SearchComparator.AP, code);
481      throw new FHIRException("Unknown SearchComparator code '" + codeString + "'");
482    }
483
484    public String toCode(SearchComparator code) {
485      if (code == SearchComparator.EQ)
486        return "eq";
487      if (code == SearchComparator.NE)
488        return "ne";
489      if (code == SearchComparator.GT)
490        return "gt";
491      if (code == SearchComparator.LT)
492        return "lt";
493      if (code == SearchComparator.GE)
494        return "ge";
495      if (code == SearchComparator.LE)
496        return "le";
497      if (code == SearchComparator.SA)
498        return "sa";
499      if (code == SearchComparator.EB)
500        return "eb";
501      if (code == SearchComparator.AP)
502        return "ap";
503      return "?";
504    }
505
506    public String toSystem(SearchComparator code) {
507      return code.getSystem();
508    }
509  }
510
511  public enum SearchModifierCode {
512    /**
513     * The search parameter returns resources that have a value or not.
514     */
515    MISSING,
516    /**
517     * The search parameter returns resources that have a value that exactly matches
518     * the supplied parameter (the whole string, including casing and accents).
519     */
520    EXACT,
521    /**
522     * The search parameter returns resources that include the supplied parameter
523     * value anywhere within the field being searched.
524     */
525    CONTAINS,
526    /**
527     * The search parameter returns resources that do not contain a match.
528     */
529    NOT,
530    /**
531     * The search parameter is processed as a string that searches text associated
532     * with the code/value - either CodeableConcept.text, Coding.display, or
533     * Identifier.type.text.
534     */
535    TEXT,
536    /**
537     * The search parameter is a URI (relative or absolute) that identifies a value
538     * set, and the search parameter tests whether the coding is in the specified
539     * value set.
540     */
541    IN,
542    /**
543     * The search parameter is a URI (relative or absolute) that identifies a value
544     * set, and the search parameter tests whether the coding is not in the
545     * specified value set.
546     */
547    NOTIN,
548    /**
549     * The search parameter tests whether the value in a resource is subsumed by the
550     * specified value (is-a, or hierarchical relationships).
551     */
552    BELOW,
553    /**
554     * The search parameter tests whether the value in a resource subsumes the
555     * specified value (is-a, or hierarchical relationships).
556     */
557    ABOVE,
558    /**
559     * The search parameter only applies to the Resource Type specified as a
560     * modifier (e.g. the modifier is not actually :type, but :Patient etc.).
561     */
562    TYPE,
563    /**
564     * The search parameter applies to the identifier on the resource, not the
565     * reference.
566     */
567    IDENTIFIER,
568    /**
569     * The search parameter has the format system|code|value, where the system and
570     * code refer to an Identifier.type.coding.system and .code, and match if any of
571     * the type codes match. All 3 parts must be present.
572     */
573    OFTYPE,
574    /**
575     * added to help the parsers with the generic types
576     */
577    NULL;
578
579    public static SearchModifierCode fromCode(String codeString) throws FHIRException {
580      if (codeString == null || "".equals(codeString))
581        return null;
582      if ("missing".equals(codeString))
583        return MISSING;
584      if ("exact".equals(codeString))
585        return EXACT;
586      if ("contains".equals(codeString))
587        return CONTAINS;
588      if ("not".equals(codeString))
589        return NOT;
590      if ("text".equals(codeString))
591        return TEXT;
592      if ("in".equals(codeString))
593        return IN;
594      if ("not-in".equals(codeString))
595        return NOTIN;
596      if ("below".equals(codeString))
597        return BELOW;
598      if ("above".equals(codeString))
599        return ABOVE;
600      if ("type".equals(codeString))
601        return TYPE;
602      if ("identifier".equals(codeString))
603        return IDENTIFIER;
604      if ("ofType".equals(codeString))
605        return OFTYPE;
606      if (Configuration.isAcceptInvalidEnums())
607        return null;
608      else
609        throw new FHIRException("Unknown SearchModifierCode code '" + codeString + "'");
610    }
611
612    public String toCode() {
613      switch (this) {
614      case MISSING:
615        return "missing";
616      case EXACT:
617        return "exact";
618      case CONTAINS:
619        return "contains";
620      case NOT:
621        return "not";
622      case TEXT:
623        return "text";
624      case IN:
625        return "in";
626      case NOTIN:
627        return "not-in";
628      case BELOW:
629        return "below";
630      case ABOVE:
631        return "above";
632      case TYPE:
633        return "type";
634      case IDENTIFIER:
635        return "identifier";
636      case OFTYPE:
637        return "ofType";
638      case NULL:
639        return null;
640      default:
641        return "?";
642      }
643    }
644
645    public String getSystem() {
646      switch (this) {
647      case MISSING:
648        return "http://hl7.org/fhir/search-modifier-code";
649      case EXACT:
650        return "http://hl7.org/fhir/search-modifier-code";
651      case CONTAINS:
652        return "http://hl7.org/fhir/search-modifier-code";
653      case NOT:
654        return "http://hl7.org/fhir/search-modifier-code";
655      case TEXT:
656        return "http://hl7.org/fhir/search-modifier-code";
657      case IN:
658        return "http://hl7.org/fhir/search-modifier-code";
659      case NOTIN:
660        return "http://hl7.org/fhir/search-modifier-code";
661      case BELOW:
662        return "http://hl7.org/fhir/search-modifier-code";
663      case ABOVE:
664        return "http://hl7.org/fhir/search-modifier-code";
665      case TYPE:
666        return "http://hl7.org/fhir/search-modifier-code";
667      case IDENTIFIER:
668        return "http://hl7.org/fhir/search-modifier-code";
669      case OFTYPE:
670        return "http://hl7.org/fhir/search-modifier-code";
671      case NULL:
672        return null;
673      default:
674        return "?";
675      }
676    }
677
678    public String getDefinition() {
679      switch (this) {
680      case MISSING:
681        return "The search parameter returns resources that have a value or not.";
682      case EXACT:
683        return "The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents).";
684      case CONTAINS:
685        return "The search parameter returns resources that include the supplied parameter value anywhere within the field being searched.";
686      case NOT:
687        return "The search parameter returns resources that do not contain a match.";
688      case TEXT:
689        return "The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text.";
690      case IN:
691        return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set.";
692      case NOTIN:
693        return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set.";
694      case BELOW:
695        return "The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships).";
696      case ABOVE:
697        return "The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships).";
698      case TYPE:
699        return "The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.).";
700      case IDENTIFIER:
701        return "The search parameter applies to the identifier on the resource, not the reference.";
702      case OFTYPE:
703        return "The search parameter has the format system|code|value, where the system and code refer to an Identifier.type.coding.system and .code, and match if any of the type codes match. All 3 parts must be present.";
704      case NULL:
705        return null;
706      default:
707        return "?";
708      }
709    }
710
711    public String getDisplay() {
712      switch (this) {
713      case MISSING:
714        return "Missing";
715      case EXACT:
716        return "Exact";
717      case CONTAINS:
718        return "Contains";
719      case NOT:
720        return "Not";
721      case TEXT:
722        return "Text";
723      case IN:
724        return "In";
725      case NOTIN:
726        return "Not In";
727      case BELOW:
728        return "Below";
729      case ABOVE:
730        return "Above";
731      case TYPE:
732        return "Type";
733      case IDENTIFIER:
734        return "Identifier";
735      case OFTYPE:
736        return "Of Type";
737      case NULL:
738        return null;
739      default:
740        return "?";
741      }
742    }
743  }
744
745  public static class SearchModifierCodeEnumFactory implements EnumFactory<SearchModifierCode> {
746    public SearchModifierCode fromCode(String codeString) throws IllegalArgumentException {
747      if (codeString == null || "".equals(codeString))
748        if (codeString == null || "".equals(codeString))
749          return null;
750      if ("missing".equals(codeString))
751        return SearchModifierCode.MISSING;
752      if ("exact".equals(codeString))
753        return SearchModifierCode.EXACT;
754      if ("contains".equals(codeString))
755        return SearchModifierCode.CONTAINS;
756      if ("not".equals(codeString))
757        return SearchModifierCode.NOT;
758      if ("text".equals(codeString))
759        return SearchModifierCode.TEXT;
760      if ("in".equals(codeString))
761        return SearchModifierCode.IN;
762      if ("not-in".equals(codeString))
763        return SearchModifierCode.NOTIN;
764      if ("below".equals(codeString))
765        return SearchModifierCode.BELOW;
766      if ("above".equals(codeString))
767        return SearchModifierCode.ABOVE;
768      if ("type".equals(codeString))
769        return SearchModifierCode.TYPE;
770      if ("identifier".equals(codeString))
771        return SearchModifierCode.IDENTIFIER;
772      if ("ofType".equals(codeString))
773        return SearchModifierCode.OFTYPE;
774      throw new IllegalArgumentException("Unknown SearchModifierCode code '" + codeString + "'");
775    }
776
777    public Enumeration<SearchModifierCode> fromType(PrimitiveType<?> code) throws FHIRException {
778      if (code == null)
779        return null;
780      if (code.isEmpty())
781        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.NULL, code);
782      String codeString = code.asStringValue();
783      if (codeString == null || "".equals(codeString))
784        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.NULL, code);
785      if ("missing".equals(codeString))
786        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.MISSING, code);
787      if ("exact".equals(codeString))
788        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.EXACT, code);
789      if ("contains".equals(codeString))
790        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.CONTAINS, code);
791      if ("not".equals(codeString))
792        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.NOT, code);
793      if ("text".equals(codeString))
794        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.TEXT, code);
795      if ("in".equals(codeString))
796        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.IN, code);
797      if ("not-in".equals(codeString))
798        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.NOTIN, code);
799      if ("below".equals(codeString))
800        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.BELOW, code);
801      if ("above".equals(codeString))
802        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.ABOVE, code);
803      if ("type".equals(codeString))
804        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.TYPE, code);
805      if ("identifier".equals(codeString))
806        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.IDENTIFIER, code);
807      if ("ofType".equals(codeString))
808        return new Enumeration<SearchModifierCode>(this, SearchModifierCode.OFTYPE, code);
809      throw new FHIRException("Unknown SearchModifierCode code '" + codeString + "'");
810    }
811
812    public String toCode(SearchModifierCode code) {
813      if (code == SearchModifierCode.MISSING)
814        return "missing";
815      if (code == SearchModifierCode.EXACT)
816        return "exact";
817      if (code == SearchModifierCode.CONTAINS)
818        return "contains";
819      if (code == SearchModifierCode.NOT)
820        return "not";
821      if (code == SearchModifierCode.TEXT)
822        return "text";
823      if (code == SearchModifierCode.IN)
824        return "in";
825      if (code == SearchModifierCode.NOTIN)
826        return "not-in";
827      if (code == SearchModifierCode.BELOW)
828        return "below";
829      if (code == SearchModifierCode.ABOVE)
830        return "above";
831      if (code == SearchModifierCode.TYPE)
832        return "type";
833      if (code == SearchModifierCode.IDENTIFIER)
834        return "identifier";
835      if (code == SearchModifierCode.OFTYPE)
836        return "ofType";
837      return "?";
838    }
839
840    public String toSystem(SearchModifierCode code) {
841      return code.getSystem();
842    }
843  }
844
845  @Block()
846  public static class SearchParameterComponentComponent extends BackboneElement implements IBaseBackboneElement {
847    /**
848     * The definition of the search parameter that describes this part.
849     */
850    @Child(name = "definition", type = {
851        CanonicalType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
852    @Description(shortDefinition = "Defines how the part works", formalDefinition = "The definition of the search parameter that describes this part.")
853    protected CanonicalType definition;
854
855    /**
856     * A sub-expression that defines how to extract values for this component from
857     * the output of the main SearchParameter.expression.
858     */
859    @Child(name = "expression", type = {
860        StringType.class }, order = 2, min = 1, max = 1, modifier = false, summary = false)
861    @Description(shortDefinition = "Subexpression relative to main expression", formalDefinition = "A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.")
862    protected StringType expression;
863
864    private static final long serialVersionUID = -1469435618L;
865
866    /**
867     * Constructor
868     */
869    public SearchParameterComponentComponent() {
870      super();
871    }
872
873    /**
874     * Constructor
875     */
876    public SearchParameterComponentComponent(CanonicalType definition, StringType expression) {
877      super();
878      this.definition = definition;
879      this.expression = expression;
880    }
881
882    /**
883     * @return {@link #definition} (The definition of the search parameter that
884     *         describes this part.). This is the underlying object with id, value
885     *         and extensions. The accessor "getDefinition" gives direct access to
886     *         the value
887     */
888    public CanonicalType getDefinitionElement() {
889      if (this.definition == null)
890        if (Configuration.errorOnAutoCreate())
891          throw new Error("Attempt to auto-create SearchParameterComponentComponent.definition");
892        else if (Configuration.doAutoCreate())
893          this.definition = new CanonicalType(); // bb
894      return this.definition;
895    }
896
897    public boolean hasDefinitionElement() {
898      return this.definition != null && !this.definition.isEmpty();
899    }
900
901    public boolean hasDefinition() {
902      return this.definition != null && !this.definition.isEmpty();
903    }
904
905    /**
906     * @param value {@link #definition} (The definition of the search parameter that
907     *              describes this part.). This is the underlying object with id,
908     *              value and extensions. The accessor "getDefinition" gives direct
909     *              access to the value
910     */
911    public SearchParameterComponentComponent setDefinitionElement(CanonicalType value) {
912      this.definition = value;
913      return this;
914    }
915
916    /**
917     * @return The definition of the search parameter that describes this part.
918     */
919    public String getDefinition() {
920      return this.definition == null ? null : this.definition.getValue();
921    }
922
923    /**
924     * @param value The definition of the search parameter that describes this part.
925     */
926    public SearchParameterComponentComponent setDefinition(String value) {
927      if (this.definition == null)
928        this.definition = new CanonicalType();
929      this.definition.setValue(value);
930      return this;
931    }
932
933    /**
934     * @return {@link #expression} (A sub-expression that defines how to extract
935     *         values for this component from the output of the main
936     *         SearchParameter.expression.). This is the underlying object with id,
937     *         value and extensions. The accessor "getExpression" gives direct
938     *         access to the value
939     */
940    public StringType getExpressionElement() {
941      if (this.expression == null)
942        if (Configuration.errorOnAutoCreate())
943          throw new Error("Attempt to auto-create SearchParameterComponentComponent.expression");
944        else if (Configuration.doAutoCreate())
945          this.expression = new StringType(); // bb
946      return this.expression;
947    }
948
949    public boolean hasExpressionElement() {
950      return this.expression != null && !this.expression.isEmpty();
951    }
952
953    public boolean hasExpression() {
954      return this.expression != null && !this.expression.isEmpty();
955    }
956
957    /**
958     * @param value {@link #expression} (A sub-expression that defines how to
959     *              extract values for this component from the output of the main
960     *              SearchParameter.expression.). This is the underlying object with
961     *              id, value and extensions. The accessor "getExpression" gives
962     *              direct access to the value
963     */
964    public SearchParameterComponentComponent setExpressionElement(StringType value) {
965      this.expression = value;
966      return this;
967    }
968
969    /**
970     * @return A sub-expression that defines how to extract values for this
971     *         component from the output of the main SearchParameter.expression.
972     */
973    public String getExpression() {
974      return this.expression == null ? null : this.expression.getValue();
975    }
976
977    /**
978     * @param value A sub-expression that defines how to extract values for this
979     *              component from the output of the main
980     *              SearchParameter.expression.
981     */
982    public SearchParameterComponentComponent setExpression(String value) {
983      if (this.expression == null)
984        this.expression = new StringType();
985      this.expression.setValue(value);
986      return this;
987    }
988
989    protected void listChildren(List<Property> children) {
990      super.listChildren(children);
991      children.add(new Property("definition", "canonical(SearchParameter)",
992          "The definition of the search parameter that describes this part.", 0, 1, definition));
993      children.add(new Property("expression", "string",
994          "A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.",
995          0, 1, expression));
996    }
997
998    @Override
999    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1000      switch (_hash) {
1001      case -1014418093:
1002        /* definition */ return new Property("definition", "canonical(SearchParameter)",
1003            "The definition of the search parameter that describes this part.", 0, 1, definition);
1004      case -1795452264:
1005        /* expression */ return new Property("expression", "string",
1006            "A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.",
1007            0, 1, expression);
1008      default:
1009        return super.getNamedProperty(_hash, _name, _checkValid);
1010      }
1011
1012    }
1013
1014    @Override
1015    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1016      switch (hash) {
1017      case -1014418093:
1018        /* definition */ return this.definition == null ? new Base[0] : new Base[] { this.definition }; // CanonicalType
1019      case -1795452264:
1020        /* expression */ return this.expression == null ? new Base[0] : new Base[] { this.expression }; // StringType
1021      default:
1022        return super.getProperty(hash, name, checkValid);
1023      }
1024
1025    }
1026
1027    @Override
1028    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1029      switch (hash) {
1030      case -1014418093: // definition
1031        this.definition = castToCanonical(value); // CanonicalType
1032        return value;
1033      case -1795452264: // expression
1034        this.expression = castToString(value); // StringType
1035        return value;
1036      default:
1037        return super.setProperty(hash, name, value);
1038      }
1039
1040    }
1041
1042    @Override
1043    public Base setProperty(String name, Base value) throws FHIRException {
1044      if (name.equals("definition")) {
1045        this.definition = castToCanonical(value); // CanonicalType
1046      } else if (name.equals("expression")) {
1047        this.expression = castToString(value); // StringType
1048      } else
1049        return super.setProperty(name, value);
1050      return value;
1051    }
1052
1053  @Override
1054  public void removeChild(String name, Base value) throws FHIRException {
1055      if (name.equals("definition")) {
1056        this.definition = null;
1057      } else if (name.equals("expression")) {
1058        this.expression = null;
1059      } else
1060        super.removeChild(name, value);
1061      
1062    }
1063
1064    @Override
1065    public Base makeProperty(int hash, String name) throws FHIRException {
1066      switch (hash) {
1067      case -1014418093:
1068        return getDefinitionElement();
1069      case -1795452264:
1070        return getExpressionElement();
1071      default:
1072        return super.makeProperty(hash, name);
1073      }
1074
1075    }
1076
1077    @Override
1078    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1079      switch (hash) {
1080      case -1014418093:
1081        /* definition */ return new String[] { "canonical" };
1082      case -1795452264:
1083        /* expression */ return new String[] { "string" };
1084      default:
1085        return super.getTypesForProperty(hash, name);
1086      }
1087
1088    }
1089
1090    @Override
1091    public Base addChild(String name) throws FHIRException {
1092      if (name.equals("definition")) {
1093        throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.definition");
1094      } else if (name.equals("expression")) {
1095        throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.expression");
1096      } else
1097        return super.addChild(name);
1098    }
1099
1100    public SearchParameterComponentComponent copy() {
1101      SearchParameterComponentComponent dst = new SearchParameterComponentComponent();
1102      copyValues(dst);
1103      return dst;
1104    }
1105
1106    public void copyValues(SearchParameterComponentComponent dst) {
1107      super.copyValues(dst);
1108      dst.definition = definition == null ? null : definition.copy();
1109      dst.expression = expression == null ? null : expression.copy();
1110    }
1111
1112    @Override
1113    public boolean equalsDeep(Base other_) {
1114      if (!super.equalsDeep(other_))
1115        return false;
1116      if (!(other_ instanceof SearchParameterComponentComponent))
1117        return false;
1118      SearchParameterComponentComponent o = (SearchParameterComponentComponent) other_;
1119      return compareDeep(definition, o.definition, true) && compareDeep(expression, o.expression, true);
1120    }
1121
1122    @Override
1123    public boolean equalsShallow(Base other_) {
1124      if (!super.equalsShallow(other_))
1125        return false;
1126      if (!(other_ instanceof SearchParameterComponentComponent))
1127        return false;
1128      SearchParameterComponentComponent o = (SearchParameterComponentComponent) other_;
1129      return compareValues(expression, o.expression, true);
1130    }
1131
1132    public boolean isEmpty() {
1133      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(definition, expression);
1134    }
1135
1136    public String fhirType() {
1137      return "SearchParameter.component";
1138
1139    }
1140
1141  }
1142
1143  /**
1144   * Where this search parameter is originally defined. If a derivedFrom is
1145   * provided, then the details in the search parameter must be consistent with
1146   * the definition from which it is defined. i.e. the parameter should have the
1147   * same meaning, and (usually) the functionality should be a proper subset of
1148   * the underlying search parameter.
1149   */
1150  @Child(name = "derivedFrom", type = {
1151      CanonicalType.class }, order = 0, min = 0, max = 1, modifier = false, summary = false)
1152  @Description(shortDefinition = "Original definition for the search parameter", formalDefinition = "Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. i.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.")
1153  protected CanonicalType derivedFrom;
1154
1155  /**
1156   * Explanation of why this search parameter is needed and why it has been
1157   * designed as it has.
1158   */
1159  @Child(name = "purpose", type = {
1160      MarkdownType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
1161  @Description(shortDefinition = "Why this search parameter is defined", formalDefinition = "Explanation of why this search parameter is needed and why it has been designed as it has.")
1162  protected MarkdownType purpose;
1163
1164  /**
1165   * The code used in the URL or the parameter name in a parameters resource for
1166   * this search parameter.
1167   */
1168  @Child(name = "code", type = { CodeType.class }, order = 2, min = 1, max = 1, modifier = false, summary = true)
1169  @Description(shortDefinition = "Code used in URL", formalDefinition = "The code used in the URL or the parameter name in a parameters resource for this search parameter.")
1170  protected CodeType code;
1171
1172  /**
1173   * The base resource type(s) that this search parameter can be used against.
1174   */
1175  @Child(name = "base", type = {
1176      CodeType.class }, order = 3, min = 1, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1177  @Description(shortDefinition = "The resource type(s) this search parameter applies to", formalDefinition = "The base resource type(s) that this search parameter can be used against.")
1178  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/resource-types")
1179  protected List<CodeType> base;
1180
1181  /**
1182   * The type of value that a search parameter may contain, and how the content is
1183   * interpreted.
1184   */
1185  @Child(name = "type", type = { CodeType.class }, order = 4, min = 1, max = 1, modifier = false, summary = true)
1186  @Description(shortDefinition = "number | date | string | token | reference | composite | quantity | uri | special", formalDefinition = "The type of value that a search parameter may contain, and how the content is interpreted.")
1187  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/search-param-type")
1188  protected Enumeration<SearchParamType> type;
1189
1190  /**
1191   * A FHIRPath expression that returns a set of elements for the search
1192   * parameter.
1193   */
1194  @Child(name = "expression", type = {
1195      StringType.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
1196  @Description(shortDefinition = "FHIRPath expression that extracts the values", formalDefinition = "A FHIRPath expression that returns a set of elements for the search parameter.")
1197  protected StringType expression;
1198
1199  /**
1200   * An XPath expression that returns a set of elements for the search parameter.
1201   */
1202  @Child(name = "xpath", type = { StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
1203  @Description(shortDefinition = "XPath that extracts the values", formalDefinition = "An XPath expression that returns a set of elements for the search parameter.")
1204  protected StringType xpath;
1205
1206  /**
1207   * How the search parameter relates to the set of elements returned by
1208   * evaluating the xpath query.
1209   */
1210  @Child(name = "xpathUsage", type = { CodeType.class }, order = 7, min = 0, max = 1, modifier = false, summary = false)
1211  @Description(shortDefinition = "normal | phonetic | nearby | distance | other", formalDefinition = "How the search parameter relates to the set of elements returned by evaluating the xpath query.")
1212  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/search-xpath-usage")
1213  protected Enumeration<XPathUsageType> xpathUsage;
1214
1215  /**
1216   * Types of resource (if a resource is referenced).
1217   */
1218  @Child(name = "target", type = {
1219      CodeType.class }, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1220  @Description(shortDefinition = "Types of resource (if a resource reference)", formalDefinition = "Types of resource (if a resource is referenced).")
1221  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/resource-types")
1222  protected List<CodeType> target;
1223
1224  /**
1225   * Whether multiple values are allowed for each time the parameter exists.
1226   * Values are separated by commas, and the parameter matches if any of the
1227   * values match.
1228   */
1229  @Child(name = "multipleOr", type = {
1230      BooleanType.class }, order = 9, min = 0, max = 1, modifier = false, summary = false)
1231  @Description(shortDefinition = "Allow multiple values per parameter (or)", formalDefinition = "Whether multiple values are allowed for each time the parameter exists. Values are separated by commas, and the parameter matches if any of the values match.")
1232  protected BooleanType multipleOr;
1233
1234  /**
1235   * Whether multiple parameters are allowed - e.g. more than one parameter with
1236   * the same name. The search matches if all the parameters match.
1237   */
1238  @Child(name = "multipleAnd", type = {
1239      BooleanType.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
1240  @Description(shortDefinition = "Allow multiple parameters (and)", formalDefinition = "Whether multiple parameters are allowed - e.g. more than one parameter with the same name. The search matches if all the parameters match.")
1241  protected BooleanType multipleAnd;
1242
1243  /**
1244   * Comparators supported for the search parameter.
1245   */
1246  @Child(name = "comparator", type = {
1247      CodeType.class }, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1248  @Description(shortDefinition = "eq | ne | gt | lt | ge | le | sa | eb | ap", formalDefinition = "Comparators supported for the search parameter.")
1249  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/search-comparator")
1250  protected List<Enumeration<SearchComparator>> comparator;
1251
1252  /**
1253   * A modifier supported for the search parameter.
1254   */
1255  @Child(name = "modifier", type = {
1256      CodeType.class }, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1257  @Description(shortDefinition = "missing | exact | contains | not | text | in | not-in | below | above | type | identifier | ofType", formalDefinition = "A modifier supported for the search parameter.")
1258  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/search-modifier-code")
1259  protected List<Enumeration<SearchModifierCode>> modifier;
1260
1261  /**
1262   * Contains the names of any search parameters which may be chained to the
1263   * containing search parameter. Chained parameters may be added to search
1264   * parameters of type reference and specify that resources will only be returned
1265   * if they contain a reference to a resource which matches the chained parameter
1266   * value. Values for this field should be drawn from SearchParameter.code for a
1267   * parameter on the target resource type.
1268   */
1269  @Child(name = "chain", type = {
1270      StringType.class }, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1271  @Description(shortDefinition = "Chained names supported", formalDefinition = "Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.")
1272  protected List<StringType> chain;
1273
1274  /**
1275   * Used to define the parts of a composite search parameter.
1276   */
1277  @Child(name = "component", type = {}, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1278  @Description(shortDefinition = "For Composite resources to define the parts", formalDefinition = "Used to define the parts of a composite search parameter.")
1279  protected List<SearchParameterComponentComponent> component;
1280
1281  private static final long serialVersionUID = -533803519L;
1282
1283  /**
1284   * Constructor
1285   */
1286  public SearchParameter() {
1287    super();
1288  }
1289
1290  /**
1291   * Constructor
1292   */
1293  public SearchParameter(UriType url, StringType name, Enumeration<PublicationStatus> status, MarkdownType description,
1294      CodeType code, Enumeration<SearchParamType> type) {
1295    super();
1296    this.url = url;
1297    this.name = name;
1298    this.status = status;
1299    this.description = description;
1300    this.code = code;
1301    this.type = type;
1302  }
1303
1304  /**
1305   * @return {@link #url} (An absolute URI that is used to identify this search
1306   *         parameter when it is referenced in a specification, model, design or
1307   *         an instance; also called its canonical identifier. This SHOULD be
1308   *         globally unique and SHOULD be a literal address at which at which an
1309   *         authoritative instance of this search parameter is (or will be)
1310   *         published. This URL can be the target of a canonical reference. It
1311   *         SHALL remain the same when the search parameter is stored on
1312   *         different servers.). This is the underlying object with id, value and
1313   *         extensions. The accessor "getUrl" gives direct access to the value
1314   */
1315  public UriType getUrlElement() {
1316    if (this.url == null)
1317      if (Configuration.errorOnAutoCreate())
1318        throw new Error("Attempt to auto-create SearchParameter.url");
1319      else if (Configuration.doAutoCreate())
1320        this.url = new UriType(); // bb
1321    return this.url;
1322  }
1323
1324  public boolean hasUrlElement() {
1325    return this.url != null && !this.url.isEmpty();
1326  }
1327
1328  public boolean hasUrl() {
1329    return this.url != null && !this.url.isEmpty();
1330  }
1331
1332  /**
1333   * @param value {@link #url} (An absolute URI that is used to identify this
1334   *              search parameter when it is referenced in a specification,
1335   *              model, design or an instance; also called its canonical
1336   *              identifier. This SHOULD be globally unique and SHOULD be a
1337   *              literal address at which at which an authoritative instance of
1338   *              this search parameter is (or will be) published. This URL can be
1339   *              the target of a canonical reference. It SHALL remain the same
1340   *              when the search parameter is stored on different servers.). This
1341   *              is the underlying object with id, value and extensions. The
1342   *              accessor "getUrl" gives direct access to the value
1343   */
1344  public SearchParameter setUrlElement(UriType value) {
1345    this.url = value;
1346    return this;
1347  }
1348
1349  /**
1350   * @return An absolute URI that is used to identify this search parameter when
1351   *         it is referenced in a specification, model, design or an instance;
1352   *         also called its canonical identifier. This SHOULD be globally unique
1353   *         and SHOULD be a literal address at which at which an authoritative
1354   *         instance of this search parameter is (or will be) published. This URL
1355   *         can be the target of a canonical reference. It SHALL remain the same
1356   *         when the search parameter is stored on different servers.
1357   */
1358  public String getUrl() {
1359    return this.url == null ? null : this.url.getValue();
1360  }
1361
1362  /**
1363   * @param value An absolute URI that is used to identify this search parameter
1364   *              when it is referenced in a specification, model, design or an
1365   *              instance; also called its canonical identifier. This SHOULD be
1366   *              globally unique and SHOULD be a literal address at which at
1367   *              which an authoritative instance of this search parameter is (or
1368   *              will be) published. This URL can be the target of a canonical
1369   *              reference. It SHALL remain the same when the search parameter is
1370   *              stored on different servers.
1371   */
1372  public SearchParameter setUrl(String value) {
1373    if (this.url == null)
1374      this.url = new UriType();
1375    this.url.setValue(value);
1376    return this;
1377  }
1378
1379  /**
1380   * @return {@link #version} (The identifier that is used to identify this
1381   *         version of the search parameter when it is referenced in a
1382   *         specification, model, design or instance. This is an arbitrary value
1383   *         managed by the search parameter author and is not expected to be
1384   *         globally unique. For example, it might be a timestamp (e.g. yyyymmdd)
1385   *         if a managed version is not available. There is also no expectation
1386   *         that versions can be placed in a lexicographical sequence.). This is
1387   *         the underlying object with id, value and extensions. The accessor
1388   *         "getVersion" gives direct access to the value
1389   */
1390  public StringType getVersionElement() {
1391    if (this.version == null)
1392      if (Configuration.errorOnAutoCreate())
1393        throw new Error("Attempt to auto-create SearchParameter.version");
1394      else if (Configuration.doAutoCreate())
1395        this.version = new StringType(); // bb
1396    return this.version;
1397  }
1398
1399  public boolean hasVersionElement() {
1400    return this.version != null && !this.version.isEmpty();
1401  }
1402
1403  public boolean hasVersion() {
1404    return this.version != null && !this.version.isEmpty();
1405  }
1406
1407  /**
1408   * @param value {@link #version} (The identifier that is used to identify this
1409   *              version of the search parameter when it is referenced in a
1410   *              specification, model, design or instance. This is an arbitrary
1411   *              value managed by the search parameter author and is not expected
1412   *              to be globally unique. For example, it might be a timestamp
1413   *              (e.g. yyyymmdd) if a managed version is not available. There is
1414   *              also no expectation that versions can be placed in a
1415   *              lexicographical sequence.). This is the underlying object with
1416   *              id, value and extensions. The accessor "getVersion" gives direct
1417   *              access to the value
1418   */
1419  public SearchParameter setVersionElement(StringType value) {
1420    this.version = value;
1421    return this;
1422  }
1423
1424  /**
1425   * @return The identifier that is used to identify this version of the search
1426   *         parameter when it is referenced in a specification, model, design or
1427   *         instance. This is an arbitrary value managed by the search parameter
1428   *         author and is not expected to be globally unique. For example, it
1429   *         might be a timestamp (e.g. yyyymmdd) if a managed version is not
1430   *         available. There is also no expectation that versions can be placed
1431   *         in a lexicographical sequence.
1432   */
1433  public String getVersion() {
1434    return this.version == null ? null : this.version.getValue();
1435  }
1436
1437  /**
1438   * @param value The identifier that is used to identify this version of the
1439   *              search parameter when it is referenced in a specification,
1440   *              model, design or instance. This is an arbitrary value managed by
1441   *              the search parameter author and is not expected to be globally
1442   *              unique. For example, it might be a timestamp (e.g. yyyymmdd) if
1443   *              a managed version is not available. There is also no expectation
1444   *              that versions can be placed in a lexicographical sequence.
1445   */
1446  public SearchParameter setVersion(String value) {
1447    if (Utilities.noString(value))
1448      this.version = null;
1449    else {
1450      if (this.version == null)
1451        this.version = new StringType();
1452      this.version.setValue(value);
1453    }
1454    return this;
1455  }
1456
1457  /**
1458   * @return {@link #name} (A natural language name identifying the search
1459   *         parameter. This name should be usable as an identifier for the module
1460   *         by machine processing applications such as code generation.). This is
1461   *         the underlying object with id, value and extensions. The accessor
1462   *         "getName" gives direct access to the value
1463   */
1464  public StringType getNameElement() {
1465    if (this.name == null)
1466      if (Configuration.errorOnAutoCreate())
1467        throw new Error("Attempt to auto-create SearchParameter.name");
1468      else if (Configuration.doAutoCreate())
1469        this.name = new StringType(); // bb
1470    return this.name;
1471  }
1472
1473  public boolean hasNameElement() {
1474    return this.name != null && !this.name.isEmpty();
1475  }
1476
1477  public boolean hasName() {
1478    return this.name != null && !this.name.isEmpty();
1479  }
1480
1481  /**
1482   * @param value {@link #name} (A natural language name identifying the search
1483   *              parameter. This name should be usable as an identifier for the
1484   *              module by machine processing applications such as code
1485   *              generation.). This is the underlying object with id, value and
1486   *              extensions. The accessor "getName" gives direct access to the
1487   *              value
1488   */
1489  public SearchParameter setNameElement(StringType value) {
1490    this.name = value;
1491    return this;
1492  }
1493
1494  /**
1495   * @return A natural language name identifying the search parameter. This name
1496   *         should be usable as an identifier for the module by machine
1497   *         processing applications such as code generation.
1498   */
1499  public String getName() {
1500    return this.name == null ? null : this.name.getValue();
1501  }
1502
1503  /**
1504   * @param value A natural language name identifying the search parameter. This
1505   *              name should be usable as an identifier for the module by machine
1506   *              processing applications such as code generation.
1507   */
1508  public SearchParameter setName(String value) {
1509    if (this.name == null)
1510      this.name = new StringType();
1511    this.name.setValue(value);
1512    return this;
1513  }
1514
1515  /**
1516   * @return {@link #derivedFrom} (Where this search parameter is originally
1517   *         defined. If a derivedFrom is provided, then the details in the search
1518   *         parameter must be consistent with the definition from which it is
1519   *         defined. i.e. the parameter should have the same meaning, and
1520   *         (usually) the functionality should be a proper subset of the
1521   *         underlying search parameter.). This is the underlying object with id,
1522   *         value and extensions. The accessor "getDerivedFrom" gives direct
1523   *         access to the value
1524   */
1525  public CanonicalType getDerivedFromElement() {
1526    if (this.derivedFrom == null)
1527      if (Configuration.errorOnAutoCreate())
1528        throw new Error("Attempt to auto-create SearchParameter.derivedFrom");
1529      else if (Configuration.doAutoCreate())
1530        this.derivedFrom = new CanonicalType(); // bb
1531    return this.derivedFrom;
1532  }
1533
1534  public boolean hasDerivedFromElement() {
1535    return this.derivedFrom != null && !this.derivedFrom.isEmpty();
1536  }
1537
1538  public boolean hasDerivedFrom() {
1539    return this.derivedFrom != null && !this.derivedFrom.isEmpty();
1540  }
1541
1542  /**
1543   * @param value {@link #derivedFrom} (Where this search parameter is originally
1544   *              defined. If a derivedFrom is provided, then the details in the
1545   *              search parameter must be consistent with the definition from
1546   *              which it is defined. i.e. the parameter should have the same
1547   *              meaning, and (usually) the functionality should be a proper
1548   *              subset of the underlying search parameter.). This is the
1549   *              underlying object with id, value and extensions. The accessor
1550   *              "getDerivedFrom" gives direct access to the value
1551   */
1552  public SearchParameter setDerivedFromElement(CanonicalType value) {
1553    this.derivedFrom = value;
1554    return this;
1555  }
1556
1557  /**
1558   * @return Where this search parameter is originally defined. If a derivedFrom
1559   *         is provided, then the details in the search parameter must be
1560   *         consistent with the definition from which it is defined. i.e. the
1561   *         parameter should have the same meaning, and (usually) the
1562   *         functionality should be a proper subset of the underlying search
1563   *         parameter.
1564   */
1565  public String getDerivedFrom() {
1566    return this.derivedFrom == null ? null : this.derivedFrom.getValue();
1567  }
1568
1569  /**
1570   * @param value Where this search parameter is originally defined. If a
1571   *              derivedFrom is provided, then the details in the search
1572   *              parameter must be consistent with the definition from which it
1573   *              is defined. i.e. the parameter should have the same meaning, and
1574   *              (usually) the functionality should be a proper subset of the
1575   *              underlying search parameter.
1576   */
1577  public SearchParameter setDerivedFrom(String value) {
1578    if (Utilities.noString(value))
1579      this.derivedFrom = null;
1580    else {
1581      if (this.derivedFrom == null)
1582        this.derivedFrom = new CanonicalType();
1583      this.derivedFrom.setValue(value);
1584    }
1585    return this;
1586  }
1587
1588  /**
1589   * @return {@link #status} (The status of this search parameter. Enables
1590   *         tracking the life-cycle of the content.). This is the underlying
1591   *         object with id, value and extensions. The accessor "getStatus" gives
1592   *         direct access to the value
1593   */
1594  public Enumeration<PublicationStatus> getStatusElement() {
1595    if (this.status == null)
1596      if (Configuration.errorOnAutoCreate())
1597        throw new Error("Attempt to auto-create SearchParameter.status");
1598      else if (Configuration.doAutoCreate())
1599        this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
1600    return this.status;
1601  }
1602
1603  public boolean hasStatusElement() {
1604    return this.status != null && !this.status.isEmpty();
1605  }
1606
1607  public boolean hasStatus() {
1608    return this.status != null && !this.status.isEmpty();
1609  }
1610
1611  /**
1612   * @param value {@link #status} (The status of this search parameter. Enables
1613   *              tracking the life-cycle of the content.). This is the underlying
1614   *              object with id, value and extensions. The accessor "getStatus"
1615   *              gives direct access to the value
1616   */
1617  public SearchParameter setStatusElement(Enumeration<PublicationStatus> value) {
1618    this.status = value;
1619    return this;
1620  }
1621
1622  /**
1623   * @return The status of this search parameter. Enables tracking the life-cycle
1624   *         of the content.
1625   */
1626  public PublicationStatus getStatus() {
1627    return this.status == null ? null : this.status.getValue();
1628  }
1629
1630  /**
1631   * @param value The status of this search parameter. Enables tracking the
1632   *              life-cycle of the content.
1633   */
1634  public SearchParameter setStatus(PublicationStatus value) {
1635    if (this.status == null)
1636      this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
1637    this.status.setValue(value);
1638    return this;
1639  }
1640
1641  /**
1642   * @return {@link #experimental} (A Boolean value to indicate that this search
1643   *         parameter is authored for testing purposes (or
1644   *         education/evaluation/marketing) and is not intended to be used for
1645   *         genuine usage.). This is the underlying object with id, value and
1646   *         extensions. The accessor "getExperimental" gives direct access to the
1647   *         value
1648   */
1649  public BooleanType getExperimentalElement() {
1650    if (this.experimental == null)
1651      if (Configuration.errorOnAutoCreate())
1652        throw new Error("Attempt to auto-create SearchParameter.experimental");
1653      else if (Configuration.doAutoCreate())
1654        this.experimental = new BooleanType(); // bb
1655    return this.experimental;
1656  }
1657
1658  public boolean hasExperimentalElement() {
1659    return this.experimental != null && !this.experimental.isEmpty();
1660  }
1661
1662  public boolean hasExperimental() {
1663    return this.experimental != null && !this.experimental.isEmpty();
1664  }
1665
1666  /**
1667   * @param value {@link #experimental} (A Boolean value to indicate that this
1668   *              search parameter is authored for testing purposes (or
1669   *              education/evaluation/marketing) and is not intended to be used
1670   *              for genuine usage.). This is the underlying object with id,
1671   *              value and extensions. The accessor "getExperimental" gives
1672   *              direct access to the value
1673   */
1674  public SearchParameter setExperimentalElement(BooleanType value) {
1675    this.experimental = value;
1676    return this;
1677  }
1678
1679  /**
1680   * @return A Boolean value to indicate that this search parameter is authored
1681   *         for testing purposes (or education/evaluation/marketing) and is not
1682   *         intended to be used for genuine usage.
1683   */
1684  public boolean getExperimental() {
1685    return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
1686  }
1687
1688  /**
1689   * @param value A Boolean value to indicate that this search parameter is
1690   *              authored for testing purposes (or
1691   *              education/evaluation/marketing) and is not intended to be used
1692   *              for genuine usage.
1693   */
1694  public SearchParameter setExperimental(boolean value) {
1695    if (this.experimental == null)
1696      this.experimental = new BooleanType();
1697    this.experimental.setValue(value);
1698    return this;
1699  }
1700
1701  /**
1702   * @return {@link #date} (The date (and optionally time) when the search
1703   *         parameter was published. The date must change when the business
1704   *         version changes and it must change if the status code changes. In
1705   *         addition, it should change when the substantive content of the search
1706   *         parameter changes.). This is the underlying object with id, value and
1707   *         extensions. The accessor "getDate" gives direct access to the value
1708   */
1709  public DateTimeType getDateElement() {
1710    if (this.date == null)
1711      if (Configuration.errorOnAutoCreate())
1712        throw new Error("Attempt to auto-create SearchParameter.date");
1713      else if (Configuration.doAutoCreate())
1714        this.date = new DateTimeType(); // bb
1715    return this.date;
1716  }
1717
1718  public boolean hasDateElement() {
1719    return this.date != null && !this.date.isEmpty();
1720  }
1721
1722  public boolean hasDate() {
1723    return this.date != null && !this.date.isEmpty();
1724  }
1725
1726  /**
1727   * @param value {@link #date} (The date (and optionally time) when the search
1728   *              parameter was published. The date must change when the business
1729   *              version changes and it must change if the status code changes.
1730   *              In addition, it should change when the substantive content of
1731   *              the search parameter changes.). This is the underlying object
1732   *              with id, value and extensions. The accessor "getDate" gives
1733   *              direct access to the value
1734   */
1735  public SearchParameter setDateElement(DateTimeType value) {
1736    this.date = value;
1737    return this;
1738  }
1739
1740  /**
1741   * @return The date (and optionally time) when the search parameter was
1742   *         published. The date must change when the business version changes and
1743   *         it must change if the status code changes. In addition, it should
1744   *         change when the substantive content of the search parameter changes.
1745   */
1746  public Date getDate() {
1747    return this.date == null ? null : this.date.getValue();
1748  }
1749
1750  /**
1751   * @param value The date (and optionally time) when the search parameter was
1752   *              published. The date must change when the business version
1753   *              changes and it must change if the status code changes. In
1754   *              addition, it should change when the substantive content of the
1755   *              search parameter changes.
1756   */
1757  public SearchParameter setDate(Date value) {
1758    if (value == null)
1759      this.date = null;
1760    else {
1761      if (this.date == null)
1762        this.date = new DateTimeType();
1763      this.date.setValue(value);
1764    }
1765    return this;
1766  }
1767
1768  /**
1769   * @return {@link #publisher} (The name of the organization or individual that
1770   *         published the search parameter.). This is the underlying object with
1771   *         id, value and extensions. The accessor "getPublisher" gives direct
1772   *         access to the value
1773   */
1774  public StringType getPublisherElement() {
1775    if (this.publisher == null)
1776      if (Configuration.errorOnAutoCreate())
1777        throw new Error("Attempt to auto-create SearchParameter.publisher");
1778      else if (Configuration.doAutoCreate())
1779        this.publisher = new StringType(); // bb
1780    return this.publisher;
1781  }
1782
1783  public boolean hasPublisherElement() {
1784    return this.publisher != null && !this.publisher.isEmpty();
1785  }
1786
1787  public boolean hasPublisher() {
1788    return this.publisher != null && !this.publisher.isEmpty();
1789  }
1790
1791  /**
1792   * @param value {@link #publisher} (The name of the organization or individual
1793   *              that published the search parameter.). This is the underlying
1794   *              object with id, value and extensions. The accessor
1795   *              "getPublisher" gives direct access to the value
1796   */
1797  public SearchParameter setPublisherElement(StringType value) {
1798    this.publisher = value;
1799    return this;
1800  }
1801
1802  /**
1803   * @return The name of the organization or individual that published the search
1804   *         parameter.
1805   */
1806  public String getPublisher() {
1807    return this.publisher == null ? null : this.publisher.getValue();
1808  }
1809
1810  /**
1811   * @param value The name of the organization or individual that published the
1812   *              search parameter.
1813   */
1814  public SearchParameter setPublisher(String value) {
1815    if (Utilities.noString(value))
1816      this.publisher = null;
1817    else {
1818      if (this.publisher == null)
1819        this.publisher = new StringType();
1820      this.publisher.setValue(value);
1821    }
1822    return this;
1823  }
1824
1825  /**
1826   * @return {@link #contact} (Contact details to assist a user in finding and
1827   *         communicating with the publisher.)
1828   */
1829  public List<ContactDetail> getContact() {
1830    if (this.contact == null)
1831      this.contact = new ArrayList<ContactDetail>();
1832    return this.contact;
1833  }
1834
1835  /**
1836   * @return Returns a reference to <code>this</code> for easy method chaining
1837   */
1838  public SearchParameter setContact(List<ContactDetail> theContact) {
1839    this.contact = theContact;
1840    return this;
1841  }
1842
1843  public boolean hasContact() {
1844    if (this.contact == null)
1845      return false;
1846    for (ContactDetail item : this.contact)
1847      if (!item.isEmpty())
1848        return true;
1849    return false;
1850  }
1851
1852  public ContactDetail addContact() { // 3
1853    ContactDetail t = new ContactDetail();
1854    if (this.contact == null)
1855      this.contact = new ArrayList<ContactDetail>();
1856    this.contact.add(t);
1857    return t;
1858  }
1859
1860  public SearchParameter addContact(ContactDetail t) { // 3
1861    if (t == null)
1862      return this;
1863    if (this.contact == null)
1864      this.contact = new ArrayList<ContactDetail>();
1865    this.contact.add(t);
1866    return this;
1867  }
1868
1869  /**
1870   * @return The first repetition of repeating field {@link #contact}, creating it
1871   *         if it does not already exist
1872   */
1873  public ContactDetail getContactFirstRep() {
1874    if (getContact().isEmpty()) {
1875      addContact();
1876    }
1877    return getContact().get(0);
1878  }
1879
1880  /**
1881   * @return {@link #description} (And how it used.). This is the underlying
1882   *         object with id, value and extensions. The accessor "getDescription"
1883   *         gives direct access to the value
1884   */
1885  public MarkdownType getDescriptionElement() {
1886    if (this.description == null)
1887      if (Configuration.errorOnAutoCreate())
1888        throw new Error("Attempt to auto-create SearchParameter.description");
1889      else if (Configuration.doAutoCreate())
1890        this.description = new MarkdownType(); // bb
1891    return this.description;
1892  }
1893
1894  public boolean hasDescriptionElement() {
1895    return this.description != null && !this.description.isEmpty();
1896  }
1897
1898  public boolean hasDescription() {
1899    return this.description != null && !this.description.isEmpty();
1900  }
1901
1902  /**
1903   * @param value {@link #description} (And how it used.). This is the underlying
1904   *              object with id, value and extensions. The accessor
1905   *              "getDescription" gives direct access to the value
1906   */
1907  public SearchParameter setDescriptionElement(MarkdownType value) {
1908    this.description = value;
1909    return this;
1910  }
1911
1912  /**
1913   * @return And how it used.
1914   */
1915  public String getDescription() {
1916    return this.description == null ? null : this.description.getValue();
1917  }
1918
1919  /**
1920   * @param value And how it used.
1921   */
1922  public SearchParameter setDescription(String value) {
1923    if (this.description == null)
1924      this.description = new MarkdownType();
1925    this.description.setValue(value);
1926    return this;
1927  }
1928
1929  /**
1930   * @return {@link #useContext} (The content was developed with a focus and
1931   *         intent of supporting the contexts that are listed. These contexts may
1932   *         be general categories (gender, age, ...) or may be references to
1933   *         specific programs (insurance plans, studies, ...) and may be used to
1934   *         assist with indexing and searching for appropriate search parameter
1935   *         instances.)
1936   */
1937  public List<UsageContext> getUseContext() {
1938    if (this.useContext == null)
1939      this.useContext = new ArrayList<UsageContext>();
1940    return this.useContext;
1941  }
1942
1943  /**
1944   * @return Returns a reference to <code>this</code> for easy method chaining
1945   */
1946  public SearchParameter setUseContext(List<UsageContext> theUseContext) {
1947    this.useContext = theUseContext;
1948    return this;
1949  }
1950
1951  public boolean hasUseContext() {
1952    if (this.useContext == null)
1953      return false;
1954    for (UsageContext item : this.useContext)
1955      if (!item.isEmpty())
1956        return true;
1957    return false;
1958  }
1959
1960  public UsageContext addUseContext() { // 3
1961    UsageContext t = new UsageContext();
1962    if (this.useContext == null)
1963      this.useContext = new ArrayList<UsageContext>();
1964    this.useContext.add(t);
1965    return t;
1966  }
1967
1968  public SearchParameter addUseContext(UsageContext t) { // 3
1969    if (t == null)
1970      return this;
1971    if (this.useContext == null)
1972      this.useContext = new ArrayList<UsageContext>();
1973    this.useContext.add(t);
1974    return this;
1975  }
1976
1977  /**
1978   * @return The first repetition of repeating field {@link #useContext}, creating
1979   *         it if it does not already exist
1980   */
1981  public UsageContext getUseContextFirstRep() {
1982    if (getUseContext().isEmpty()) {
1983      addUseContext();
1984    }
1985    return getUseContext().get(0);
1986  }
1987
1988  /**
1989   * @return {@link #jurisdiction} (A legal or geographic region in which the
1990   *         search parameter is intended to be used.)
1991   */
1992  public List<CodeableConcept> getJurisdiction() {
1993    if (this.jurisdiction == null)
1994      this.jurisdiction = new ArrayList<CodeableConcept>();
1995    return this.jurisdiction;
1996  }
1997
1998  /**
1999   * @return Returns a reference to <code>this</code> for easy method chaining
2000   */
2001  public SearchParameter setJurisdiction(List<CodeableConcept> theJurisdiction) {
2002    this.jurisdiction = theJurisdiction;
2003    return this;
2004  }
2005
2006  public boolean hasJurisdiction() {
2007    if (this.jurisdiction == null)
2008      return false;
2009    for (CodeableConcept item : this.jurisdiction)
2010      if (!item.isEmpty())
2011        return true;
2012    return false;
2013  }
2014
2015  public CodeableConcept addJurisdiction() { // 3
2016    CodeableConcept t = new CodeableConcept();
2017    if (this.jurisdiction == null)
2018      this.jurisdiction = new ArrayList<CodeableConcept>();
2019    this.jurisdiction.add(t);
2020    return t;
2021  }
2022
2023  public SearchParameter addJurisdiction(CodeableConcept t) { // 3
2024    if (t == null)
2025      return this;
2026    if (this.jurisdiction == null)
2027      this.jurisdiction = new ArrayList<CodeableConcept>();
2028    this.jurisdiction.add(t);
2029    return this;
2030  }
2031
2032  /**
2033   * @return The first repetition of repeating field {@link #jurisdiction},
2034   *         creating it if it does not already exist
2035   */
2036  public CodeableConcept getJurisdictionFirstRep() {
2037    if (getJurisdiction().isEmpty()) {
2038      addJurisdiction();
2039    }
2040    return getJurisdiction().get(0);
2041  }
2042
2043  /**
2044   * @return {@link #purpose} (Explanation of why this search parameter is needed
2045   *         and why it has been designed as it has.). This is the underlying
2046   *         object with id, value and extensions. The accessor "getPurpose" gives
2047   *         direct access to the value
2048   */
2049  public MarkdownType getPurposeElement() {
2050    if (this.purpose == null)
2051      if (Configuration.errorOnAutoCreate())
2052        throw new Error("Attempt to auto-create SearchParameter.purpose");
2053      else if (Configuration.doAutoCreate())
2054        this.purpose = new MarkdownType(); // bb
2055    return this.purpose;
2056  }
2057
2058  public boolean hasPurposeElement() {
2059    return this.purpose != null && !this.purpose.isEmpty();
2060  }
2061
2062  public boolean hasPurpose() {
2063    return this.purpose != null && !this.purpose.isEmpty();
2064  }
2065
2066  /**
2067   * @param value {@link #purpose} (Explanation of why this search parameter is
2068   *              needed and why it has been designed as it has.). This is the
2069   *              underlying object with id, value and extensions. The accessor
2070   *              "getPurpose" gives direct access to the value
2071   */
2072  public SearchParameter setPurposeElement(MarkdownType value) {
2073    this.purpose = value;
2074    return this;
2075  }
2076
2077  /**
2078   * @return Explanation of why this search parameter is needed and why it has
2079   *         been designed as it has.
2080   */
2081  public String getPurpose() {
2082    return this.purpose == null ? null : this.purpose.getValue();
2083  }
2084
2085  /**
2086   * @param value Explanation of why this search parameter is needed and why it
2087   *              has been designed as it has.
2088   */
2089  public SearchParameter setPurpose(String value) {
2090    if (value == null)
2091      this.purpose = null;
2092    else {
2093      if (this.purpose == null)
2094        this.purpose = new MarkdownType();
2095      this.purpose.setValue(value);
2096    }
2097    return this;
2098  }
2099
2100  /**
2101   * @return {@link #code} (The code used in the URL or the parameter name in a
2102   *         parameters resource for this search parameter.). This is the
2103   *         underlying object with id, value and extensions. The accessor
2104   *         "getCode" gives direct access to the value
2105   */
2106  public CodeType getCodeElement() {
2107    if (this.code == null)
2108      if (Configuration.errorOnAutoCreate())
2109        throw new Error("Attempt to auto-create SearchParameter.code");
2110      else if (Configuration.doAutoCreate())
2111        this.code = new CodeType(); // bb
2112    return this.code;
2113  }
2114
2115  public boolean hasCodeElement() {
2116    return this.code != null && !this.code.isEmpty();
2117  }
2118
2119  public boolean hasCode() {
2120    return this.code != null && !this.code.isEmpty();
2121  }
2122
2123  /**
2124   * @param value {@link #code} (The code used in the URL or the parameter name in
2125   *              a parameters resource for this search parameter.). This is the
2126   *              underlying object with id, value and extensions. The accessor
2127   *              "getCode" gives direct access to the value
2128   */
2129  public SearchParameter setCodeElement(CodeType value) {
2130    this.code = value;
2131    return this;
2132  }
2133
2134  /**
2135   * @return The code used in the URL or the parameter name in a parameters
2136   *         resource for this search parameter.
2137   */
2138  public String getCode() {
2139    return this.code == null ? null : this.code.getValue();
2140  }
2141
2142  /**
2143   * @param value The code used in the URL or the parameter name in a parameters
2144   *              resource for this search parameter.
2145   */
2146  public SearchParameter setCode(String value) {
2147    if (this.code == null)
2148      this.code = new CodeType();
2149    this.code.setValue(value);
2150    return this;
2151  }
2152
2153  /**
2154   * @return {@link #base} (The base resource type(s) that this search parameter
2155   *         can be used against.)
2156   */
2157  public List<CodeType> getBase() {
2158    if (this.base == null)
2159      this.base = new ArrayList<CodeType>();
2160    return this.base;
2161  }
2162
2163  /**
2164   * @return Returns a reference to <code>this</code> for easy method chaining
2165   */
2166  public SearchParameter setBase(List<CodeType> theBase) {
2167    this.base = theBase;
2168    return this;
2169  }
2170
2171  public boolean hasBase() {
2172    if (this.base == null)
2173      return false;
2174    for (CodeType item : this.base)
2175      if (!item.isEmpty())
2176        return true;
2177    return false;
2178  }
2179
2180  /**
2181   * @return {@link #base} (The base resource type(s) that this search parameter
2182   *         can be used against.)
2183   */
2184  public CodeType addBaseElement() {// 2
2185    CodeType t = new CodeType();
2186    if (this.base == null)
2187      this.base = new ArrayList<CodeType>();
2188    this.base.add(t);
2189    return t;
2190  }
2191
2192  /**
2193   * @param value {@link #base} (The base resource type(s) that this search
2194   *              parameter can be used against.)
2195   */
2196  public SearchParameter addBase(String value) { // 1
2197    CodeType t = new CodeType();
2198    t.setValue(value);
2199    if (this.base == null)
2200      this.base = new ArrayList<CodeType>();
2201    this.base.add(t);
2202    return this;
2203  }
2204
2205  /**
2206   * @param value {@link #base} (The base resource type(s) that this search
2207   *              parameter can be used against.)
2208   */
2209  public boolean hasBase(String value) {
2210    if (this.base == null)
2211      return false;
2212    for (CodeType v : this.base)
2213      if (v.getValue().equals(value)) // code
2214        return true;
2215    return false;
2216  }
2217
2218  /**
2219   * @return {@link #type} (The type of value that a search parameter may contain,
2220   *         and how the content is interpreted.). This is the underlying object
2221   *         with id, value and extensions. The accessor "getType" gives direct
2222   *         access to the value
2223   */
2224  public Enumeration<SearchParamType> getTypeElement() {
2225    if (this.type == null)
2226      if (Configuration.errorOnAutoCreate())
2227        throw new Error("Attempt to auto-create SearchParameter.type");
2228      else if (Configuration.doAutoCreate())
2229        this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory()); // bb
2230    return this.type;
2231  }
2232
2233  public boolean hasTypeElement() {
2234    return this.type != null && !this.type.isEmpty();
2235  }
2236
2237  public boolean hasType() {
2238    return this.type != null && !this.type.isEmpty();
2239  }
2240
2241  /**
2242   * @param value {@link #type} (The type of value that a search parameter may
2243   *              contain, and how the content is interpreted.). This is the
2244   *              underlying object with id, value and extensions. The accessor
2245   *              "getType" gives direct access to the value
2246   */
2247  public SearchParameter setTypeElement(Enumeration<SearchParamType> value) {
2248    this.type = value;
2249    return this;
2250  }
2251
2252  /**
2253   * @return The type of value that a search parameter may contain, and how the
2254   *         content is interpreted.
2255   */
2256  public SearchParamType getType() {
2257    return this.type == null ? null : this.type.getValue();
2258  }
2259
2260  /**
2261   * @param value The type of value that a search parameter may contain, and how
2262   *              the content is interpreted.
2263   */
2264  public SearchParameter setType(SearchParamType value) {
2265    if (this.type == null)
2266      this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory());
2267    this.type.setValue(value);
2268    return this;
2269  }
2270
2271  /**
2272   * @return {@link #expression} (A FHIRPath expression that returns a set of
2273   *         elements for the search parameter.). This is the underlying object
2274   *         with id, value and extensions. The accessor "getExpression" gives
2275   *         direct access to the value
2276   */
2277  public StringType getExpressionElement() {
2278    if (this.expression == null)
2279      if (Configuration.errorOnAutoCreate())
2280        throw new Error("Attempt to auto-create SearchParameter.expression");
2281      else if (Configuration.doAutoCreate())
2282        this.expression = new StringType(); // bb
2283    return this.expression;
2284  }
2285
2286  public boolean hasExpressionElement() {
2287    return this.expression != null && !this.expression.isEmpty();
2288  }
2289
2290  public boolean hasExpression() {
2291    return this.expression != null && !this.expression.isEmpty();
2292  }
2293
2294  /**
2295   * @param value {@link #expression} (A FHIRPath expression that returns a set of
2296   *              elements for the search parameter.). This is the underlying
2297   *              object with id, value and extensions. The accessor
2298   *              "getExpression" gives direct access to the value
2299   */
2300  public SearchParameter setExpressionElement(StringType value) {
2301    this.expression = value;
2302    return this;
2303  }
2304
2305  /**
2306   * @return A FHIRPath expression that returns a set of elements for the search
2307   *         parameter.
2308   */
2309  public String getExpression() {
2310    return this.expression == null ? null : this.expression.getValue();
2311  }
2312
2313  /**
2314   * @param value A FHIRPath expression that returns a set of elements for the
2315   *              search parameter.
2316   */
2317  public SearchParameter setExpression(String value) {
2318    if (Utilities.noString(value))
2319      this.expression = null;
2320    else {
2321      if (this.expression == null)
2322        this.expression = new StringType();
2323      this.expression.setValue(value);
2324    }
2325    return this;
2326  }
2327
2328  /**
2329   * @return {@link #xpath} (An XPath expression that returns a set of elements
2330   *         for the search parameter.). This is the underlying object with id,
2331   *         value and extensions. The accessor "getXpath" gives direct access to
2332   *         the value
2333   */
2334  public StringType getXpathElement() {
2335    if (this.xpath == null)
2336      if (Configuration.errorOnAutoCreate())
2337        throw new Error("Attempt to auto-create SearchParameter.xpath");
2338      else if (Configuration.doAutoCreate())
2339        this.xpath = new StringType(); // bb
2340    return this.xpath;
2341  }
2342
2343  public boolean hasXpathElement() {
2344    return this.xpath != null && !this.xpath.isEmpty();
2345  }
2346
2347  public boolean hasXpath() {
2348    return this.xpath != null && !this.xpath.isEmpty();
2349  }
2350
2351  /**
2352   * @param value {@link #xpath} (An XPath expression that returns a set of
2353   *              elements for the search parameter.). This is the underlying
2354   *              object with id, value and extensions. The accessor "getXpath"
2355   *              gives direct access to the value
2356   */
2357  public SearchParameter setXpathElement(StringType value) {
2358    this.xpath = value;
2359    return this;
2360  }
2361
2362  /**
2363   * @return An XPath expression that returns a set of elements for the search
2364   *         parameter.
2365   */
2366  public String getXpath() {
2367    return this.xpath == null ? null : this.xpath.getValue();
2368  }
2369
2370  /**
2371   * @param value An XPath expression that returns a set of elements for the
2372   *              search parameter.
2373   */
2374  public SearchParameter setXpath(String value) {
2375    if (Utilities.noString(value))
2376      this.xpath = null;
2377    else {
2378      if (this.xpath == null)
2379        this.xpath = new StringType();
2380      this.xpath.setValue(value);
2381    }
2382    return this;
2383  }
2384
2385  /**
2386   * @return {@link #xpathUsage} (How the search parameter relates to the set of
2387   *         elements returned by evaluating the xpath query.). This is the
2388   *         underlying object with id, value and extensions. The accessor
2389   *         "getXpathUsage" gives direct access to the value
2390   */
2391  public Enumeration<XPathUsageType> getXpathUsageElement() {
2392    if (this.xpathUsage == null)
2393      if (Configuration.errorOnAutoCreate())
2394        throw new Error("Attempt to auto-create SearchParameter.xpathUsage");
2395      else if (Configuration.doAutoCreate())
2396        this.xpathUsage = new Enumeration<XPathUsageType>(new XPathUsageTypeEnumFactory()); // bb
2397    return this.xpathUsage;
2398  }
2399
2400  public boolean hasXpathUsageElement() {
2401    return this.xpathUsage != null && !this.xpathUsage.isEmpty();
2402  }
2403
2404  public boolean hasXpathUsage() {
2405    return this.xpathUsage != null && !this.xpathUsage.isEmpty();
2406  }
2407
2408  /**
2409   * @param value {@link #xpathUsage} (How the search parameter relates to the set
2410   *              of elements returned by evaluating the xpath query.). This is
2411   *              the underlying object with id, value and extensions. The
2412   *              accessor "getXpathUsage" gives direct access to the value
2413   */
2414  public SearchParameter setXpathUsageElement(Enumeration<XPathUsageType> value) {
2415    this.xpathUsage = value;
2416    return this;
2417  }
2418
2419  /**
2420   * @return How the search parameter relates to the set of elements returned by
2421   *         evaluating the xpath query.
2422   */
2423  public XPathUsageType getXpathUsage() {
2424    return this.xpathUsage == null ? null : this.xpathUsage.getValue();
2425  }
2426
2427  /**
2428   * @param value How the search parameter relates to the set of elements returned
2429   *              by evaluating the xpath query.
2430   */
2431  public SearchParameter setXpathUsage(XPathUsageType value) {
2432    if (value == null)
2433      this.xpathUsage = null;
2434    else {
2435      if (this.xpathUsage == null)
2436        this.xpathUsage = new Enumeration<XPathUsageType>(new XPathUsageTypeEnumFactory());
2437      this.xpathUsage.setValue(value);
2438    }
2439    return this;
2440  }
2441
2442  /**
2443   * @return {@link #target} (Types of resource (if a resource is referenced).)
2444   */
2445  public List<CodeType> getTarget() {
2446    if (this.target == null)
2447      this.target = new ArrayList<CodeType>();
2448    return this.target;
2449  }
2450
2451  /**
2452   * @return Returns a reference to <code>this</code> for easy method chaining
2453   */
2454  public SearchParameter setTarget(List<CodeType> theTarget) {
2455    this.target = theTarget;
2456    return this;
2457  }
2458
2459  public boolean hasTarget() {
2460    if (this.target == null)
2461      return false;
2462    for (CodeType item : this.target)
2463      if (!item.isEmpty())
2464        return true;
2465    return false;
2466  }
2467
2468  /**
2469   * @return {@link #target} (Types of resource (if a resource is referenced).)
2470   */
2471  public CodeType addTargetElement() {// 2
2472    CodeType t = new CodeType();
2473    if (this.target == null)
2474      this.target = new ArrayList<CodeType>();
2475    this.target.add(t);
2476    return t;
2477  }
2478
2479  /**
2480   * @param value {@link #target} (Types of resource (if a resource is
2481   *              referenced).)
2482   */
2483  public SearchParameter addTarget(String value) { // 1
2484    CodeType t = new CodeType();
2485    t.setValue(value);
2486    if (this.target == null)
2487      this.target = new ArrayList<CodeType>();
2488    this.target.add(t);
2489    return this;
2490  }
2491
2492  /**
2493   * @param value {@link #target} (Types of resource (if a resource is
2494   *              referenced).)
2495   */
2496  public boolean hasTarget(String value) {
2497    if (this.target == null)
2498      return false;
2499    for (CodeType v : this.target)
2500      if (v.getValue().equals(value)) // code
2501        return true;
2502    return false;
2503  }
2504
2505  /**
2506   * @return {@link #multipleOr} (Whether multiple values are allowed for each
2507   *         time the parameter exists. Values are separated by commas, and the
2508   *         parameter matches if any of the values match.). This is the
2509   *         underlying object with id, value and extensions. The accessor
2510   *         "getMultipleOr" gives direct access to the value
2511   */
2512  public BooleanType getMultipleOrElement() {
2513    if (this.multipleOr == null)
2514      if (Configuration.errorOnAutoCreate())
2515        throw new Error("Attempt to auto-create SearchParameter.multipleOr");
2516      else if (Configuration.doAutoCreate())
2517        this.multipleOr = new BooleanType(); // bb
2518    return this.multipleOr;
2519  }
2520
2521  public boolean hasMultipleOrElement() {
2522    return this.multipleOr != null && !this.multipleOr.isEmpty();
2523  }
2524
2525  public boolean hasMultipleOr() {
2526    return this.multipleOr != null && !this.multipleOr.isEmpty();
2527  }
2528
2529  /**
2530   * @param value {@link #multipleOr} (Whether multiple values are allowed for
2531   *              each time the parameter exists. Values are separated by commas,
2532   *              and the parameter matches if any of the values match.). This is
2533   *              the underlying object with id, value and extensions. The
2534   *              accessor "getMultipleOr" gives direct access to the value
2535   */
2536  public SearchParameter setMultipleOrElement(BooleanType value) {
2537    this.multipleOr = value;
2538    return this;
2539  }
2540
2541  /**
2542   * @return Whether multiple values are allowed for each time the parameter
2543   *         exists. Values are separated by commas, and the parameter matches if
2544   *         any of the values match.
2545   */
2546  public boolean getMultipleOr() {
2547    return this.multipleOr == null || this.multipleOr.isEmpty() ? false : this.multipleOr.getValue();
2548  }
2549
2550  /**
2551   * @param value Whether multiple values are allowed for each time the parameter
2552   *              exists. Values are separated by commas, and the parameter
2553   *              matches if any of the values match.
2554   */
2555  public SearchParameter setMultipleOr(boolean value) {
2556    if (this.multipleOr == null)
2557      this.multipleOr = new BooleanType();
2558    this.multipleOr.setValue(value);
2559    return this;
2560  }
2561
2562  /**
2563   * @return {@link #multipleAnd} (Whether multiple parameters are allowed - e.g.
2564   *         more than one parameter with the same name. The search matches if all
2565   *         the parameters match.). This is the underlying object with id, value
2566   *         and extensions. The accessor "getMultipleAnd" gives direct access to
2567   *         the value
2568   */
2569  public BooleanType getMultipleAndElement() {
2570    if (this.multipleAnd == null)
2571      if (Configuration.errorOnAutoCreate())
2572        throw new Error("Attempt to auto-create SearchParameter.multipleAnd");
2573      else if (Configuration.doAutoCreate())
2574        this.multipleAnd = new BooleanType(); // bb
2575    return this.multipleAnd;
2576  }
2577
2578  public boolean hasMultipleAndElement() {
2579    return this.multipleAnd != null && !this.multipleAnd.isEmpty();
2580  }
2581
2582  public boolean hasMultipleAnd() {
2583    return this.multipleAnd != null && !this.multipleAnd.isEmpty();
2584  }
2585
2586  /**
2587   * @param value {@link #multipleAnd} (Whether multiple parameters are allowed -
2588   *              e.g. more than one parameter with the same name. The search
2589   *              matches if all the parameters match.). This is the underlying
2590   *              object with id, value and extensions. The accessor
2591   *              "getMultipleAnd" gives direct access to the value
2592   */
2593  public SearchParameter setMultipleAndElement(BooleanType value) {
2594    this.multipleAnd = value;
2595    return this;
2596  }
2597
2598  /**
2599   * @return Whether multiple parameters are allowed - e.g. more than one
2600   *         parameter with the same name. The search matches if all the
2601   *         parameters match.
2602   */
2603  public boolean getMultipleAnd() {
2604    return this.multipleAnd == null || this.multipleAnd.isEmpty() ? false : this.multipleAnd.getValue();
2605  }
2606
2607  /**
2608   * @param value Whether multiple parameters are allowed - e.g. more than one
2609   *              parameter with the same name. The search matches if all the
2610   *              parameters match.
2611   */
2612  public SearchParameter setMultipleAnd(boolean value) {
2613    if (this.multipleAnd == null)
2614      this.multipleAnd = new BooleanType();
2615    this.multipleAnd.setValue(value);
2616    return this;
2617  }
2618
2619  /**
2620   * @return {@link #comparator} (Comparators supported for the search parameter.)
2621   */
2622  public List<Enumeration<SearchComparator>> getComparator() {
2623    if (this.comparator == null)
2624      this.comparator = new ArrayList<Enumeration<SearchComparator>>();
2625    return this.comparator;
2626  }
2627
2628  /**
2629   * @return Returns a reference to <code>this</code> for easy method chaining
2630   */
2631  public SearchParameter setComparator(List<Enumeration<SearchComparator>> theComparator) {
2632    this.comparator = theComparator;
2633    return this;
2634  }
2635
2636  public boolean hasComparator() {
2637    if (this.comparator == null)
2638      return false;
2639    for (Enumeration<SearchComparator> item : this.comparator)
2640      if (!item.isEmpty())
2641        return true;
2642    return false;
2643  }
2644
2645  /**
2646   * @return {@link #comparator} (Comparators supported for the search parameter.)
2647   */
2648  public Enumeration<SearchComparator> addComparatorElement() {// 2
2649    Enumeration<SearchComparator> t = new Enumeration<SearchComparator>(new SearchComparatorEnumFactory());
2650    if (this.comparator == null)
2651      this.comparator = new ArrayList<Enumeration<SearchComparator>>();
2652    this.comparator.add(t);
2653    return t;
2654  }
2655
2656  /**
2657   * @param value {@link #comparator} (Comparators supported for the search
2658   *              parameter.)
2659   */
2660  public SearchParameter addComparator(SearchComparator value) { // 1
2661    Enumeration<SearchComparator> t = new Enumeration<SearchComparator>(new SearchComparatorEnumFactory());
2662    t.setValue(value);
2663    if (this.comparator == null)
2664      this.comparator = new ArrayList<Enumeration<SearchComparator>>();
2665    this.comparator.add(t);
2666    return this;
2667  }
2668
2669  /**
2670   * @param value {@link #comparator} (Comparators supported for the search
2671   *              parameter.)
2672   */
2673  public boolean hasComparator(SearchComparator value) {
2674    if (this.comparator == null)
2675      return false;
2676    for (Enumeration<SearchComparator> v : this.comparator)
2677      if (v.getValue().equals(value)) // code
2678        return true;
2679    return false;
2680  }
2681
2682  /**
2683   * @return {@link #modifier} (A modifier supported for the search parameter.)
2684   */
2685  public List<Enumeration<SearchModifierCode>> getModifier() {
2686    if (this.modifier == null)
2687      this.modifier = new ArrayList<Enumeration<SearchModifierCode>>();
2688    return this.modifier;
2689  }
2690
2691  /**
2692   * @return Returns a reference to <code>this</code> for easy method chaining
2693   */
2694  public SearchParameter setModifier(List<Enumeration<SearchModifierCode>> theModifier) {
2695    this.modifier = theModifier;
2696    return this;
2697  }
2698
2699  public boolean hasModifier() {
2700    if (this.modifier == null)
2701      return false;
2702    for (Enumeration<SearchModifierCode> item : this.modifier)
2703      if (!item.isEmpty())
2704        return true;
2705    return false;
2706  }
2707
2708  /**
2709   * @return {@link #modifier} (A modifier supported for the search parameter.)
2710   */
2711  public Enumeration<SearchModifierCode> addModifierElement() {// 2
2712    Enumeration<SearchModifierCode> t = new Enumeration<SearchModifierCode>(new SearchModifierCodeEnumFactory());
2713    if (this.modifier == null)
2714      this.modifier = new ArrayList<Enumeration<SearchModifierCode>>();
2715    this.modifier.add(t);
2716    return t;
2717  }
2718
2719  /**
2720   * @param value {@link #modifier} (A modifier supported for the search
2721   *              parameter.)
2722   */
2723  public SearchParameter addModifier(SearchModifierCode value) { // 1
2724    Enumeration<SearchModifierCode> t = new Enumeration<SearchModifierCode>(new SearchModifierCodeEnumFactory());
2725    t.setValue(value);
2726    if (this.modifier == null)
2727      this.modifier = new ArrayList<Enumeration<SearchModifierCode>>();
2728    this.modifier.add(t);
2729    return this;
2730  }
2731
2732  /**
2733   * @param value {@link #modifier} (A modifier supported for the search
2734   *              parameter.)
2735   */
2736  public boolean hasModifier(SearchModifierCode value) {
2737    if (this.modifier == null)
2738      return false;
2739    for (Enumeration<SearchModifierCode> v : this.modifier)
2740      if (v.getValue().equals(value)) // code
2741        return true;
2742    return false;
2743  }
2744
2745  /**
2746   * @return {@link #chain} (Contains the names of any search parameters which may
2747   *         be chained to the containing search parameter. Chained parameters may
2748   *         be added to search parameters of type reference and specify that
2749   *         resources will only be returned if they contain a reference to a
2750   *         resource which matches the chained parameter value. Values for this
2751   *         field should be drawn from SearchParameter.code for a parameter on
2752   *         the target resource type.)
2753   */
2754  public List<StringType> getChain() {
2755    if (this.chain == null)
2756      this.chain = new ArrayList<StringType>();
2757    return this.chain;
2758  }
2759
2760  /**
2761   * @return Returns a reference to <code>this</code> for easy method chaining
2762   */
2763  public SearchParameter setChain(List<StringType> theChain) {
2764    this.chain = theChain;
2765    return this;
2766  }
2767
2768  public boolean hasChain() {
2769    if (this.chain == null)
2770      return false;
2771    for (StringType item : this.chain)
2772      if (!item.isEmpty())
2773        return true;
2774    return false;
2775  }
2776
2777  /**
2778   * @return {@link #chain} (Contains the names of any search parameters which may
2779   *         be chained to the containing search parameter. Chained parameters may
2780   *         be added to search parameters of type reference and specify that
2781   *         resources will only be returned if they contain a reference to a
2782   *         resource which matches the chained parameter value. Values for this
2783   *         field should be drawn from SearchParameter.code for a parameter on
2784   *         the target resource type.)
2785   */
2786  public StringType addChainElement() {// 2
2787    StringType t = new StringType();
2788    if (this.chain == null)
2789      this.chain = new ArrayList<StringType>();
2790    this.chain.add(t);
2791    return t;
2792  }
2793
2794  /**
2795   * @param value {@link #chain} (Contains the names of any search parameters
2796   *              which may be chained to the containing search parameter. Chained
2797   *              parameters may be added to search parameters of type reference
2798   *              and specify that resources will only be returned if they contain
2799   *              a reference to a resource which matches the chained parameter
2800   *              value. Values for this field should be drawn from
2801   *              SearchParameter.code for a parameter on the target resource
2802   *              type.)
2803   */
2804  public SearchParameter addChain(String value) { // 1
2805    StringType t = new StringType();
2806    t.setValue(value);
2807    if (this.chain == null)
2808      this.chain = new ArrayList<StringType>();
2809    this.chain.add(t);
2810    return this;
2811  }
2812
2813  /**
2814   * @param value {@link #chain} (Contains the names of any search parameters
2815   *              which may be chained to the containing search parameter. Chained
2816   *              parameters may be added to search parameters of type reference
2817   *              and specify that resources will only be returned if they contain
2818   *              a reference to a resource which matches the chained parameter
2819   *              value. Values for this field should be drawn from
2820   *              SearchParameter.code for a parameter on the target resource
2821   *              type.)
2822   */
2823  public boolean hasChain(String value) {
2824    if (this.chain == null)
2825      return false;
2826    for (StringType v : this.chain)
2827      if (v.getValue().equals(value)) // string
2828        return true;
2829    return false;
2830  }
2831
2832  /**
2833   * @return {@link #component} (Used to define the parts of a composite search
2834   *         parameter.)
2835   */
2836  public List<SearchParameterComponentComponent> getComponent() {
2837    if (this.component == null)
2838      this.component = new ArrayList<SearchParameterComponentComponent>();
2839    return this.component;
2840  }
2841
2842  /**
2843   * @return Returns a reference to <code>this</code> for easy method chaining
2844   */
2845  public SearchParameter setComponent(List<SearchParameterComponentComponent> theComponent) {
2846    this.component = theComponent;
2847    return this;
2848  }
2849
2850  public boolean hasComponent() {
2851    if (this.component == null)
2852      return false;
2853    for (SearchParameterComponentComponent item : this.component)
2854      if (!item.isEmpty())
2855        return true;
2856    return false;
2857  }
2858
2859  public SearchParameterComponentComponent addComponent() { // 3
2860    SearchParameterComponentComponent t = new SearchParameterComponentComponent();
2861    if (this.component == null)
2862      this.component = new ArrayList<SearchParameterComponentComponent>();
2863    this.component.add(t);
2864    return t;
2865  }
2866
2867  public SearchParameter addComponent(SearchParameterComponentComponent t) { // 3
2868    if (t == null)
2869      return this;
2870    if (this.component == null)
2871      this.component = new ArrayList<SearchParameterComponentComponent>();
2872    this.component.add(t);
2873    return this;
2874  }
2875
2876  /**
2877   * @return The first repetition of repeating field {@link #component}, creating
2878   *         it if it does not already exist
2879   */
2880  public SearchParameterComponentComponent getComponentFirstRep() {
2881    if (getComponent().isEmpty()) {
2882      addComponent();
2883    }
2884    return getComponent().get(0);
2885  }
2886
2887  protected void listChildren(List<Property> children) {
2888    super.listChildren(children);
2889    children.add(new Property("url", "uri",
2890        "An absolute URI that is used to identify this search parameter when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this search parameter is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the search parameter is stored on different servers.",
2891        0, 1, url));
2892    children.add(new Property("version", "string",
2893        "The identifier that is used to identify this version of the search parameter when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the search parameter author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.",
2894        0, 1, version));
2895    children.add(new Property("name", "string",
2896        "A natural language name identifying the search parameter. This name should be usable as an identifier for the module by machine processing applications such as code generation.",
2897        0, 1, name));
2898    children.add(new Property("derivedFrom", "canonical(SearchParameter)",
2899        "Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. i.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.",
2900        0, 1, derivedFrom));
2901    children.add(new Property("status", "code",
2902        "The status of this search parameter. Enables tracking the life-cycle of the content.", 0, 1, status));
2903    children.add(new Property("experimental", "boolean",
2904        "A Boolean value to indicate that this search parameter is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
2905        0, 1, experimental));
2906    children.add(new Property("date", "dateTime",
2907        "The date  (and optionally time) when the search parameter was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.",
2908        0, 1, date));
2909    children.add(new Property("publisher", "string",
2910        "The name of the organization or individual that published the search parameter.", 0, 1, publisher));
2911    children.add(new Property("contact", "ContactDetail",
2912        "Contact details to assist a user in finding and communicating with the publisher.", 0,
2913        java.lang.Integer.MAX_VALUE, contact));
2914    children.add(new Property("description", "markdown", "And how it used.", 0, 1, description));
2915    children.add(new Property("useContext", "UsageContext",
2916        "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate search parameter instances.",
2917        0, java.lang.Integer.MAX_VALUE, useContext));
2918    children.add(new Property("jurisdiction", "CodeableConcept",
2919        "A legal or geographic region in which the search parameter is intended to be used.", 0,
2920        java.lang.Integer.MAX_VALUE, jurisdiction));
2921    children.add(new Property("purpose", "markdown",
2922        "Explanation of why this search parameter is needed and why it has been designed as it has.", 0, 1, purpose));
2923    children.add(new Property("code", "code",
2924        "The code used in the URL or the parameter name in a parameters resource for this search parameter.", 0, 1,
2925        code));
2926    children
2927        .add(new Property("base", "code", "The base resource type(s) that this search parameter can be used against.",
2928            0, java.lang.Integer.MAX_VALUE, base));
2929    children.add(new Property("type", "code",
2930        "The type of value that a search parameter may contain, and how the content is interpreted.", 0, 1, type));
2931    children.add(new Property("expression", "string",
2932        "A FHIRPath expression that returns a set of elements for the search parameter.", 0, 1, expression));
2933    children.add(new Property("xpath", "string",
2934        "An XPath expression that returns a set of elements for the search parameter.", 0, 1, xpath));
2935    children.add(new Property("xpathUsage", "code",
2936        "How the search parameter relates to the set of elements returned by evaluating the xpath query.", 0, 1,
2937        xpathUsage));
2938    children.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0,
2939        java.lang.Integer.MAX_VALUE, target));
2940    children.add(new Property("multipleOr", "boolean",
2941        "Whether multiple values are allowed for each time the parameter exists. Values are separated by commas, and the parameter matches if any of the values match.",
2942        0, 1, multipleOr));
2943    children.add(new Property("multipleAnd", "boolean",
2944        "Whether multiple parameters are allowed - e.g. more than one parameter with the same name. The search matches if all the parameters match.",
2945        0, 1, multipleAnd));
2946    children.add(new Property("comparator", "code", "Comparators supported for the search parameter.", 0,
2947        java.lang.Integer.MAX_VALUE, comparator));
2948    children.add(new Property("modifier", "code", "A modifier supported for the search parameter.", 0,
2949        java.lang.Integer.MAX_VALUE, modifier));
2950    children.add(new Property("chain", "string",
2951        "Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.",
2952        0, java.lang.Integer.MAX_VALUE, chain));
2953    children.add(new Property("component", "", "Used to define the parts of a composite search parameter.", 0,
2954        java.lang.Integer.MAX_VALUE, component));
2955  }
2956
2957  @Override
2958  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2959    switch (_hash) {
2960    case 116079:
2961      /* url */ return new Property("url", "uri",
2962          "An absolute URI that is used to identify this search parameter when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this search parameter is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the search parameter is stored on different servers.",
2963          0, 1, url);
2964    case 351608024:
2965      /* version */ return new Property("version", "string",
2966          "The identifier that is used to identify this version of the search parameter when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the search parameter author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.",
2967          0, 1, version);
2968    case 3373707:
2969      /* name */ return new Property("name", "string",
2970          "A natural language name identifying the search parameter. This name should be usable as an identifier for the module by machine processing applications such as code generation.",
2971          0, 1, name);
2972    case 1077922663:
2973      /* derivedFrom */ return new Property("derivedFrom", "canonical(SearchParameter)",
2974          "Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. i.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.",
2975          0, 1, derivedFrom);
2976    case -892481550:
2977      /* status */ return new Property("status", "code",
2978          "The status of this search parameter. Enables tracking the life-cycle of the content.", 0, 1, status);
2979    case -404562712:
2980      /* experimental */ return new Property("experimental", "boolean",
2981          "A Boolean value to indicate that this search parameter is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
2982          0, 1, experimental);
2983    case 3076014:
2984      /* date */ return new Property("date", "dateTime",
2985          "The date  (and optionally time) when the search parameter was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.",
2986          0, 1, date);
2987    case 1447404028:
2988      /* publisher */ return new Property("publisher", "string",
2989          "The name of the organization or individual that published the search parameter.", 0, 1, publisher);
2990    case 951526432:
2991      /* contact */ return new Property("contact", "ContactDetail",
2992          "Contact details to assist a user in finding and communicating with the publisher.", 0,
2993          java.lang.Integer.MAX_VALUE, contact);
2994    case -1724546052:
2995      /* description */ return new Property("description", "markdown", "And how it used.", 0, 1, description);
2996    case -669707736:
2997      /* useContext */ return new Property("useContext", "UsageContext",
2998          "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate search parameter instances.",
2999          0, java.lang.Integer.MAX_VALUE, useContext);
3000    case -507075711:
3001      /* jurisdiction */ return new Property("jurisdiction", "CodeableConcept",
3002          "A legal or geographic region in which the search parameter is intended to be used.", 0,
3003          java.lang.Integer.MAX_VALUE, jurisdiction);
3004    case -220463842:
3005      /* purpose */ return new Property("purpose", "markdown",
3006          "Explanation of why this search parameter is needed and why it has been designed as it has.", 0, 1, purpose);
3007    case 3059181:
3008      /* code */ return new Property("code", "code",
3009          "The code used in the URL or the parameter name in a parameters resource for this search parameter.", 0, 1,
3010          code);
3011    case 3016401:
3012      /* base */ return new Property("base", "code",
3013          "The base resource type(s) that this search parameter can be used against.", 0, java.lang.Integer.MAX_VALUE,
3014          base);
3015    case 3575610:
3016      /* type */ return new Property("type", "code",
3017          "The type of value that a search parameter may contain, and how the content is interpreted.", 0, 1, type);
3018    case -1795452264:
3019      /* expression */ return new Property("expression", "string",
3020          "A FHIRPath expression that returns a set of elements for the search parameter.", 0, 1, expression);
3021    case 114256029:
3022      /* xpath */ return new Property("xpath", "string",
3023          "An XPath expression that returns a set of elements for the search parameter.", 0, 1, xpath);
3024    case 1801322244:
3025      /* xpathUsage */ return new Property("xpathUsage", "code",
3026          "How the search parameter relates to the set of elements returned by evaluating the xpath query.", 0, 1,
3027          xpathUsage);
3028    case -880905839:
3029      /* target */ return new Property("target", "code", "Types of resource (if a resource is referenced).", 0,
3030          java.lang.Integer.MAX_VALUE, target);
3031    case 1265069075:
3032      /* multipleOr */ return new Property("multipleOr", "boolean",
3033          "Whether multiple values are allowed for each time the parameter exists. Values are separated by commas, and the parameter matches if any of the values match.",
3034          0, 1, multipleOr);
3035    case 562422183:
3036      /* multipleAnd */ return new Property("multipleAnd", "boolean",
3037          "Whether multiple parameters are allowed - e.g. more than one parameter with the same name. The search matches if all the parameters match.",
3038          0, 1, multipleAnd);
3039    case -844673834:
3040      /* comparator */ return new Property("comparator", "code", "Comparators supported for the search parameter.", 0,
3041          java.lang.Integer.MAX_VALUE, comparator);
3042    case -615513385:
3043      /* modifier */ return new Property("modifier", "code", "A modifier supported for the search parameter.", 0,
3044          java.lang.Integer.MAX_VALUE, modifier);
3045    case 94623425:
3046      /* chain */ return new Property("chain", "string",
3047          "Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.",
3048          0, java.lang.Integer.MAX_VALUE, chain);
3049    case -1399907075:
3050      /* component */ return new Property("component", "", "Used to define the parts of a composite search parameter.",
3051          0, java.lang.Integer.MAX_VALUE, component);
3052    default:
3053      return super.getNamedProperty(_hash, _name, _checkValid);
3054    }
3055
3056  }
3057
3058  @Override
3059  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3060    switch (hash) {
3061    case 116079:
3062      /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
3063    case 351608024:
3064      /* version */ return this.version == null ? new Base[0] : new Base[] { this.version }; // StringType
3065    case 3373707:
3066      /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
3067    case 1077922663:
3068      /* derivedFrom */ return this.derivedFrom == null ? new Base[0] : new Base[] { this.derivedFrom }; // CanonicalType
3069    case -892481550:
3070      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<PublicationStatus>
3071    case -404562712:
3072      /* experimental */ return this.experimental == null ? new Base[0] : new Base[] { this.experimental }; // BooleanType
3073    case 3076014:
3074      /* date */ return this.date == null ? new Base[0] : new Base[] { this.date }; // DateTimeType
3075    case 1447404028:
3076      /* publisher */ return this.publisher == null ? new Base[0] : new Base[] { this.publisher }; // StringType
3077    case 951526432:
3078      /* contact */ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3079    case -1724546052:
3080      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // MarkdownType
3081    case -669707736:
3082      /* useContext */ return this.useContext == null ? new Base[0]
3083          : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3084    case -507075711:
3085      /* jurisdiction */ return this.jurisdiction == null ? new Base[0]
3086          : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3087    case -220463842:
3088      /* purpose */ return this.purpose == null ? new Base[0] : new Base[] { this.purpose }; // MarkdownType
3089    case 3059181:
3090      /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeType
3091    case 3016401:
3092      /* base */ return this.base == null ? new Base[0] : this.base.toArray(new Base[this.base.size()]); // CodeType
3093    case 3575610:
3094      /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<SearchParamType>
3095    case -1795452264:
3096      /* expression */ return this.expression == null ? new Base[0] : new Base[] { this.expression }; // StringType
3097    case 114256029:
3098      /* xpath */ return this.xpath == null ? new Base[0] : new Base[] { this.xpath }; // StringType
3099    case 1801322244:
3100      /* xpathUsage */ return this.xpathUsage == null ? new Base[0] : new Base[] { this.xpathUsage }; // Enumeration<XPathUsageType>
3101    case -880905839:
3102      /* target */ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // CodeType
3103    case 1265069075:
3104      /* multipleOr */ return this.multipleOr == null ? new Base[0] : new Base[] { this.multipleOr }; // BooleanType
3105    case 562422183:
3106      /* multipleAnd */ return this.multipleAnd == null ? new Base[0] : new Base[] { this.multipleAnd }; // BooleanType
3107    case -844673834:
3108      /* comparator */ return this.comparator == null ? new Base[0]
3109          : this.comparator.toArray(new Base[this.comparator.size()]); // Enumeration<SearchComparator>
3110    case -615513385:
3111      /* modifier */ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Enumeration<SearchModifierCode>
3112    case 94623425:
3113      /* chain */ return this.chain == null ? new Base[0] : this.chain.toArray(new Base[this.chain.size()]); // StringType
3114    case -1399907075:
3115      /* component */ return this.component == null ? new Base[0]
3116          : this.component.toArray(new Base[this.component.size()]); // SearchParameterComponentComponent
3117    default:
3118      return super.getProperty(hash, name, checkValid);
3119    }
3120
3121  }
3122
3123  @Override
3124  public Base setProperty(int hash, String name, Base value) throws FHIRException {
3125    switch (hash) {
3126    case 116079: // url
3127      this.url = castToUri(value); // UriType
3128      return value;
3129    case 351608024: // version
3130      this.version = castToString(value); // StringType
3131      return value;
3132    case 3373707: // name
3133      this.name = castToString(value); // StringType
3134      return value;
3135    case 1077922663: // derivedFrom
3136      this.derivedFrom = castToCanonical(value); // CanonicalType
3137      return value;
3138    case -892481550: // status
3139      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3140      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3141      return value;
3142    case -404562712: // experimental
3143      this.experimental = castToBoolean(value); // BooleanType
3144      return value;
3145    case 3076014: // date
3146      this.date = castToDateTime(value); // DateTimeType
3147      return value;
3148    case 1447404028: // publisher
3149      this.publisher = castToString(value); // StringType
3150      return value;
3151    case 951526432: // contact
3152      this.getContact().add(castToContactDetail(value)); // ContactDetail
3153      return value;
3154    case -1724546052: // description
3155      this.description = castToMarkdown(value); // MarkdownType
3156      return value;
3157    case -669707736: // useContext
3158      this.getUseContext().add(castToUsageContext(value)); // UsageContext
3159      return value;
3160    case -507075711: // jurisdiction
3161      this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
3162      return value;
3163    case -220463842: // purpose
3164      this.purpose = castToMarkdown(value); // MarkdownType
3165      return value;
3166    case 3059181: // code
3167      this.code = castToCode(value); // CodeType
3168      return value;
3169    case 3016401: // base
3170      this.getBase().add(castToCode(value)); // CodeType
3171      return value;
3172    case 3575610: // type
3173      value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
3174      this.type = (Enumeration) value; // Enumeration<SearchParamType>
3175      return value;
3176    case -1795452264: // expression
3177      this.expression = castToString(value); // StringType
3178      return value;
3179    case 114256029: // xpath
3180      this.xpath = castToString(value); // StringType
3181      return value;
3182    case 1801322244: // xpathUsage
3183      value = new XPathUsageTypeEnumFactory().fromType(castToCode(value));
3184      this.xpathUsage = (Enumeration) value; // Enumeration<XPathUsageType>
3185      return value;
3186    case -880905839: // target
3187      this.getTarget().add(castToCode(value)); // CodeType
3188      return value;
3189    case 1265069075: // multipleOr
3190      this.multipleOr = castToBoolean(value); // BooleanType
3191      return value;
3192    case 562422183: // multipleAnd
3193      this.multipleAnd = castToBoolean(value); // BooleanType
3194      return value;
3195    case -844673834: // comparator
3196      value = new SearchComparatorEnumFactory().fromType(castToCode(value));
3197      this.getComparator().add((Enumeration) value); // Enumeration<SearchComparator>
3198      return value;
3199    case -615513385: // modifier
3200      value = new SearchModifierCodeEnumFactory().fromType(castToCode(value));
3201      this.getModifier().add((Enumeration) value); // Enumeration<SearchModifierCode>
3202      return value;
3203    case 94623425: // chain
3204      this.getChain().add(castToString(value)); // StringType
3205      return value;
3206    case -1399907075: // component
3207      this.getComponent().add((SearchParameterComponentComponent) value); // SearchParameterComponentComponent
3208      return value;
3209    default:
3210      return super.setProperty(hash, name, value);
3211    }
3212
3213  }
3214
3215  @Override
3216  public Base setProperty(String name, Base value) throws FHIRException {
3217    if (name.equals("url")) {
3218      this.url = castToUri(value); // UriType
3219    } else if (name.equals("version")) {
3220      this.version = castToString(value); // StringType
3221    } else if (name.equals("name")) {
3222      this.name = castToString(value); // StringType
3223    } else if (name.equals("derivedFrom")) {
3224      this.derivedFrom = castToCanonical(value); // CanonicalType
3225    } else if (name.equals("status")) {
3226      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3227      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3228    } else if (name.equals("experimental")) {
3229      this.experimental = castToBoolean(value); // BooleanType
3230    } else if (name.equals("date")) {
3231      this.date = castToDateTime(value); // DateTimeType
3232    } else if (name.equals("publisher")) {
3233      this.publisher = castToString(value); // StringType
3234    } else if (name.equals("contact")) {
3235      this.getContact().add(castToContactDetail(value));
3236    } else if (name.equals("description")) {
3237      this.description = castToMarkdown(value); // MarkdownType
3238    } else if (name.equals("useContext")) {
3239      this.getUseContext().add(castToUsageContext(value));
3240    } else if (name.equals("jurisdiction")) {
3241      this.getJurisdiction().add(castToCodeableConcept(value));
3242    } else if (name.equals("purpose")) {
3243      this.purpose = castToMarkdown(value); // MarkdownType
3244    } else if (name.equals("code")) {
3245      this.code = castToCode(value); // CodeType
3246    } else if (name.equals("base")) {
3247      this.getBase().add(castToCode(value));
3248    } else if (name.equals("type")) {
3249      value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
3250      this.type = (Enumeration) value; // Enumeration<SearchParamType>
3251    } else if (name.equals("expression")) {
3252      this.expression = castToString(value); // StringType
3253    } else if (name.equals("xpath")) {
3254      this.xpath = castToString(value); // StringType
3255    } else if (name.equals("xpathUsage")) {
3256      value = new XPathUsageTypeEnumFactory().fromType(castToCode(value));
3257      this.xpathUsage = (Enumeration) value; // Enumeration<XPathUsageType>
3258    } else if (name.equals("target")) {
3259      this.getTarget().add(castToCode(value));
3260    } else if (name.equals("multipleOr")) {
3261      this.multipleOr = castToBoolean(value); // BooleanType
3262    } else if (name.equals("multipleAnd")) {
3263      this.multipleAnd = castToBoolean(value); // BooleanType
3264    } else if (name.equals("comparator")) {
3265      value = new SearchComparatorEnumFactory().fromType(castToCode(value));
3266      this.getComparator().add((Enumeration) value);
3267    } else if (name.equals("modifier")) {
3268      value = new SearchModifierCodeEnumFactory().fromType(castToCode(value));
3269      this.getModifier().add((Enumeration) value);
3270    } else if (name.equals("chain")) {
3271      this.getChain().add(castToString(value));
3272    } else if (name.equals("component")) {
3273      this.getComponent().add((SearchParameterComponentComponent) value);
3274    } else
3275      return super.setProperty(name, value);
3276    return value;
3277  }
3278
3279  @Override
3280  public void removeChild(String name, Base value) throws FHIRException {
3281    if (name.equals("url")) {
3282      this.url = null;
3283    } else if (name.equals("version")) {
3284      this.version = null;
3285    } else if (name.equals("name")) {
3286      this.name = null;
3287    } else if (name.equals("derivedFrom")) {
3288      this.derivedFrom = null;
3289    } else if (name.equals("status")) {
3290      this.status = null;
3291    } else if (name.equals("experimental")) {
3292      this.experimental = null;
3293    } else if (name.equals("date")) {
3294      this.date = null;
3295    } else if (name.equals("publisher")) {
3296      this.publisher = null;
3297    } else if (name.equals("contact")) {
3298      this.getContact().remove(castToContactDetail(value));
3299    } else if (name.equals("description")) {
3300      this.description = null;
3301    } else if (name.equals("useContext")) {
3302      this.getUseContext().remove(castToUsageContext(value));
3303    } else if (name.equals("jurisdiction")) {
3304      this.getJurisdiction().remove(castToCodeableConcept(value));
3305    } else if (name.equals("purpose")) {
3306      this.purpose = null;
3307    } else if (name.equals("code")) {
3308      this.code = null;
3309    } else if (name.equals("base")) {
3310      this.getBase().remove(castToCode(value));
3311    } else if (name.equals("type")) {
3312      this.type = null;
3313    } else if (name.equals("expression")) {
3314      this.expression = null;
3315    } else if (name.equals("xpath")) {
3316      this.xpath = null;
3317    } else if (name.equals("xpathUsage")) {
3318      this.xpathUsage = null;
3319    } else if (name.equals("target")) {
3320      this.getTarget().remove(castToCode(value));
3321    } else if (name.equals("multipleOr")) {
3322      this.multipleOr = null;
3323    } else if (name.equals("multipleAnd")) {
3324      this.multipleAnd = null;
3325    } else if (name.equals("comparator")) {
3326      this.getComparator().remove((Enumeration) value);
3327    } else if (name.equals("modifier")) {
3328      value = null;
3329      this.getModifier().remove((Enumeration) value);
3330    } else if (name.equals("chain")) {
3331      this.getChain().remove(castToString(value));
3332    } else if (name.equals("component")) {
3333      this.getComponent().remove((SearchParameterComponentComponent) value);
3334    } else
3335      super.removeChild(name, value);
3336    
3337  }
3338
3339  @Override
3340  public Base makeProperty(int hash, String name) throws FHIRException {
3341    switch (hash) {
3342    case 116079:
3343      return getUrlElement();
3344    case 351608024:
3345      return getVersionElement();
3346    case 3373707:
3347      return getNameElement();
3348    case 1077922663:
3349      return getDerivedFromElement();
3350    case -892481550:
3351      return getStatusElement();
3352    case -404562712:
3353      return getExperimentalElement();
3354    case 3076014:
3355      return getDateElement();
3356    case 1447404028:
3357      return getPublisherElement();
3358    case 951526432:
3359      return addContact();
3360    case -1724546052:
3361      return getDescriptionElement();
3362    case -669707736:
3363      return addUseContext();
3364    case -507075711:
3365      return addJurisdiction();
3366    case -220463842:
3367      return getPurposeElement();
3368    case 3059181:
3369      return getCodeElement();
3370    case 3016401:
3371      return addBaseElement();
3372    case 3575610:
3373      return getTypeElement();
3374    case -1795452264:
3375      return getExpressionElement();
3376    case 114256029:
3377      return getXpathElement();
3378    case 1801322244:
3379      return getXpathUsageElement();
3380    case -880905839:
3381      return addTargetElement();
3382    case 1265069075:
3383      return getMultipleOrElement();
3384    case 562422183:
3385      return getMultipleAndElement();
3386    case -844673834:
3387      return addComparatorElement();
3388    case -615513385:
3389      return addModifierElement();
3390    case 94623425:
3391      return addChainElement();
3392    case -1399907075:
3393      return addComponent();
3394    default:
3395      return super.makeProperty(hash, name);
3396    }
3397
3398  }
3399
3400  @Override
3401  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3402    switch (hash) {
3403    case 116079:
3404      /* url */ return new String[] { "uri" };
3405    case 351608024:
3406      /* version */ return new String[] { "string" };
3407    case 3373707:
3408      /* name */ return new String[] { "string" };
3409    case 1077922663:
3410      /* derivedFrom */ return new String[] { "canonical" };
3411    case -892481550:
3412      /* status */ return new String[] { "code" };
3413    case -404562712:
3414      /* experimental */ return new String[] { "boolean" };
3415    case 3076014:
3416      /* date */ return new String[] { "dateTime" };
3417    case 1447404028:
3418      /* publisher */ return new String[] { "string" };
3419    case 951526432:
3420      /* contact */ return new String[] { "ContactDetail" };
3421    case -1724546052:
3422      /* description */ return new String[] { "markdown" };
3423    case -669707736:
3424      /* useContext */ return new String[] { "UsageContext" };
3425    case -507075711:
3426      /* jurisdiction */ return new String[] { "CodeableConcept" };
3427    case -220463842:
3428      /* purpose */ return new String[] { "markdown" };
3429    case 3059181:
3430      /* code */ return new String[] { "code" };
3431    case 3016401:
3432      /* base */ return new String[] { "code" };
3433    case 3575610:
3434      /* type */ return new String[] { "code" };
3435    case -1795452264:
3436      /* expression */ return new String[] { "string" };
3437    case 114256029:
3438      /* xpath */ return new String[] { "string" };
3439    case 1801322244:
3440      /* xpathUsage */ return new String[] { "code" };
3441    case -880905839:
3442      /* target */ return new String[] { "code" };
3443    case 1265069075:
3444      /* multipleOr */ return new String[] { "boolean" };
3445    case 562422183:
3446      /* multipleAnd */ return new String[] { "boolean" };
3447    case -844673834:
3448      /* comparator */ return new String[] { "code" };
3449    case -615513385:
3450      /* modifier */ return new String[] { "code" };
3451    case 94623425:
3452      /* chain */ return new String[] { "string" };
3453    case -1399907075:
3454      /* component */ return new String[] {};
3455    default:
3456      return super.getTypesForProperty(hash, name);
3457    }
3458
3459  }
3460
3461  @Override
3462  public Base addChild(String name) throws FHIRException {
3463    if (name.equals("url")) {
3464      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.url");
3465    } else if (name.equals("version")) {
3466      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.version");
3467    } else if (name.equals("name")) {
3468      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.name");
3469    } else if (name.equals("derivedFrom")) {
3470      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.derivedFrom");
3471    } else if (name.equals("status")) {
3472      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.status");
3473    } else if (name.equals("experimental")) {
3474      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.experimental");
3475    } else if (name.equals("date")) {
3476      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.date");
3477    } else if (name.equals("publisher")) {
3478      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.publisher");
3479    } else if (name.equals("contact")) {
3480      return addContact();
3481    } else if (name.equals("description")) {
3482      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.description");
3483    } else if (name.equals("useContext")) {
3484      return addUseContext();
3485    } else if (name.equals("jurisdiction")) {
3486      return addJurisdiction();
3487    } else if (name.equals("purpose")) {
3488      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.purpose");
3489    } else if (name.equals("code")) {
3490      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.code");
3491    } else if (name.equals("base")) {
3492      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.base");
3493    } else if (name.equals("type")) {
3494      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.type");
3495    } else if (name.equals("expression")) {
3496      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.expression");
3497    } else if (name.equals("xpath")) {
3498      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.xpath");
3499    } else if (name.equals("xpathUsage")) {
3500      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.xpathUsage");
3501    } else if (name.equals("target")) {
3502      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.target");
3503    } else if (name.equals("multipleOr")) {
3504      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.multipleOr");
3505    } else if (name.equals("multipleAnd")) {
3506      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.multipleAnd");
3507    } else if (name.equals("comparator")) {
3508      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.comparator");
3509    } else if (name.equals("modifier")) {
3510      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.modifier");
3511    } else if (name.equals("chain")) {
3512      throw new FHIRException("Cannot call addChild on a singleton property SearchParameter.chain");
3513    } else if (name.equals("component")) {
3514      return addComponent();
3515    } else
3516      return super.addChild(name);
3517  }
3518
3519  public String fhirType() {
3520    return "SearchParameter";
3521
3522  }
3523
3524  public SearchParameter copy() {
3525    SearchParameter dst = new SearchParameter();
3526    copyValues(dst);
3527    return dst;
3528  }
3529
3530  public void copyValues(SearchParameter dst) {
3531    super.copyValues(dst);
3532    dst.url = url == null ? null : url.copy();
3533    dst.version = version == null ? null : version.copy();
3534    dst.name = name == null ? null : name.copy();
3535    dst.derivedFrom = derivedFrom == null ? null : derivedFrom.copy();
3536    dst.status = status == null ? null : status.copy();
3537    dst.experimental = experimental == null ? null : experimental.copy();
3538    dst.date = date == null ? null : date.copy();
3539    dst.publisher = publisher == null ? null : publisher.copy();
3540    if (contact != null) {
3541      dst.contact = new ArrayList<ContactDetail>();
3542      for (ContactDetail i : contact)
3543        dst.contact.add(i.copy());
3544    }
3545    ;
3546    dst.description = description == null ? null : description.copy();
3547    if (useContext != null) {
3548      dst.useContext = new ArrayList<UsageContext>();
3549      for (UsageContext i : useContext)
3550        dst.useContext.add(i.copy());
3551    }
3552    ;
3553    if (jurisdiction != null) {
3554      dst.jurisdiction = new ArrayList<CodeableConcept>();
3555      for (CodeableConcept i : jurisdiction)
3556        dst.jurisdiction.add(i.copy());
3557    }
3558    ;
3559    dst.purpose = purpose == null ? null : purpose.copy();
3560    dst.code = code == null ? null : code.copy();
3561    if (base != null) {
3562      dst.base = new ArrayList<CodeType>();
3563      for (CodeType i : base)
3564        dst.base.add(i.copy());
3565    }
3566    ;
3567    dst.type = type == null ? null : type.copy();
3568    dst.expression = expression == null ? null : expression.copy();
3569    dst.xpath = xpath == null ? null : xpath.copy();
3570    dst.xpathUsage = xpathUsage == null ? null : xpathUsage.copy();
3571    if (target != null) {
3572      dst.target = new ArrayList<CodeType>();
3573      for (CodeType i : target)
3574        dst.target.add(i.copy());
3575    }
3576    ;
3577    dst.multipleOr = multipleOr == null ? null : multipleOr.copy();
3578    dst.multipleAnd = multipleAnd == null ? null : multipleAnd.copy();
3579    if (comparator != null) {
3580      dst.comparator = new ArrayList<Enumeration<SearchComparator>>();
3581      for (Enumeration<SearchComparator> i : comparator)
3582        dst.comparator.add(i.copy());
3583    }
3584    ;
3585    if (modifier != null) {
3586      dst.modifier = new ArrayList<Enumeration<SearchModifierCode>>();
3587      for (Enumeration<SearchModifierCode> i : modifier)
3588        dst.modifier.add(i.copy());
3589    }
3590    ;
3591    if (chain != null) {
3592      dst.chain = new ArrayList<StringType>();
3593      for (StringType i : chain)
3594        dst.chain.add(i.copy());
3595    }
3596    ;
3597    if (component != null) {
3598      dst.component = new ArrayList<SearchParameterComponentComponent>();
3599      for (SearchParameterComponentComponent i : component)
3600        dst.component.add(i.copy());
3601    }
3602    ;
3603  }
3604
3605  protected SearchParameter typedCopy() {
3606    return copy();
3607  }
3608
3609  @Override
3610  public boolean equalsDeep(Base other_) {
3611    if (!super.equalsDeep(other_))
3612      return false;
3613    if (!(other_ instanceof SearchParameter))
3614      return false;
3615    SearchParameter o = (SearchParameter) other_;
3616    return compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(purpose, o.purpose, true)
3617        && compareDeep(code, o.code, true) && compareDeep(base, o.base, true) && compareDeep(type, o.type, true)
3618        && compareDeep(expression, o.expression, true) && compareDeep(xpath, o.xpath, true)
3619        && compareDeep(xpathUsage, o.xpathUsage, true) && compareDeep(target, o.target, true)
3620        && compareDeep(multipleOr, o.multipleOr, true) && compareDeep(multipleAnd, o.multipleAnd, true)
3621        && compareDeep(comparator, o.comparator, true) && compareDeep(modifier, o.modifier, true)
3622        && compareDeep(chain, o.chain, true) && compareDeep(component, o.component, true);
3623  }
3624
3625  @Override
3626  public boolean equalsShallow(Base other_) {
3627    if (!super.equalsShallow(other_))
3628      return false;
3629    if (!(other_ instanceof SearchParameter))
3630      return false;
3631    SearchParameter o = (SearchParameter) other_;
3632    return compareValues(purpose, o.purpose, true) && compareValues(code, o.code, true)
3633        && compareValues(base, o.base, true) && compareValues(type, o.type, true)
3634        && compareValues(expression, o.expression, true) && compareValues(xpath, o.xpath, true)
3635        && compareValues(xpathUsage, o.xpathUsage, true) && compareValues(target, o.target, true)
3636        && compareValues(multipleOr, o.multipleOr, true) && compareValues(multipleAnd, o.multipleAnd, true)
3637        && compareValues(comparator, o.comparator, true) && compareValues(modifier, o.modifier, true)
3638        && compareValues(chain, o.chain, true);
3639  }
3640
3641  public boolean isEmpty() {
3642    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(derivedFrom, purpose, code, base, type, expression,
3643        xpath, xpathUsage, target, multipleOr, multipleAnd, comparator, modifier, chain, component);
3644  }
3645
3646  @Override
3647  public ResourceType getResourceType() {
3648    return ResourceType.SearchParameter;
3649  }
3650
3651  /**
3652   * Search parameter: <b>date</b>
3653   * <p>
3654   * Description: <b>The search parameter publication date</b><br>
3655   * Type: <b>date</b><br>
3656   * Path: <b>SearchParameter.date</b><br>
3657   * </p>
3658   */
3659  @SearchParamDefinition(name = "date", path = "SearchParameter.date", description = "The search parameter publication date", type = "date")
3660  public static final String SP_DATE = "date";
3661  /**
3662   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3663   * <p>
3664   * Description: <b>The search parameter publication date</b><br>
3665   * Type: <b>date</b><br>
3666   * Path: <b>SearchParameter.date</b><br>
3667   * </p>
3668   */
3669  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
3670      SP_DATE);
3671
3672  /**
3673   * Search parameter: <b>code</b>
3674   * <p>
3675   * Description: <b>Code used in URL</b><br>
3676   * Type: <b>token</b><br>
3677   * Path: <b>SearchParameter.code</b><br>
3678   * </p>
3679   */
3680  @SearchParamDefinition(name = "code", path = "SearchParameter.code", description = "Code used in URL", type = "token")
3681  public static final String SP_CODE = "code";
3682  /**
3683   * <b>Fluent Client</b> search parameter constant for <b>code</b>
3684   * <p>
3685   * Description: <b>Code used in URL</b><br>
3686   * Type: <b>token</b><br>
3687   * Path: <b>SearchParameter.code</b><br>
3688   * </p>
3689   */
3690  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3691      SP_CODE);
3692
3693  /**
3694   * Search parameter: <b>context-type-value</b>
3695   * <p>
3696   * Description: <b>A use context type and value assigned to the search
3697   * parameter</b><br>
3698   * Type: <b>composite</b><br>
3699   * Path: <b></b><br>
3700   * </p>
3701   */
3702  @SearchParamDefinition(name = "context-type-value", path = "SearchParameter.useContext", description = "A use context type and value assigned to the search parameter", type = "composite", compositeOf = {
3703      "context-type", "context" })
3704  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
3705  /**
3706   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
3707   * <p>
3708   * Description: <b>A use context type and value assigned to the search
3709   * parameter</b><br>
3710   * Type: <b>composite</b><br>
3711   * Path: <b></b><br>
3712   * </p>
3713   */
3714  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(
3715      SP_CONTEXT_TYPE_VALUE);
3716
3717  /**
3718   * Search parameter: <b>jurisdiction</b>
3719   * <p>
3720   * Description: <b>Intended jurisdiction for the search parameter</b><br>
3721   * Type: <b>token</b><br>
3722   * Path: <b>SearchParameter.jurisdiction</b><br>
3723   * </p>
3724   */
3725  @SearchParamDefinition(name = "jurisdiction", path = "SearchParameter.jurisdiction", description = "Intended jurisdiction for the search parameter", type = "token")
3726  public static final String SP_JURISDICTION = "jurisdiction";
3727  /**
3728   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
3729   * <p>
3730   * Description: <b>Intended jurisdiction for the search parameter</b><br>
3731   * Type: <b>token</b><br>
3732   * Path: <b>SearchParameter.jurisdiction</b><br>
3733   * </p>
3734   */
3735  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3736      SP_JURISDICTION);
3737
3738  /**
3739   * Search parameter: <b>description</b>
3740   * <p>
3741   * Description: <b>The description of the search parameter</b><br>
3742   * Type: <b>string</b><br>
3743   * Path: <b>SearchParameter.description</b><br>
3744   * </p>
3745   */
3746  @SearchParamDefinition(name = "description", path = "SearchParameter.description", description = "The description of the search parameter", type = "string")
3747  public static final String SP_DESCRIPTION = "description";
3748  /**
3749   * <b>Fluent Client</b> search parameter constant for <b>description</b>
3750   * <p>
3751   * Description: <b>The description of the search parameter</b><br>
3752   * Type: <b>string</b><br>
3753   * Path: <b>SearchParameter.description</b><br>
3754   * </p>
3755   */
3756  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(
3757      SP_DESCRIPTION);
3758
3759  /**
3760   * Search parameter: <b>derived-from</b>
3761   * <p>
3762   * Description: <b>Original definition for the search parameter</b><br>
3763   * Type: <b>reference</b><br>
3764   * Path: <b>SearchParameter.derivedFrom</b><br>
3765   * </p>
3766   */
3767  @SearchParamDefinition(name = "derived-from", path = "SearchParameter.derivedFrom", description = "Original definition for the search parameter", type = "reference", target = {
3768      SearchParameter.class })
3769  public static final String SP_DERIVED_FROM = "derived-from";
3770  /**
3771   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
3772   * <p>
3773   * Description: <b>Original definition for the search parameter</b><br>
3774   * Type: <b>reference</b><br>
3775   * Path: <b>SearchParameter.derivedFrom</b><br>
3776   * </p>
3777   */
3778  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3779      SP_DERIVED_FROM);
3780
3781  /**
3782   * Constant for fluent queries to be used to add include statements. Specifies
3783   * the path value of "<b>SearchParameter:derived-from</b>".
3784   */
3785  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include(
3786      "SearchParameter:derived-from").toLocked();
3787
3788  /**
3789   * Search parameter: <b>context-type</b>
3790   * <p>
3791   * Description: <b>A type of use context assigned to the search
3792   * parameter</b><br>
3793   * Type: <b>token</b><br>
3794   * Path: <b>SearchParameter.useContext.code</b><br>
3795   * </p>
3796   */
3797  @SearchParamDefinition(name = "context-type", path = "SearchParameter.useContext.code", description = "A type of use context assigned to the search parameter", type = "token")
3798  public static final String SP_CONTEXT_TYPE = "context-type";
3799  /**
3800   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
3801   * <p>
3802   * Description: <b>A type of use context assigned to the search
3803   * parameter</b><br>
3804   * Type: <b>token</b><br>
3805   * Path: <b>SearchParameter.useContext.code</b><br>
3806   * </p>
3807   */
3808  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3809      SP_CONTEXT_TYPE);
3810
3811  /**
3812   * Search parameter: <b>type</b>
3813   * <p>
3814   * Description: <b>number | date | string | token | reference | composite |
3815   * quantity | uri | special</b><br>
3816   * Type: <b>token</b><br>
3817   * Path: <b>SearchParameter.type</b><br>
3818   * </p>
3819   */
3820  @SearchParamDefinition(name = "type", path = "SearchParameter.type", description = "number | date | string | token | reference | composite | quantity | uri | special", type = "token")
3821  public static final String SP_TYPE = "type";
3822  /**
3823   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3824   * <p>
3825   * Description: <b>number | date | string | token | reference | composite |
3826   * quantity | uri | special</b><br>
3827   * Type: <b>token</b><br>
3828   * Path: <b>SearchParameter.type</b><br>
3829   * </p>
3830   */
3831  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3832      SP_TYPE);
3833
3834  /**
3835   * Search parameter: <b>version</b>
3836   * <p>
3837   * Description: <b>The business version of the search parameter</b><br>
3838   * Type: <b>token</b><br>
3839   * Path: <b>SearchParameter.version</b><br>
3840   * </p>
3841   */
3842  @SearchParamDefinition(name = "version", path = "SearchParameter.version", description = "The business version of the search parameter", type = "token")
3843  public static final String SP_VERSION = "version";
3844  /**
3845   * <b>Fluent Client</b> search parameter constant for <b>version</b>
3846   * <p>
3847   * Description: <b>The business version of the search parameter</b><br>
3848   * Type: <b>token</b><br>
3849   * Path: <b>SearchParameter.version</b><br>
3850   * </p>
3851   */
3852  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3853      SP_VERSION);
3854
3855  /**
3856   * Search parameter: <b>url</b>
3857   * <p>
3858   * Description: <b>The uri that identifies the search parameter</b><br>
3859   * Type: <b>uri</b><br>
3860   * Path: <b>SearchParameter.url</b><br>
3861   * </p>
3862   */
3863  @SearchParamDefinition(name = "url", path = "SearchParameter.url", description = "The uri that identifies the search parameter", type = "uri")
3864  public static final String SP_URL = "url";
3865  /**
3866   * <b>Fluent Client</b> search parameter constant for <b>url</b>
3867   * <p>
3868   * Description: <b>The uri that identifies the search parameter</b><br>
3869   * Type: <b>uri</b><br>
3870   * Path: <b>SearchParameter.url</b><br>
3871   * </p>
3872   */
3873  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
3874
3875  /**
3876   * Search parameter: <b>target</b>
3877   * <p>
3878   * Description: <b>Types of resource (if a resource reference)</b><br>
3879   * Type: <b>token</b><br>
3880   * Path: <b>SearchParameter.target</b><br>
3881   * </p>
3882   */
3883  @SearchParamDefinition(name = "target", path = "SearchParameter.target", description = "Types of resource (if a resource reference)", type = "token")
3884  public static final String SP_TARGET = "target";
3885  /**
3886   * <b>Fluent Client</b> search parameter constant for <b>target</b>
3887   * <p>
3888   * Description: <b>Types of resource (if a resource reference)</b><br>
3889   * Type: <b>token</b><br>
3890   * Path: <b>SearchParameter.target</b><br>
3891   * </p>
3892   */
3893  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3894      SP_TARGET);
3895
3896  /**
3897   * Search parameter: <b>context-quantity</b>
3898   * <p>
3899   * Description: <b>A quantity- or range-valued use context assigned to the
3900   * search parameter</b><br>
3901   * Type: <b>quantity</b><br>
3902   * Path: <b>SearchParameter.useContext.valueQuantity,
3903   * SearchParameter.useContext.valueRange</b><br>
3904   * </p>
3905   */
3906  @SearchParamDefinition(name = "context-quantity", path = "(SearchParameter.useContext.value as Quantity) | (SearchParameter.useContext.value as Range)", description = "A quantity- or range-valued use context assigned to the search parameter", type = "quantity")
3907  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
3908  /**
3909   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
3910   * <p>
3911   * Description: <b>A quantity- or range-valued use context assigned to the
3912   * search parameter</b><br>
3913   * Type: <b>quantity</b><br>
3914   * Path: <b>SearchParameter.useContext.valueQuantity,
3915   * SearchParameter.useContext.valueRange</b><br>
3916   * </p>
3917   */
3918  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(
3919      SP_CONTEXT_QUANTITY);
3920
3921  /**
3922   * Search parameter: <b>component</b>
3923   * <p>
3924   * Description: <b>Defines how the part works</b><br>
3925   * Type: <b>reference</b><br>
3926   * Path: <b>SearchParameter.component.definition</b><br>
3927   * </p>
3928   */
3929  @SearchParamDefinition(name = "component", path = "SearchParameter.component.definition", description = "Defines how the part works", type = "reference", target = {
3930      SearchParameter.class })
3931  public static final String SP_COMPONENT = "component";
3932  /**
3933   * <b>Fluent Client</b> search parameter constant for <b>component</b>
3934   * <p>
3935   * Description: <b>Defines how the part works</b><br>
3936   * Type: <b>reference</b><br>
3937   * Path: <b>SearchParameter.component.definition</b><br>
3938   * </p>
3939   */
3940  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPONENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3941      SP_COMPONENT);
3942
3943  /**
3944   * Constant for fluent queries to be used to add include statements. Specifies
3945   * the path value of "<b>SearchParameter:component</b>".
3946   */
3947  public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPONENT = new ca.uhn.fhir.model.api.Include(
3948      "SearchParameter:component").toLocked();
3949
3950  /**
3951   * Search parameter: <b>name</b>
3952   * <p>
3953   * Description: <b>Computationally friendly name of the search parameter</b><br>
3954   * Type: <b>string</b><br>
3955   * Path: <b>SearchParameter.name</b><br>
3956   * </p>
3957   */
3958  @SearchParamDefinition(name = "name", path = "SearchParameter.name", description = "Computationally friendly name of the search parameter", type = "string")
3959  public static final String SP_NAME = "name";
3960  /**
3961   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3962   * <p>
3963   * Description: <b>Computationally friendly name of the search parameter</b><br>
3964   * Type: <b>string</b><br>
3965   * Path: <b>SearchParameter.name</b><br>
3966   * </p>
3967   */
3968  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(
3969      SP_NAME);
3970
3971  /**
3972   * Search parameter: <b>context</b>
3973   * <p>
3974   * Description: <b>A use context assigned to the search parameter</b><br>
3975   * Type: <b>token</b><br>
3976   * Path: <b>SearchParameter.useContext.valueCodeableConcept</b><br>
3977   * </p>
3978   */
3979  @SearchParamDefinition(name = "context", path = "(SearchParameter.useContext.value as CodeableConcept)", description = "A use context assigned to the search parameter", type = "token")
3980  public static final String SP_CONTEXT = "context";
3981  /**
3982   * <b>Fluent Client</b> search parameter constant for <b>context</b>
3983   * <p>
3984   * Description: <b>A use context assigned to the search parameter</b><br>
3985   * Type: <b>token</b><br>
3986   * Path: <b>SearchParameter.useContext.valueCodeableConcept</b><br>
3987   * </p>
3988   */
3989  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3990      SP_CONTEXT);
3991
3992  /**
3993   * Search parameter: <b>publisher</b>
3994   * <p>
3995   * Description: <b>Name of the publisher of the search parameter</b><br>
3996   * Type: <b>string</b><br>
3997   * Path: <b>SearchParameter.publisher</b><br>
3998   * </p>
3999   */
4000  @SearchParamDefinition(name = "publisher", path = "SearchParameter.publisher", description = "Name of the publisher of the search parameter", type = "string")
4001  public static final String SP_PUBLISHER = "publisher";
4002  /**
4003   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
4004   * <p>
4005   * Description: <b>Name of the publisher of the search parameter</b><br>
4006   * Type: <b>string</b><br>
4007   * Path: <b>SearchParameter.publisher</b><br>
4008   * </p>
4009   */
4010  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(
4011      SP_PUBLISHER);
4012
4013  /**
4014   * Search parameter: <b>context-type-quantity</b>
4015   * <p>
4016   * Description: <b>A use context type and quantity- or range-based value
4017   * assigned to the search parameter</b><br>
4018   * Type: <b>composite</b><br>
4019   * Path: <b></b><br>
4020   * </p>
4021   */
4022  @SearchParamDefinition(name = "context-type-quantity", path = "SearchParameter.useContext", description = "A use context type and quantity- or range-based value assigned to the search parameter", type = "composite", compositeOf = {
4023      "context-type", "context-quantity" })
4024  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
4025  /**
4026   * <b>Fluent Client</b> search parameter constant for
4027   * <b>context-type-quantity</b>
4028   * <p>
4029   * Description: <b>A use context type and quantity- or range-based value
4030   * assigned to the search parameter</b><br>
4031   * Type: <b>composite</b><br>
4032   * Path: <b></b><br>
4033   * </p>
4034   */
4035  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(
4036      SP_CONTEXT_TYPE_QUANTITY);
4037
4038  /**
4039   * Search parameter: <b>status</b>
4040   * <p>
4041   * Description: <b>The current status of the search parameter</b><br>
4042   * Type: <b>token</b><br>
4043   * Path: <b>SearchParameter.status</b><br>
4044   * </p>
4045   */
4046  @SearchParamDefinition(name = "status", path = "SearchParameter.status", description = "The current status of the search parameter", type = "token")
4047  public static final String SP_STATUS = "status";
4048  /**
4049   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4050   * <p>
4051   * Description: <b>The current status of the search parameter</b><br>
4052   * Type: <b>token</b><br>
4053   * Path: <b>SearchParameter.status</b><br>
4054   * </p>
4055   */
4056  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4057      SP_STATUS);
4058
4059  /**
4060   * Search parameter: <b>base</b>
4061   * <p>
4062   * Description: <b>The resource type(s) this search parameter applies to</b><br>
4063   * Type: <b>token</b><br>
4064   * Path: <b>SearchParameter.base</b><br>
4065   * </p>
4066   */
4067  @SearchParamDefinition(name = "base", path = "SearchParameter.base", description = "The resource type(s) this search parameter applies to", type = "token")
4068  public static final String SP_BASE = "base";
4069  /**
4070   * <b>Fluent Client</b> search parameter constant for <b>base</b>
4071   * <p>
4072   * Description: <b>The resource type(s) this search parameter applies to</b><br>
4073   * Type: <b>token</b><br>
4074   * Path: <b>SearchParameter.base</b><br>
4075   * </p>
4076   */
4077  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BASE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4078      SP_BASE);
4079
4080}