001package org.hl7.fhir.instance.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
033import java.util.ArrayList;
034import java.util.List;
035
036import org.hl7.fhir.exceptions.FHIRException;
037
038import ca.uhn.fhir.model.api.annotation.*;
039/**
040 * Prospective warnings of potential issues when providing care to the patient.
041 */
042@ResourceDef(name="Flag", profile="http://hl7.org/fhir/Profile/Flag")
043public class Flag extends DomainResource {
044
045    public enum FlagStatus {
046        /**
047         * A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag.
048         */
049        ACTIVE, 
050        /**
051         * The flag does not need to be displayed any more.
052         */
053        INACTIVE, 
054        /**
055         * The flag was added in error, and should no longer be displayed.
056         */
057        ENTEREDINERROR, 
058        /**
059         * added to help the parsers
060         */
061        NULL;
062        public static FlagStatus fromCode(String codeString) throws FHIRException {
063            if (codeString == null || "".equals(codeString))
064                return null;
065        if ("active".equals(codeString))
066          return ACTIVE;
067        if ("inactive".equals(codeString))
068          return INACTIVE;
069        if ("entered-in-error".equals(codeString))
070          return ENTEREDINERROR;
071        throw new FHIRException("Unknown FlagStatus code '"+codeString+"'");
072        }
073        public String toCode() {
074          switch (this) {
075            case ACTIVE: return "active";
076            case INACTIVE: return "inactive";
077            case ENTEREDINERROR: return "entered-in-error";
078            default: return "?";
079          }
080        }
081        public String getSystem() {
082          switch (this) {
083            case ACTIVE: return "http://hl7.org/fhir/flag-status";
084            case INACTIVE: return "http://hl7.org/fhir/flag-status";
085            case ENTEREDINERROR: return "http://hl7.org/fhir/flag-status";
086            default: return "?";
087          }
088        }
089        public String getDefinition() {
090          switch (this) {
091            case ACTIVE: return "A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag.";
092            case INACTIVE: return "The flag does not need to be displayed any more.";
093            case ENTEREDINERROR: return "The flag was added in error, and should no longer be displayed.";
094            default: return "?";
095          }
096        }
097        public String getDisplay() {
098          switch (this) {
099            case ACTIVE: return "Active";
100            case INACTIVE: return "Inactive";
101            case ENTEREDINERROR: return "Entered in Error";
102            default: return "?";
103          }
104        }
105    }
106
107  public static class FlagStatusEnumFactory implements EnumFactory<FlagStatus> {
108    public FlagStatus fromCode(String codeString) throws IllegalArgumentException {
109      if (codeString == null || "".equals(codeString))
110            if (codeString == null || "".equals(codeString))
111                return null;
112        if ("active".equals(codeString))
113          return FlagStatus.ACTIVE;
114        if ("inactive".equals(codeString))
115          return FlagStatus.INACTIVE;
116        if ("entered-in-error".equals(codeString))
117          return FlagStatus.ENTEREDINERROR;
118        throw new IllegalArgumentException("Unknown FlagStatus code '"+codeString+"'");
119        }
120        public Enumeration<FlagStatus> fromType(Base code) throws FHIRException {
121          if (code == null || code.isEmpty())
122            return null;
123          String codeString = ((PrimitiveType) code).asStringValue();
124          if (codeString == null || "".equals(codeString))
125            return null;
126        if ("active".equals(codeString))
127          return new Enumeration<FlagStatus>(this, FlagStatus.ACTIVE);
128        if ("inactive".equals(codeString))
129          return new Enumeration<FlagStatus>(this, FlagStatus.INACTIVE);
130        if ("entered-in-error".equals(codeString))
131          return new Enumeration<FlagStatus>(this, FlagStatus.ENTEREDINERROR);
132        throw new FHIRException("Unknown FlagStatus code '"+codeString+"'");
133        }
134    public String toCode(FlagStatus code) {
135      if (code == FlagStatus.ACTIVE)
136        return "active";
137      if (code == FlagStatus.INACTIVE)
138        return "inactive";
139      if (code == FlagStatus.ENTEREDINERROR)
140        return "entered-in-error";
141      return "?";
142      }
143    }
144
145    /**
146     * Identifier assigned to the flag for external use (outside the FHIR environment).
147     */
148    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
149    @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the flag for external use (outside the FHIR environment)." )
150    protected List<Identifier> identifier;
151
152    /**
153     * Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.
154     */
155    @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
156    @Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context." )
157    protected CodeableConcept category;
158
159    /**
160     * Supports basic workflow.
161     */
162    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
163    @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="Supports basic workflow." )
164    protected Enumeration<FlagStatus> status;
165
166    /**
167     * The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.
168     */
169    @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true)
170    @Description(shortDefinition="Time period when flag is active", formalDefinition="The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified." )
171    protected Period period;
172
173    /**
174     * The patient, location, group , organization , or practitioner this is about record this flag is associated with.
175     */
176    @Child(name = "subject", type = {Patient.class, Location.class, Group.class, Organization.class, Practitioner.class}, order=4, min=1, max=1, modifier=false, summary=true)
177    @Description(shortDefinition="Who/What is flag about?", formalDefinition="The patient, location, group , organization , or practitioner this is about record this flag is associated with." )
178    protected Reference subject;
179
180    /**
181     * The actual object that is the target of the reference (The patient, location, group , organization , or practitioner this is about record this flag is associated with.)
182     */
183    protected Resource subjectTarget;
184
185    /**
186     * This alert is only relevant during the encounter.
187     */
188    @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true)
189    @Description(shortDefinition="Alert relevant during encounter", formalDefinition="This alert is only relevant during the encounter." )
190    protected Reference encounter;
191
192    /**
193     * The actual object that is the target of the reference (This alert is only relevant during the encounter.)
194     */
195    protected Encounter encounterTarget;
196
197    /**
198     * The person, organization or device that created the flag.
199     */
200    @Child(name = "author", type = {Device.class, Organization.class, Patient.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true)
201    @Description(shortDefinition="Flag creator", formalDefinition="The person, organization or device that created the flag." )
202    protected Reference author;
203
204    /**
205     * The actual object that is the target of the reference (The person, organization or device that created the flag.)
206     */
207    protected Resource authorTarget;
208
209    /**
210     * The coded value or textual component of the flag to display to the user.
211     */
212    @Child(name = "code", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=true)
213    @Description(shortDefinition="Partially deaf, Requires easy open caps, No permanent address, etc.", formalDefinition="The coded value or textual component of the flag to display to the user." )
214    protected CodeableConcept code;
215
216    private static final long serialVersionUID = 701147751L;
217
218  /*
219   * Constructor
220   */
221    public Flag() {
222      super();
223    }
224
225  /*
226   * Constructor
227   */
228    public Flag(Enumeration<FlagStatus> status, Reference subject, CodeableConcept code) {
229      super();
230      this.status = status;
231      this.subject = subject;
232      this.code = code;
233    }
234
235    /**
236     * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).)
237     */
238    public List<Identifier> getIdentifier() { 
239      if (this.identifier == null)
240        this.identifier = new ArrayList<Identifier>();
241      return this.identifier;
242    }
243
244    public boolean hasIdentifier() { 
245      if (this.identifier == null)
246        return false;
247      for (Identifier item : this.identifier)
248        if (!item.isEmpty())
249          return true;
250      return false;
251    }
252
253    /**
254     * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).)
255     */
256    // syntactic sugar
257    public Identifier addIdentifier() { //3
258      Identifier t = new Identifier();
259      if (this.identifier == null)
260        this.identifier = new ArrayList<Identifier>();
261      this.identifier.add(t);
262      return t;
263    }
264
265    // syntactic sugar
266    public Flag addIdentifier(Identifier t) { //3
267      if (t == null)
268        return this;
269      if (this.identifier == null)
270        this.identifier = new ArrayList<Identifier>();
271      this.identifier.add(t);
272      return this;
273    }
274
275    /**
276     * @return {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.)
277     */
278    public CodeableConcept getCategory() { 
279      if (this.category == null)
280        if (Configuration.errorOnAutoCreate())
281          throw new Error("Attempt to auto-create Flag.category");
282        else if (Configuration.doAutoCreate())
283          this.category = new CodeableConcept(); // cc
284      return this.category;
285    }
286
287    public boolean hasCategory() { 
288      return this.category != null && !this.category.isEmpty();
289    }
290
291    /**
292     * @param value {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.)
293     */
294    public Flag setCategory(CodeableConcept value) { 
295      this.category = value;
296      return this;
297    }
298
299    /**
300     * @return {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
301     */
302    public Enumeration<FlagStatus> getStatusElement() { 
303      if (this.status == null)
304        if (Configuration.errorOnAutoCreate())
305          throw new Error("Attempt to auto-create Flag.status");
306        else if (Configuration.doAutoCreate())
307          this.status = new Enumeration<FlagStatus>(new FlagStatusEnumFactory()); // bb
308      return this.status;
309    }
310
311    public boolean hasStatusElement() { 
312      return this.status != null && !this.status.isEmpty();
313    }
314
315    public boolean hasStatus() { 
316      return this.status != null && !this.status.isEmpty();
317    }
318
319    /**
320     * @param value {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
321     */
322    public Flag setStatusElement(Enumeration<FlagStatus> value) { 
323      this.status = value;
324      return this;
325    }
326
327    /**
328     * @return Supports basic workflow.
329     */
330    public FlagStatus getStatus() { 
331      return this.status == null ? null : this.status.getValue();
332    }
333
334    /**
335     * @param value Supports basic workflow.
336     */
337    public Flag setStatus(FlagStatus value) { 
338        if (this.status == null)
339          this.status = new Enumeration<FlagStatus>(new FlagStatusEnumFactory());
340        this.status.setValue(value);
341      return this;
342    }
343
344    /**
345     * @return {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.)
346     */
347    public Period getPeriod() { 
348      if (this.period == null)
349        if (Configuration.errorOnAutoCreate())
350          throw new Error("Attempt to auto-create Flag.period");
351        else if (Configuration.doAutoCreate())
352          this.period = new Period(); // cc
353      return this.period;
354    }
355
356    public boolean hasPeriod() { 
357      return this.period != null && !this.period.isEmpty();
358    }
359
360    /**
361     * @param value {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.)
362     */
363    public Flag setPeriod(Period value) { 
364      this.period = value;
365      return this;
366    }
367
368    /**
369     * @return {@link #subject} (The patient, location, group , organization , or practitioner this is about record this flag is associated with.)
370     */
371    public Reference getSubject() { 
372      if (this.subject == null)
373        if (Configuration.errorOnAutoCreate())
374          throw new Error("Attempt to auto-create Flag.subject");
375        else if (Configuration.doAutoCreate())
376          this.subject = new Reference(); // cc
377      return this.subject;
378    }
379
380    public boolean hasSubject() { 
381      return this.subject != null && !this.subject.isEmpty();
382    }
383
384    /**
385     * @param value {@link #subject} (The patient, location, group , organization , or practitioner this is about record this flag is associated with.)
386     */
387    public Flag setSubject(Reference value) { 
388      this.subject = value;
389      return this;
390    }
391
392    /**
393     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient, location, group , organization , or practitioner this is about record this flag is associated with.)
394     */
395    public Resource getSubjectTarget() { 
396      return this.subjectTarget;
397    }
398
399    /**
400     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient, location, group , organization , or practitioner this is about record this flag is associated with.)
401     */
402    public Flag setSubjectTarget(Resource value) { 
403      this.subjectTarget = value;
404      return this;
405    }
406
407    /**
408     * @return {@link #encounter} (This alert is only relevant during the encounter.)
409     */
410    public Reference getEncounter() { 
411      if (this.encounter == null)
412        if (Configuration.errorOnAutoCreate())
413          throw new Error("Attempt to auto-create Flag.encounter");
414        else if (Configuration.doAutoCreate())
415          this.encounter = new Reference(); // cc
416      return this.encounter;
417    }
418
419    public boolean hasEncounter() { 
420      return this.encounter != null && !this.encounter.isEmpty();
421    }
422
423    /**
424     * @param value {@link #encounter} (This alert is only relevant during the encounter.)
425     */
426    public Flag setEncounter(Reference value) { 
427      this.encounter = value;
428      return this;
429    }
430
431    /**
432     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This alert is only relevant during the encounter.)
433     */
434    public Encounter getEncounterTarget() { 
435      if (this.encounterTarget == null)
436        if (Configuration.errorOnAutoCreate())
437          throw new Error("Attempt to auto-create Flag.encounter");
438        else if (Configuration.doAutoCreate())
439          this.encounterTarget = new Encounter(); // aa
440      return this.encounterTarget;
441    }
442
443    /**
444     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (This alert is only relevant during the encounter.)
445     */
446    public Flag setEncounterTarget(Encounter value) { 
447      this.encounterTarget = value;
448      return this;
449    }
450
451    /**
452     * @return {@link #author} (The person, organization or device that created the flag.)
453     */
454    public Reference getAuthor() { 
455      if (this.author == null)
456        if (Configuration.errorOnAutoCreate())
457          throw new Error("Attempt to auto-create Flag.author");
458        else if (Configuration.doAutoCreate())
459          this.author = new Reference(); // cc
460      return this.author;
461    }
462
463    public boolean hasAuthor() { 
464      return this.author != null && !this.author.isEmpty();
465    }
466
467    /**
468     * @param value {@link #author} (The person, organization or device that created the flag.)
469     */
470    public Flag setAuthor(Reference value) { 
471      this.author = value;
472      return this;
473    }
474
475    /**
476     * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, organization or device that created the flag.)
477     */
478    public Resource getAuthorTarget() { 
479      return this.authorTarget;
480    }
481
482    /**
483     * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, organization or device that created the flag.)
484     */
485    public Flag setAuthorTarget(Resource value) { 
486      this.authorTarget = value;
487      return this;
488    }
489
490    /**
491     * @return {@link #code} (The coded value or textual component of the flag to display to the user.)
492     */
493    public CodeableConcept getCode() { 
494      if (this.code == null)
495        if (Configuration.errorOnAutoCreate())
496          throw new Error("Attempt to auto-create Flag.code");
497        else if (Configuration.doAutoCreate())
498          this.code = new CodeableConcept(); // cc
499      return this.code;
500    }
501
502    public boolean hasCode() { 
503      return this.code != null && !this.code.isEmpty();
504    }
505
506    /**
507     * @param value {@link #code} (The coded value or textual component of the flag to display to the user.)
508     */
509    public Flag setCode(CodeableConcept value) { 
510      this.code = value;
511      return this;
512    }
513
514      protected void listChildren(List<Property> childrenList) {
515        super.listChildren(childrenList);
516        childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the flag for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier));
517        childrenList.add(new Property("category", "CodeableConcept", "Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.", 0, java.lang.Integer.MAX_VALUE, category));
518        childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status));
519        childrenList.add(new Property("period", "Period", "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.", 0, java.lang.Integer.MAX_VALUE, period));
520        childrenList.add(new Property("subject", "Reference(Patient|Location|Group|Organization|Practitioner)", "The patient, location, group , organization , or practitioner this is about record this flag is associated with.", 0, java.lang.Integer.MAX_VALUE, subject));
521        childrenList.add(new Property("encounter", "Reference(Encounter)", "This alert is only relevant during the encounter.", 0, java.lang.Integer.MAX_VALUE, encounter));
522        childrenList.add(new Property("author", "Reference(Device|Organization|Patient|Practitioner)", "The person, organization or device that created the flag.", 0, java.lang.Integer.MAX_VALUE, author));
523        childrenList.add(new Property("code", "CodeableConcept", "The coded value or textual component of the flag to display to the user.", 0, java.lang.Integer.MAX_VALUE, code));
524      }
525
526      @Override
527      public void setProperty(String name, Base value) throws FHIRException {
528        if (name.equals("identifier"))
529          this.getIdentifier().add(castToIdentifier(value));
530        else if (name.equals("category"))
531          this.category = castToCodeableConcept(value); // CodeableConcept
532        else if (name.equals("status"))
533          this.status = new FlagStatusEnumFactory().fromType(value); // Enumeration<FlagStatus>
534        else if (name.equals("period"))
535          this.period = castToPeriod(value); // Period
536        else if (name.equals("subject"))
537          this.subject = castToReference(value); // Reference
538        else if (name.equals("encounter"))
539          this.encounter = castToReference(value); // Reference
540        else if (name.equals("author"))
541          this.author = castToReference(value); // Reference
542        else if (name.equals("code"))
543          this.code = castToCodeableConcept(value); // CodeableConcept
544        else
545          super.setProperty(name, value);
546      }
547
548      @Override
549      public Base addChild(String name) throws FHIRException {
550        if (name.equals("identifier")) {
551          return addIdentifier();
552        }
553        else if (name.equals("category")) {
554          this.category = new CodeableConcept();
555          return this.category;
556        }
557        else if (name.equals("status")) {
558          throw new FHIRException("Cannot call addChild on a primitive type Flag.status");
559        }
560        else if (name.equals("period")) {
561          this.period = new Period();
562          return this.period;
563        }
564        else if (name.equals("subject")) {
565          this.subject = new Reference();
566          return this.subject;
567        }
568        else if (name.equals("encounter")) {
569          this.encounter = new Reference();
570          return this.encounter;
571        }
572        else if (name.equals("author")) {
573          this.author = new Reference();
574          return this.author;
575        }
576        else if (name.equals("code")) {
577          this.code = new CodeableConcept();
578          return this.code;
579        }
580        else
581          return super.addChild(name);
582      }
583
584  public String fhirType() {
585    return "Flag";
586
587  }
588
589      public Flag copy() {
590        Flag dst = new Flag();
591        copyValues(dst);
592        if (identifier != null) {
593          dst.identifier = new ArrayList<Identifier>();
594          for (Identifier i : identifier)
595            dst.identifier.add(i.copy());
596        };
597        dst.category = category == null ? null : category.copy();
598        dst.status = status == null ? null : status.copy();
599        dst.period = period == null ? null : period.copy();
600        dst.subject = subject == null ? null : subject.copy();
601        dst.encounter = encounter == null ? null : encounter.copy();
602        dst.author = author == null ? null : author.copy();
603        dst.code = code == null ? null : code.copy();
604        return dst;
605      }
606
607      protected Flag typedCopy() {
608        return copy();
609      }
610
611      @Override
612      public boolean equalsDeep(Base other) {
613        if (!super.equalsDeep(other))
614          return false;
615        if (!(other instanceof Flag))
616          return false;
617        Flag o = (Flag) other;
618        return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(status, o.status, true)
619           && compareDeep(period, o.period, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
620           && compareDeep(author, o.author, true) && compareDeep(code, o.code, true);
621      }
622
623      @Override
624      public boolean equalsShallow(Base other) {
625        if (!super.equalsShallow(other))
626          return false;
627        if (!(other instanceof Flag))
628          return false;
629        Flag o = (Flag) other;
630        return compareValues(status, o.status, true);
631      }
632
633      public boolean isEmpty() {
634        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty())
635           && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (subject == null || subject.isEmpty())
636           && (encounter == null || encounter.isEmpty()) && (author == null || author.isEmpty()) && (code == null || code.isEmpty())
637          ;
638      }
639
640  @Override
641  public ResourceType getResourceType() {
642    return ResourceType.Flag;
643   }
644
645  @SearchParamDefinition(name="date", path="Flag.period", description="Time period when flag is active", type="date" )
646  public static final String SP_DATE = "date";
647  @SearchParamDefinition(name="subject", path="Flag.subject", description="The identity of a subject to list flags for", type="reference" )
648  public static final String SP_SUBJECT = "subject";
649  @SearchParamDefinition(name="patient", path="Flag.subject", description="The identity of a subject to list flags for", type="reference" )
650  public static final String SP_PATIENT = "patient";
651  @SearchParamDefinition(name="author", path="Flag.author", description="Flag creator", type="reference" )
652  public static final String SP_AUTHOR = "author";
653  @SearchParamDefinition(name="encounter", path="Flag.encounter", description="Alert relevant during encounter", type="reference" )
654  public static final String SP_ENCOUNTER = "encounter";
655
656}
657