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