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