001package org.hl7.fhir.dstu2.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu2
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057
058import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus;
059import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory;
060import org.hl7.fhir.dstu2.model.Enumerations.SearchParamType;
061import org.hl7.fhir.dstu2.model.Enumerations.SearchParamTypeEnumFactory;
062import ca.uhn.fhir.model.api.annotation.Block;
063import ca.uhn.fhir.model.api.annotation.Child;
064import ca.uhn.fhir.model.api.annotation.Description;
065import ca.uhn.fhir.model.api.annotation.ResourceDef;
066import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
067import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
068import org.hl7.fhir.exceptions.FHIRException;
069import org.hl7.fhir.utilities.Utilities;
070/**
071 * A search parameter that defines a named search item that can be used to search/filter on a resource.
072 */
073@ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter")
074public class SearchParameter extends DomainResource {
075
076    public enum XPathUsageType {
077        /**
078         * The search parameter is derived directly from the selected nodes based on the type definitions.
079         */
080        NORMAL, 
081        /**
082         * The search parameter is derived by a phonetic transform from the selected nodes.
083         */
084        PHONETIC, 
085        /**
086         * The search parameter is based on a spatial transform of the selected nodes.
087         */
088        NEARBY, 
089        /**
090         * The search parameter is based on a spatial transform of the selected nodes, using physical distance from the middle.
091         */
092        DISTANCE, 
093        /**
094         * The interpretation of the xpath statement is unknown (and can't be automated).
095         */
096        OTHER, 
097        /**
098         * added to help the parsers
099         */
100        NULL;
101        public static XPathUsageType fromCode(String codeString) throws FHIRException {
102            if (codeString == null || "".equals(codeString))
103                return null;
104        if ("normal".equals(codeString))
105          return NORMAL;
106        if ("phonetic".equals(codeString))
107          return PHONETIC;
108        if ("nearby".equals(codeString))
109          return NEARBY;
110        if ("distance".equals(codeString))
111          return DISTANCE;
112        if ("other".equals(codeString))
113          return OTHER;
114        throw new FHIRException("Unknown XPathUsageType code '"+codeString+"'");
115        }
116        public String toCode() {
117          switch (this) {
118            case NORMAL: return "normal";
119            case PHONETIC: return "phonetic";
120            case NEARBY: return "nearby";
121            case DISTANCE: return "distance";
122            case OTHER: return "other";
123            default: return "?";
124          }
125        }
126        public String getSystem() {
127          switch (this) {
128            case NORMAL: return "http://hl7.org/fhir/search-xpath-usage";
129            case PHONETIC: return "http://hl7.org/fhir/search-xpath-usage";
130            case NEARBY: return "http://hl7.org/fhir/search-xpath-usage";
131            case DISTANCE: return "http://hl7.org/fhir/search-xpath-usage";
132            case OTHER: return "http://hl7.org/fhir/search-xpath-usage";
133            default: return "?";
134          }
135        }
136        public String getDefinition() {
137          switch (this) {
138            case NORMAL: return "The search parameter is derived directly from the selected nodes based on the type definitions.";
139            case PHONETIC: return "The search parameter is derived by a phonetic transform from the selected nodes.";
140            case NEARBY: return "The search parameter is based on a spatial transform of the selected nodes.";
141            case DISTANCE: return "The search parameter is based on a spatial transform of the selected nodes, using physical distance from the middle.";
142            case OTHER: return "The interpretation of the xpath statement is unknown (and can't be automated).";
143            default: return "?";
144          }
145        }
146        public String getDisplay() {
147          switch (this) {
148            case NORMAL: return "Normal";
149            case PHONETIC: return "Phonetic";
150            case NEARBY: return "Nearby";
151            case DISTANCE: return "Distance";
152            case OTHER: return "Other";
153            default: return "?";
154          }
155        }
156    }
157
158  public static class XPathUsageTypeEnumFactory implements EnumFactory<XPathUsageType> {
159    public XPathUsageType fromCode(String codeString) throws IllegalArgumentException {
160      if (codeString == null || "".equals(codeString))
161            if (codeString == null || "".equals(codeString))
162                return null;
163        if ("normal".equals(codeString))
164          return XPathUsageType.NORMAL;
165        if ("phonetic".equals(codeString))
166          return XPathUsageType.PHONETIC;
167        if ("nearby".equals(codeString))
168          return XPathUsageType.NEARBY;
169        if ("distance".equals(codeString))
170          return XPathUsageType.DISTANCE;
171        if ("other".equals(codeString))
172          return XPathUsageType.OTHER;
173        throw new IllegalArgumentException("Unknown XPathUsageType code '"+codeString+"'");
174        }
175        public Enumeration<XPathUsageType> fromType(Base code) throws FHIRException {
176          if (code == null || code.isEmpty())
177            return null;
178          String codeString = ((PrimitiveType) code).asStringValue();
179          if (codeString == null || "".equals(codeString))
180            return null;
181        if ("normal".equals(codeString))
182          return new Enumeration<XPathUsageType>(this, XPathUsageType.NORMAL);
183        if ("phonetic".equals(codeString))
184          return new Enumeration<XPathUsageType>(this, XPathUsageType.PHONETIC);
185        if ("nearby".equals(codeString))
186          return new Enumeration<XPathUsageType>(this, XPathUsageType.NEARBY);
187        if ("distance".equals(codeString))
188          return new Enumeration<XPathUsageType>(this, XPathUsageType.DISTANCE);
189        if ("other".equals(codeString))
190          return new Enumeration<XPathUsageType>(this, XPathUsageType.OTHER);
191        throw new FHIRException("Unknown XPathUsageType code '"+codeString+"'");
192        }
193    public String toCode(XPathUsageType code) {
194      if (code == XPathUsageType.NORMAL)
195        return "normal";
196      if (code == XPathUsageType.PHONETIC)
197        return "phonetic";
198      if (code == XPathUsageType.NEARBY)
199        return "nearby";
200      if (code == XPathUsageType.DISTANCE)
201        return "distance";
202      if (code == XPathUsageType.OTHER)
203        return "other";
204      return "?";
205      }
206    }
207
208    @Block()
209    public static class SearchParameterContactComponent extends BackboneElement implements IBaseBackboneElement {
210        /**
211         * The name of an individual to contact regarding the search parameter.
212         */
213        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
214        @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the search parameter." )
215        protected StringType name;
216
217        /**
218         * Contact details for individual (if a name was provided) or the publisher.
219         */
220        @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
221        @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." )
222        protected List<ContactPoint> telecom;
223
224        private static final long serialVersionUID = -1179697803L;
225
226    /*
227     * Constructor
228     */
229      public SearchParameterContactComponent() {
230        super();
231      }
232
233        /**
234         * @return {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
235         */
236        public StringType getNameElement() { 
237          if (this.name == null)
238            if (Configuration.errorOnAutoCreate())
239              throw new Error("Attempt to auto-create SearchParameterContactComponent.name");
240            else if (Configuration.doAutoCreate())
241              this.name = new StringType(); // bb
242          return this.name;
243        }
244
245        public boolean hasNameElement() { 
246          return this.name != null && !this.name.isEmpty();
247        }
248
249        public boolean hasName() { 
250          return this.name != null && !this.name.isEmpty();
251        }
252
253        /**
254         * @param value {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
255         */
256        public SearchParameterContactComponent setNameElement(StringType value) { 
257          this.name = value;
258          return this;
259        }
260
261        /**
262         * @return The name of an individual to contact regarding the search parameter.
263         */
264        public String getName() { 
265          return this.name == null ? null : this.name.getValue();
266        }
267
268        /**
269         * @param value The name of an individual to contact regarding the search parameter.
270         */
271        public SearchParameterContactComponent setName(String value) { 
272          if (Utilities.noString(value))
273            this.name = null;
274          else {
275            if (this.name == null)
276              this.name = new StringType();
277            this.name.setValue(value);
278          }
279          return this;
280        }
281
282        /**
283         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
284         */
285        public List<ContactPoint> getTelecom() { 
286          if (this.telecom == null)
287            this.telecom = new ArrayList<ContactPoint>();
288          return this.telecom;
289        }
290
291        public boolean hasTelecom() { 
292          if (this.telecom == null)
293            return false;
294          for (ContactPoint item : this.telecom)
295            if (!item.isEmpty())
296              return true;
297          return false;
298        }
299
300        /**
301         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
302         */
303    // syntactic sugar
304        public ContactPoint addTelecom() { //3
305          ContactPoint t = new ContactPoint();
306          if (this.telecom == null)
307            this.telecom = new ArrayList<ContactPoint>();
308          this.telecom.add(t);
309          return t;
310        }
311
312    // syntactic sugar
313        public SearchParameterContactComponent addTelecom(ContactPoint t) { //3
314          if (t == null)
315            return this;
316          if (this.telecom == null)
317            this.telecom = new ArrayList<ContactPoint>();
318          this.telecom.add(t);
319          return this;
320        }
321
322        protected void listChildren(List<Property> childrenList) {
323          super.listChildren(childrenList);
324          childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the search parameter.", 0, java.lang.Integer.MAX_VALUE, name));
325          childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom));
326        }
327
328      @Override
329      public void setProperty(String name, Base value) throws FHIRException {
330        if (name.equals("name"))
331          this.name = castToString(value); // StringType
332        else if (name.equals("telecom"))
333          this.getTelecom().add(castToContactPoint(value));
334        else
335          super.setProperty(name, value);
336      }
337
338      @Override
339      public Base addChild(String name) throws FHIRException {
340        if (name.equals("name")) {
341          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.name");
342        }
343        else if (name.equals("telecom")) {
344          return addTelecom();
345        }
346        else
347          return super.addChild(name);
348      }
349
350      public SearchParameterContactComponent copy() {
351        SearchParameterContactComponent dst = new SearchParameterContactComponent();
352        copyValues(dst);
353        dst.name = name == null ? null : name.copy();
354        if (telecom != null) {
355          dst.telecom = new ArrayList<ContactPoint>();
356          for (ContactPoint i : telecom)
357            dst.telecom.add(i.copy());
358        };
359        return dst;
360      }
361
362      @Override
363      public boolean equalsDeep(Base other) {
364        if (!super.equalsDeep(other))
365          return false;
366        if (!(other instanceof SearchParameterContactComponent))
367          return false;
368        SearchParameterContactComponent o = (SearchParameterContactComponent) other;
369        return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true);
370      }
371
372      @Override
373      public boolean equalsShallow(Base other) {
374        if (!super.equalsShallow(other))
375          return false;
376        if (!(other instanceof SearchParameterContactComponent))
377          return false;
378        SearchParameterContactComponent o = (SearchParameterContactComponent) other;
379        return compareValues(name, o.name, true);
380      }
381
382      public boolean isEmpty() {
383        return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty())
384          ;
385      }
386
387  public String fhirType() {
388    return "SearchParameter.contact";
389
390  }
391
392  }
393
394    /**
395     * An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.
396     */
397    @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true)
398    @Description(shortDefinition="Absolute URL used to reference this search parameter", formalDefinition="An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published." )
399    protected UriType url;
400
401    /**
402     * A free text natural language name identifying the search parameter.
403     */
404    @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
405    @Description(shortDefinition="Informal name for this search parameter", formalDefinition="A free text natural language name identifying the search parameter." )
406    protected StringType name;
407
408    /**
409     * The status of this search parameter definition.
410     */
411    @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true)
412    @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this search parameter definition." )
413    protected Enumeration<ConformanceResourceStatus> status;
414
415    /**
416     * A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
417     */
418    @Child(name = "experimental", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
419    @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." )
420    protected BooleanType experimental;
421
422    /**
423     * The name of the individual or organization that published the search parameter.
424     */
425    @Child(name = "publisher", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
426    @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the search parameter." )
427    protected StringType publisher;
428
429    /**
430     * Contacts to assist a user in finding and communicating with the publisher.
431     */
432    @Child(name = "contact", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
433    @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." )
434    protected List<SearchParameterContactComponent> contact;
435
436    /**
437     * The date  (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.
438     */
439    @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
440    @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date  (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes." )
441    protected DateTimeType date;
442
443    /**
444     * The Scope and Usage that this search parameter was created to meet.
445     */
446    @Child(name = "requirements", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
447    @Description(shortDefinition="Why this search parameter is defined", formalDefinition="The Scope and Usage that this search parameter was created to meet." )
448    protected StringType requirements;
449
450    /**
451     * The code used in the URL or the parameter name in a parameters resource for this search parameter.
452     */
453    @Child(name = "code", type = {CodeType.class}, order=8, min=1, max=1, modifier=false, summary=true)
454    @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." )
455    protected CodeType code;
456
457    /**
458     * The base resource type that this search parameter refers to.
459     */
460    @Child(name = "base", type = {CodeType.class}, order=9, min=1, max=1, modifier=false, summary=true)
461    @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." )
462    protected CodeType base;
463
464    /**
465     * The type of value a search parameter refers to, and how the content is interpreted.
466     */
467    @Child(name = "type", type = {CodeType.class}, order=10, min=1, max=1, modifier=false, summary=true)
468    @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." )
469    protected Enumeration<SearchParamType> type;
470
471    /**
472     * A description of the search parameters and how it used.
473     */
474    @Child(name = "description", type = {StringType.class}, order=11, min=1, max=1, modifier=false, summary=true)
475    @Description(shortDefinition="Documentation for  search parameter", formalDefinition="A description of the search parameters and how it used." )
476    protected StringType description;
477
478    /**
479     * An XPath expression that returns a set of elements for the search parameter.
480     */
481    @Child(name = "xpath", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
482    @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." )
483    protected StringType xpath;
484
485    /**
486     * How the search parameter relates to the set of elements returned by evaluating the xpath query.
487     */
488    @Child(name = "xpathUsage", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=false)
489    @Description(shortDefinition="normal | phonetic | nearby | distance | other", formalDefinition="How the search parameter relates to the set of elements returned by evaluating the xpath query." )
490    protected Enumeration<XPathUsageType> xpathUsage;
491
492    /**
493     * Types of resource (if a resource is referenced).
494     */
495    @Child(name = "target", type = {CodeType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
496    @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." )
497    protected List<CodeType> target;
498
499    private static final long serialVersionUID = -742596414L;
500
501  /*
502   * Constructor
503   */
504    public SearchParameter() {
505      super();
506    }
507
508  /*
509   * Constructor
510   */
511    public SearchParameter(UriType url, StringType name, CodeType code, CodeType base, Enumeration<SearchParamType> type, StringType description) {
512      super();
513      this.url = url;
514      this.name = name;
515      this.code = code;
516      this.base = base;
517      this.type = type;
518      this.description = description;
519    }
520
521    /**
522     * @return {@link #url} (An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
523     */
524    public UriType getUrlElement() { 
525      if (this.url == null)
526        if (Configuration.errorOnAutoCreate())
527          throw new Error("Attempt to auto-create SearchParameter.url");
528        else if (Configuration.doAutoCreate())
529          this.url = new UriType(); // bb
530      return this.url;
531    }
532
533    public boolean hasUrlElement() { 
534      return this.url != null && !this.url.isEmpty();
535    }
536
537    public boolean hasUrl() { 
538      return this.url != null && !this.url.isEmpty();
539    }
540
541    /**
542     * @param value {@link #url} (An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
543     */
544    public SearchParameter setUrlElement(UriType value) { 
545      this.url = value;
546      return this;
547    }
548
549    /**
550     * @return An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.
551     */
552    public String getUrl() { 
553      return this.url == null ? null : this.url.getValue();
554    }
555
556    /**
557     * @param value An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.
558     */
559    public SearchParameter setUrl(String value) { 
560        if (this.url == null)
561          this.url = new UriType();
562        this.url.setValue(value);
563      return this;
564    }
565
566    /**
567     * @return {@link #name} (A free text natural language name identifying the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
568     */
569    public StringType getNameElement() { 
570      if (this.name == null)
571        if (Configuration.errorOnAutoCreate())
572          throw new Error("Attempt to auto-create SearchParameter.name");
573        else if (Configuration.doAutoCreate())
574          this.name = new StringType(); // bb
575      return this.name;
576    }
577
578    public boolean hasNameElement() { 
579      return this.name != null && !this.name.isEmpty();
580    }
581
582    public boolean hasName() { 
583      return this.name != null && !this.name.isEmpty();
584    }
585
586    /**
587     * @param value {@link #name} (A free text natural language name identifying the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
588     */
589    public SearchParameter setNameElement(StringType value) { 
590      this.name = value;
591      return this;
592    }
593
594    /**
595     * @return A free text natural language name identifying the search parameter.
596     */
597    public String getName() { 
598      return this.name == null ? null : this.name.getValue();
599    }
600
601    /**
602     * @param value A free text natural language name identifying the search parameter.
603     */
604    public SearchParameter setName(String value) { 
605        if (this.name == null)
606          this.name = new StringType();
607        this.name.setValue(value);
608      return this;
609    }
610
611    /**
612     * @return {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
613     */
614    public Enumeration<ConformanceResourceStatus> getStatusElement() { 
615      if (this.status == null)
616        if (Configuration.errorOnAutoCreate())
617          throw new Error("Attempt to auto-create SearchParameter.status");
618        else if (Configuration.doAutoCreate())
619          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory()); // bb
620      return this.status;
621    }
622
623    public boolean hasStatusElement() { 
624      return this.status != null && !this.status.isEmpty();
625    }
626
627    public boolean hasStatus() { 
628      return this.status != null && !this.status.isEmpty();
629    }
630
631    /**
632     * @param value {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
633     */
634    public SearchParameter setStatusElement(Enumeration<ConformanceResourceStatus> value) { 
635      this.status = value;
636      return this;
637    }
638
639    /**
640     * @return The status of this search parameter definition.
641     */
642    public ConformanceResourceStatus getStatus() { 
643      return this.status == null ? null : this.status.getValue();
644    }
645
646    /**
647     * @param value The status of this search parameter definition.
648     */
649    public SearchParameter setStatus(ConformanceResourceStatus value) { 
650      if (value == null)
651        this.status = null;
652      else {
653        if (this.status == null)
654          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory());
655        this.status.setValue(value);
656      }
657      return this;
658    }
659
660    /**
661     * @return {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
662     */
663    public BooleanType getExperimentalElement() { 
664      if (this.experimental == null)
665        if (Configuration.errorOnAutoCreate())
666          throw new Error("Attempt to auto-create SearchParameter.experimental");
667        else if (Configuration.doAutoCreate())
668          this.experimental = new BooleanType(); // bb
669      return this.experimental;
670    }
671
672    public boolean hasExperimentalElement() { 
673      return this.experimental != null && !this.experimental.isEmpty();
674    }
675
676    public boolean hasExperimental() { 
677      return this.experimental != null && !this.experimental.isEmpty();
678    }
679
680    /**
681     * @param value {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
682     */
683    public SearchParameter setExperimentalElement(BooleanType value) { 
684      this.experimental = value;
685      return this;
686    }
687
688    /**
689     * @return A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
690     */
691    public boolean getExperimental() { 
692      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
693    }
694
695    /**
696     * @param value A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
697     */
698    public SearchParameter setExperimental(boolean value) { 
699        if (this.experimental == null)
700          this.experimental = new BooleanType();
701        this.experimental.setValue(value);
702      return this;
703    }
704
705    /**
706     * @return {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
707     */
708    public StringType getPublisherElement() { 
709      if (this.publisher == null)
710        if (Configuration.errorOnAutoCreate())
711          throw new Error("Attempt to auto-create SearchParameter.publisher");
712        else if (Configuration.doAutoCreate())
713          this.publisher = new StringType(); // bb
714      return this.publisher;
715    }
716
717    public boolean hasPublisherElement() { 
718      return this.publisher != null && !this.publisher.isEmpty();
719    }
720
721    public boolean hasPublisher() { 
722      return this.publisher != null && !this.publisher.isEmpty();
723    }
724
725    /**
726     * @param value {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
727     */
728    public SearchParameter setPublisherElement(StringType value) { 
729      this.publisher = value;
730      return this;
731    }
732
733    /**
734     * @return The name of the individual or organization that published the search parameter.
735     */
736    public String getPublisher() { 
737      return this.publisher == null ? null : this.publisher.getValue();
738    }
739
740    /**
741     * @param value The name of the individual or organization that published the search parameter.
742     */
743    public SearchParameter setPublisher(String value) { 
744      if (Utilities.noString(value))
745        this.publisher = null;
746      else {
747        if (this.publisher == null)
748          this.publisher = new StringType();
749        this.publisher.setValue(value);
750      }
751      return this;
752    }
753
754    /**
755     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
756     */
757    public List<SearchParameterContactComponent> getContact() { 
758      if (this.contact == null)
759        this.contact = new ArrayList<SearchParameterContactComponent>();
760      return this.contact;
761    }
762
763    public boolean hasContact() { 
764      if (this.contact == null)
765        return false;
766      for (SearchParameterContactComponent item : this.contact)
767        if (!item.isEmpty())
768          return true;
769      return false;
770    }
771
772    /**
773     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
774     */
775    // syntactic sugar
776    public SearchParameterContactComponent addContact() { //3
777      SearchParameterContactComponent t = new SearchParameterContactComponent();
778      if (this.contact == null)
779        this.contact = new ArrayList<SearchParameterContactComponent>();
780      this.contact.add(t);
781      return t;
782    }
783
784    // syntactic sugar
785    public SearchParameter addContact(SearchParameterContactComponent t) { //3
786      if (t == null)
787        return this;
788      if (this.contact == null)
789        this.contact = new ArrayList<SearchParameterContactComponent>();
790      this.contact.add(t);
791      return this;
792    }
793
794    /**
795     * @return {@link #date} (The date  (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
796     */
797    public DateTimeType getDateElement() { 
798      if (this.date == null)
799        if (Configuration.errorOnAutoCreate())
800          throw new Error("Attempt to auto-create SearchParameter.date");
801        else if (Configuration.doAutoCreate())
802          this.date = new DateTimeType(); // bb
803      return this.date;
804    }
805
806    public boolean hasDateElement() { 
807      return this.date != null && !this.date.isEmpty();
808    }
809
810    public boolean hasDate() { 
811      return this.date != null && !this.date.isEmpty();
812    }
813
814    /**
815     * @param value {@link #date} (The date  (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
816     */
817    public SearchParameter setDateElement(DateTimeType value) { 
818      this.date = value;
819      return this;
820    }
821
822    /**
823     * @return The date  (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.
824     */
825    public Date getDate() { 
826      return this.date == null ? null : this.date.getValue();
827    }
828
829    /**
830     * @param value The date  (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.
831     */
832    public SearchParameter setDate(Date value) { 
833      if (value == null)
834        this.date = null;
835      else {
836        if (this.date == null)
837          this.date = new DateTimeType();
838        this.date.setValue(value);
839      }
840      return this;
841    }
842
843    /**
844     * @return {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
845     */
846    public StringType getRequirementsElement() { 
847      if (this.requirements == null)
848        if (Configuration.errorOnAutoCreate())
849          throw new Error("Attempt to auto-create SearchParameter.requirements");
850        else if (Configuration.doAutoCreate())
851          this.requirements = new StringType(); // bb
852      return this.requirements;
853    }
854
855    public boolean hasRequirementsElement() { 
856      return this.requirements != null && !this.requirements.isEmpty();
857    }
858
859    public boolean hasRequirements() { 
860      return this.requirements != null && !this.requirements.isEmpty();
861    }
862
863    /**
864     * @param value {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
865     */
866    public SearchParameter setRequirementsElement(StringType value) { 
867      this.requirements = value;
868      return this;
869    }
870
871    /**
872     * @return The Scope and Usage that this search parameter was created to meet.
873     */
874    public String getRequirements() { 
875      return this.requirements == null ? null : this.requirements.getValue();
876    }
877
878    /**
879     * @param value The Scope and Usage that this search parameter was created to meet.
880     */
881    public SearchParameter setRequirements(String value) { 
882      if (Utilities.noString(value))
883        this.requirements = null;
884      else {
885        if (this.requirements == null)
886          this.requirements = new StringType();
887        this.requirements.setValue(value);
888      }
889      return this;
890    }
891
892    /**
893     * @return {@link #code} (The code used in the URL or the parameter name in a parameters resource for this search parameter.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
894     */
895    public CodeType getCodeElement() { 
896      if (this.code == null)
897        if (Configuration.errorOnAutoCreate())
898          throw new Error("Attempt to auto-create SearchParameter.code");
899        else if (Configuration.doAutoCreate())
900          this.code = new CodeType(); // bb
901      return this.code;
902    }
903
904    public boolean hasCodeElement() { 
905      return this.code != null && !this.code.isEmpty();
906    }
907
908    public boolean hasCode() { 
909      return this.code != null && !this.code.isEmpty();
910    }
911
912    /**
913     * @param value {@link #code} (The code used in the URL or the parameter name in a parameters resource for this search parameter.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
914     */
915    public SearchParameter setCodeElement(CodeType value) { 
916      this.code = value;
917      return this;
918    }
919
920    /**
921     * @return The code used in the URL or the parameter name in a parameters resource for this search parameter.
922     */
923    public String getCode() { 
924      return this.code == null ? null : this.code.getValue();
925    }
926
927    /**
928     * @param value The code used in the URL or the parameter name in a parameters resource for this search parameter.
929     */
930    public SearchParameter setCode(String value) { 
931        if (this.code == null)
932          this.code = new CodeType();
933        this.code.setValue(value);
934      return this;
935    }
936
937    /**
938     * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value
939     */
940    public CodeType getBaseElement() { 
941      if (this.base == null)
942        if (Configuration.errorOnAutoCreate())
943          throw new Error("Attempt to auto-create SearchParameter.base");
944        else if (Configuration.doAutoCreate())
945          this.base = new CodeType(); // bb
946      return this.base;
947    }
948
949    public boolean hasBaseElement() { 
950      return this.base != null && !this.base.isEmpty();
951    }
952
953    public boolean hasBase() { 
954      return this.base != null && !this.base.isEmpty();
955    }
956
957    /**
958     * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value
959     */
960    public SearchParameter setBaseElement(CodeType value) { 
961      this.base = value;
962      return this;
963    }
964
965    /**
966     * @return The base resource type that this search parameter refers to.
967     */
968    public String getBase() { 
969      return this.base == null ? null : this.base.getValue();
970    }
971
972    /**
973     * @param value The base resource type that this search parameter refers to.
974     */
975    public SearchParameter setBase(String value) { 
976        if (this.base == null)
977          this.base = new CodeType();
978        this.base.setValue(value);
979      return this;
980    }
981
982    /**
983     * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
984     */
985    public Enumeration<SearchParamType> getTypeElement() { 
986      if (this.type == null)
987        if (Configuration.errorOnAutoCreate())
988          throw new Error("Attempt to auto-create SearchParameter.type");
989        else if (Configuration.doAutoCreate())
990          this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory()); // bb
991      return this.type;
992    }
993
994    public boolean hasTypeElement() { 
995      return this.type != null && !this.type.isEmpty();
996    }
997
998    public boolean hasType() { 
999      return this.type != null && !this.type.isEmpty();
1000    }
1001
1002    /**
1003     * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1004     */
1005    public SearchParameter setTypeElement(Enumeration<SearchParamType> value) { 
1006      this.type = value;
1007      return this;
1008    }
1009
1010    /**
1011     * @return The type of value a search parameter refers to, and how the content is interpreted.
1012     */
1013    public SearchParamType getType() { 
1014      return this.type == null ? null : this.type.getValue();
1015    }
1016
1017    /**
1018     * @param value The type of value a search parameter refers to, and how the content is interpreted.
1019     */
1020    public SearchParameter setType(SearchParamType value) { 
1021        if (this.type == null)
1022          this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory());
1023        this.type.setValue(value);
1024      return this;
1025    }
1026
1027    /**
1028     * @return {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1029     */
1030    public StringType getDescriptionElement() { 
1031      if (this.description == null)
1032        if (Configuration.errorOnAutoCreate())
1033          throw new Error("Attempt to auto-create SearchParameter.description");
1034        else if (Configuration.doAutoCreate())
1035          this.description = new StringType(); // bb
1036      return this.description;
1037    }
1038
1039    public boolean hasDescriptionElement() { 
1040      return this.description != null && !this.description.isEmpty();
1041    }
1042
1043    public boolean hasDescription() { 
1044      return this.description != null && !this.description.isEmpty();
1045    }
1046
1047    /**
1048     * @param value {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1049     */
1050    public SearchParameter setDescriptionElement(StringType value) { 
1051      this.description = value;
1052      return this;
1053    }
1054
1055    /**
1056     * @return A description of the search parameters and how it used.
1057     */
1058    public String getDescription() { 
1059      return this.description == null ? null : this.description.getValue();
1060    }
1061
1062    /**
1063     * @param value A description of the search parameters and how it used.
1064     */
1065    public SearchParameter setDescription(String value) { 
1066        if (this.description == null)
1067          this.description = new StringType();
1068        this.description.setValue(value);
1069      return this;
1070    }
1071
1072    /**
1073     * @return {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value
1074     */
1075    public StringType getXpathElement() { 
1076      if (this.xpath == null)
1077        if (Configuration.errorOnAutoCreate())
1078          throw new Error("Attempt to auto-create SearchParameter.xpath");
1079        else if (Configuration.doAutoCreate())
1080          this.xpath = new StringType(); // bb
1081      return this.xpath;
1082    }
1083
1084    public boolean hasXpathElement() { 
1085      return this.xpath != null && !this.xpath.isEmpty();
1086    }
1087
1088    public boolean hasXpath() { 
1089      return this.xpath != null && !this.xpath.isEmpty();
1090    }
1091
1092    /**
1093     * @param value {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value
1094     */
1095    public SearchParameter setXpathElement(StringType value) { 
1096      this.xpath = value;
1097      return this;
1098    }
1099
1100    /**
1101     * @return An XPath expression that returns a set of elements for the search parameter.
1102     */
1103    public String getXpath() { 
1104      return this.xpath == null ? null : this.xpath.getValue();
1105    }
1106
1107    /**
1108     * @param value An XPath expression that returns a set of elements for the search parameter.
1109     */
1110    public SearchParameter setXpath(String value) { 
1111      if (Utilities.noString(value))
1112        this.xpath = null;
1113      else {
1114        if (this.xpath == null)
1115          this.xpath = new StringType();
1116        this.xpath.setValue(value);
1117      }
1118      return this;
1119    }
1120
1121    /**
1122     * @return {@link #xpathUsage} (How the search parameter relates to the set of elements returned by evaluating the xpath query.). This is the underlying object with id, value and extensions. The accessor "getXpathUsage" gives direct access to the value
1123     */
1124    public Enumeration<XPathUsageType> getXpathUsageElement() { 
1125      if (this.xpathUsage == null)
1126        if (Configuration.errorOnAutoCreate())
1127          throw new Error("Attempt to auto-create SearchParameter.xpathUsage");
1128        else if (Configuration.doAutoCreate())
1129          this.xpathUsage = new Enumeration<XPathUsageType>(new XPathUsageTypeEnumFactory()); // bb
1130      return this.xpathUsage;
1131    }
1132
1133    public boolean hasXpathUsageElement() { 
1134      return this.xpathUsage != null && !this.xpathUsage.isEmpty();
1135    }
1136
1137    public boolean hasXpathUsage() { 
1138      return this.xpathUsage != null && !this.xpathUsage.isEmpty();
1139    }
1140
1141    /**
1142     * @param value {@link #xpathUsage} (How the search parameter relates to the set of elements returned by evaluating the xpath query.). This is the underlying object with id, value and extensions. The accessor "getXpathUsage" gives direct access to the value
1143     */
1144    public SearchParameter setXpathUsageElement(Enumeration<XPathUsageType> value) { 
1145      this.xpathUsage = value;
1146      return this;
1147    }
1148
1149    /**
1150     * @return How the search parameter relates to the set of elements returned by evaluating the xpath query.
1151     */
1152    public XPathUsageType getXpathUsage() { 
1153      return this.xpathUsage == null ? null : this.xpathUsage.getValue();
1154    }
1155
1156    /**
1157     * @param value How the search parameter relates to the set of elements returned by evaluating the xpath query.
1158     */
1159    public SearchParameter setXpathUsage(XPathUsageType value) { 
1160      if (value == null)
1161        this.xpathUsage = null;
1162      else {
1163        if (this.xpathUsage == null)
1164          this.xpathUsage = new Enumeration<XPathUsageType>(new XPathUsageTypeEnumFactory());
1165        this.xpathUsage.setValue(value);
1166      }
1167      return this;
1168    }
1169
1170    /**
1171     * @return {@link #target} (Types of resource (if a resource is referenced).)
1172     */
1173    public List<CodeType> getTarget() { 
1174      if (this.target == null)
1175        this.target = new ArrayList<CodeType>();
1176      return this.target;
1177    }
1178
1179    public boolean hasTarget() { 
1180      if (this.target == null)
1181        return false;
1182      for (CodeType item : this.target)
1183        if (!item.isEmpty())
1184          return true;
1185      return false;
1186    }
1187
1188    /**
1189     * @return {@link #target} (Types of resource (if a resource is referenced).)
1190     */
1191    // syntactic sugar
1192    public CodeType addTargetElement() {//2 
1193      CodeType t = new CodeType();
1194      if (this.target == null)
1195        this.target = new ArrayList<CodeType>();
1196      this.target.add(t);
1197      return t;
1198    }
1199
1200    /**
1201     * @param value {@link #target} (Types of resource (if a resource is referenced).)
1202     */
1203    public SearchParameter addTarget(String value) { //1
1204      CodeType t = new CodeType();
1205      t.setValue(value);
1206      if (this.target == null)
1207        this.target = new ArrayList<CodeType>();
1208      this.target.add(t);
1209      return this;
1210    }
1211
1212    /**
1213     * @param value {@link #target} (Types of resource (if a resource is referenced).)
1214     */
1215    public boolean hasTarget(String value) { 
1216      if (this.target == null)
1217        return false;
1218      for (CodeType v : this.target)
1219        if (v.equals(value)) // code
1220          return true;
1221      return false;
1222    }
1223
1224      protected void listChildren(List<Property> childrenList) {
1225        super.listChildren(childrenList);
1226        childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url));
1227        childrenList.add(new Property("name", "string", "A free text natural language name identifying the search parameter.", 0, java.lang.Integer.MAX_VALUE, name));
1228        childrenList.add(new Property("status", "code", "The status of this search parameter definition.", 0, java.lang.Integer.MAX_VALUE, status));
1229        childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental));
1230        childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the search parameter.", 0, java.lang.Integer.MAX_VALUE, publisher));
1231        childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
1232        childrenList.add(new Property("date", "dateTime", "The date  (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.", 0, java.lang.Integer.MAX_VALUE, date));
1233        childrenList.add(new Property("requirements", "string", "The Scope and Usage that this search parameter was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements));
1234        childrenList.add(new Property("code", "code", "The code used in the URL or the parameter name in a parameters resource for this search parameter.", 0, java.lang.Integer.MAX_VALUE, code));
1235        childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base));
1236        childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type));
1237        childrenList.add(new Property("description", "string", "A description of the search parameters and how it used.", 0, java.lang.Integer.MAX_VALUE, description));
1238        childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath));
1239        childrenList.add(new Property("xpathUsage", "code", "How the search parameter relates to the set of elements returned by evaluating the xpath query.", 0, java.lang.Integer.MAX_VALUE, xpathUsage));
1240        childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target));
1241      }
1242
1243      @Override
1244      public void setProperty(String name, Base value) throws FHIRException {
1245        if (name.equals("url"))
1246          this.url = castToUri(value); // UriType
1247        else if (name.equals("name"))
1248          this.name = castToString(value); // StringType
1249        else if (name.equals("status"))
1250          this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration<ConformanceResourceStatus>
1251        else if (name.equals("experimental"))
1252          this.experimental = castToBoolean(value); // BooleanType
1253        else if (name.equals("publisher"))
1254          this.publisher = castToString(value); // StringType
1255        else if (name.equals("contact"))
1256          this.getContact().add((SearchParameterContactComponent) value);
1257        else if (name.equals("date"))
1258          this.date = castToDateTime(value); // DateTimeType
1259        else if (name.equals("requirements"))
1260          this.requirements = castToString(value); // StringType
1261        else if (name.equals("code"))
1262          this.code = castToCode(value); // CodeType
1263        else if (name.equals("base"))
1264          this.base = castToCode(value); // CodeType
1265        else if (name.equals("type"))
1266          this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration<SearchParamType>
1267        else if (name.equals("description"))
1268          this.description = castToString(value); // StringType
1269        else if (name.equals("xpath"))
1270          this.xpath = castToString(value); // StringType
1271        else if (name.equals("xpathUsage"))
1272          this.xpathUsage = new XPathUsageTypeEnumFactory().fromType(value); // Enumeration<XPathUsageType>
1273        else if (name.equals("target"))
1274          this.getTarget().add(castToCode(value));
1275        else
1276          super.setProperty(name, value);
1277      }
1278
1279      @Override
1280      public Base addChild(String name) throws FHIRException {
1281        if (name.equals("url")) {
1282          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.url");
1283        }
1284        else if (name.equals("name")) {
1285          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.name");
1286        }
1287        else if (name.equals("status")) {
1288          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.status");
1289        }
1290        else if (name.equals("experimental")) {
1291          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.experimental");
1292        }
1293        else if (name.equals("publisher")) {
1294          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.publisher");
1295        }
1296        else if (name.equals("contact")) {
1297          return addContact();
1298        }
1299        else if (name.equals("date")) {
1300          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.date");
1301        }
1302        else if (name.equals("requirements")) {
1303          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.requirements");
1304        }
1305        else if (name.equals("code")) {
1306          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.code");
1307        }
1308        else if (name.equals("base")) {
1309          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.base");
1310        }
1311        else if (name.equals("type")) {
1312          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.type");
1313        }
1314        else if (name.equals("description")) {
1315          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.description");
1316        }
1317        else if (name.equals("xpath")) {
1318          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.xpath");
1319        }
1320        else if (name.equals("xpathUsage")) {
1321          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.xpathUsage");
1322        }
1323        else if (name.equals("target")) {
1324          throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.target");
1325        }
1326        else
1327          return super.addChild(name);
1328      }
1329
1330  public String fhirType() {
1331    return "SearchParameter";
1332
1333  }
1334
1335      public SearchParameter copy() {
1336        SearchParameter dst = new SearchParameter();
1337        copyValues(dst);
1338        dst.url = url == null ? null : url.copy();
1339        dst.name = name == null ? null : name.copy();
1340        dst.status = status == null ? null : status.copy();
1341        dst.experimental = experimental == null ? null : experimental.copy();
1342        dst.publisher = publisher == null ? null : publisher.copy();
1343        if (contact != null) {
1344          dst.contact = new ArrayList<SearchParameterContactComponent>();
1345          for (SearchParameterContactComponent i : contact)
1346            dst.contact.add(i.copy());
1347        };
1348        dst.date = date == null ? null : date.copy();
1349        dst.requirements = requirements == null ? null : requirements.copy();
1350        dst.code = code == null ? null : code.copy();
1351        dst.base = base == null ? null : base.copy();
1352        dst.type = type == null ? null : type.copy();
1353        dst.description = description == null ? null : description.copy();
1354        dst.xpath = xpath == null ? null : xpath.copy();
1355        dst.xpathUsage = xpathUsage == null ? null : xpathUsage.copy();
1356        if (target != null) {
1357          dst.target = new ArrayList<CodeType>();
1358          for (CodeType i : target)
1359            dst.target.add(i.copy());
1360        };
1361        return dst;
1362      }
1363
1364      protected SearchParameter typedCopy() {
1365        return copy();
1366      }
1367
1368      @Override
1369      public boolean equalsDeep(Base other) {
1370        if (!super.equalsDeep(other))
1371          return false;
1372        if (!(other instanceof SearchParameter))
1373          return false;
1374        SearchParameter o = (SearchParameter) other;
1375        return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true)
1376           && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true)
1377           && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) && compareDeep(requirements, o.requirements, true)
1378           && compareDeep(code, o.code, true) && compareDeep(base, o.base, true) && compareDeep(type, o.type, true)
1379           && compareDeep(description, o.description, true) && compareDeep(xpath, o.xpath, true) && compareDeep(xpathUsage, o.xpathUsage, true)
1380           && compareDeep(target, o.target, true);
1381      }
1382
1383      @Override
1384      public boolean equalsShallow(Base other) {
1385        if (!super.equalsShallow(other))
1386          return false;
1387        if (!(other instanceof SearchParameter))
1388          return false;
1389        SearchParameter o = (SearchParameter) other;
1390        return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(status, o.status, true)
1391           && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true)
1392           && compareValues(date, o.date, true) && compareValues(requirements, o.requirements, true) && compareValues(code, o.code, true)
1393           && compareValues(base, o.base, true) && compareValues(type, o.type, true) && compareValues(description, o.description, true)
1394           && compareValues(xpath, o.xpath, true) && compareValues(xpathUsage, o.xpathUsage, true) && compareValues(target, o.target, true)
1395          ;
1396      }
1397
1398      public boolean isEmpty() {
1399        return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty())
1400           && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty())
1401           && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty())
1402           && (requirements == null || requirements.isEmpty()) && (code == null || code.isEmpty()) && (base == null || base.isEmpty())
1403           && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) && (xpath == null || xpath.isEmpty())
1404           && (xpathUsage == null || xpathUsage.isEmpty()) && (target == null || target.isEmpty());
1405      }
1406
1407  @Override
1408  public ResourceType getResourceType() {
1409    return ResourceType.SearchParameter;
1410   }
1411
1412  @SearchParamDefinition(name="code", path="SearchParameter.code", description="Code used in URL", type="token" )
1413  public static final String SP_CODE = "code";
1414  @SearchParamDefinition(name="name", path="SearchParameter.name", description="Informal name for this search parameter", type="string" )
1415  public static final String SP_NAME = "name";
1416  @SearchParamDefinition(name="description", path="SearchParameter.description", description="Documentation for  search parameter", type="string" )
1417  public static final String SP_DESCRIPTION = "description";
1418  @SearchParamDefinition(name="type", path="SearchParameter.type", description="number | date | string | token | reference | composite | quantity | uri", type="token" )
1419  public static final String SP_TYPE = "type";
1420  @SearchParamDefinition(name="url", path="SearchParameter.url", description="Absolute URL used to reference this search parameter", type="uri" )
1421  public static final String SP_URL = "url";
1422  @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" )
1423  public static final String SP_BASE = "base";
1424  @SearchParamDefinition(name="target", path="SearchParameter.target", description="Types of resource (if a resource reference)", type="token" )
1425  public static final String SP_TARGET = "target";
1426
1427}
1428