All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.babylonhealth.lit.usbase_java.builders.CdshooksrequestgroupBuilder Maven / Gradle / Ivy

There is a newer version: 0.14.17
Show newest version
package com.babylonhealth.lit.usbase_java.builders;

import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Stream;
import java.util.stream.Collectors;

import scala.math.BigDecimal;
import scala.Option;
import scala.collection.immutable.Seq;
import scala.jdk.javaapi.CollectionConverters;
import scala.jdk.javaapi.OptionConverters;

import lombok.NonNull;

import com.babylonhealth.lit.core.FHIRComponentFieldMeta;
import com.babylonhealth.lit.core.FHIRDateTime;
import com.babylonhealth.lit.core.FHIRDate;
import com.babylonhealth.lit.core.LitSeqJCollector;
import com.babylonhealth.lit.core.LitSeq;
import com.babylonhealth.lit.core.LitSeq$;
import com.babylonhealth.lit.core.NonEmptyLitSeqJCollector;
import com.babylonhealth.lit.core.Choice;
import com.babylonhealth.lit.core.Choice$;
import com.babylonhealth.lit.core.model.*;
import com.babylonhealth.lit.hl7.model.*;
import com.babylonhealth.lit.usbase.model.*;
import com.babylonhealth.lit.core_java.builders.*;
import com.babylonhealth.lit.hl7_java.builders.*;
import com.babylonhealth.lit.usbase_java.builders.*;
import com.babylonhealth.lit.core_java.model.Unions.*;
import com.babylonhealth.lit.hl7_java.model.Unions.*;
import com.babylonhealth.lit.usbase_java.model.Unions.*;
import com.babylonhealth.lit.hl7.REQUEST_STATUS;
import com.babylonhealth.lit.hl7.REQUEST_INTENT;
import com.babylonhealth.lit.core.LANGUAGES;
import com.babylonhealth.lit.hl7.REQUEST_PRIORITY;
import com.babylonhealth.lit.core.$bslash$div;
import com.babylonhealth.lit.core_java.LitUtils;

import static com.babylonhealth.lit.core_java.LitUtils.autoSuffix;
import static com.babylonhealth.lit.core_java.LitUtils.guard;
import static java.util.stream.Collectors.toList;

public interface CdshooksrequestgroupBuilder extends RequestGroupBuilder {
  public Cdshooksrequestgroup build();

  public static Impl init(
      REQUEST_STATUS status, REQUEST_INTENT intent, Identifier identifier, String instantiatesUri) {
    return new Impl(status, intent, identifier, instantiatesUri);
  }

  public static Impl builder(
      REQUEST_STATUS status,
      REQUEST_INTENT intent,
      IdentifierBuilder identifier,
      String instantiatesUri) {
    return new Impl(status, intent, identifier.build(), instantiatesUri);
  }

  public class Impl implements CdshooksrequestgroupBuilder {
    private Optional id = Optional.empty();
    private Optional meta =
        Optional.of(
            MetaBuilder.init()
                .withProfile("http://hl7.org/fhir/StructureDefinition/cdshooksrequestgroup")
                .build());
    private Optional text = Optional.empty();
    private Optional code = Optional.empty();
    private Collection note = Collections.emptyList();
    private REQUEST_STATUS status;
    private REQUEST_INTENT intent;
    private Optional author = Optional.empty();
    private Collection basedOn = Collections.emptyList();
    private Optional subject = Optional.empty();
    private Optional language = Optional.empty();
    private Collection replaces = Collections.emptyList();
    private Optional priority = Optional.empty();
    private Collection contained = Collections.emptyList();
    private Collection extension = Collections.emptyList();
    private Optional encounter = Optional.empty();
    private Identifier identifier;
    private Optional authoredOn = Optional.empty();
    private Collection reasonCode = Collections.emptyList();
    private Optional implicitRules = Optional.empty();
    private String instantiatesUri;
    private Optional groupIdentifier = Optional.empty();
    private Collection reasonReference = Collections.emptyList();
    private Collection modifierExtension = Collections.emptyList();
    private Collection instantiatesCanonical = Collections.emptyList();
    private Collection action = Collections.emptyList();

    /**
     * Required fields for {@link Cdshooksrequestgroup}
     *
     * @param status - The current state of the request. For request groups, the status reflects the
     *     status of all the requests in the group.
     * @param intent - Indicates the level of authority/intentionality associated with the request
     *     and where the request fits into the workflow chain.
     * @param identifier - Allows a service to provide a unique, business identifier for the
     *     request.
     * @param instantiatesUri - A URL referencing an externally defined protocol, guideline,
     *     orderset or other definition that is adhered to in whole or in part by this request.
     */
    public Impl(
        REQUEST_STATUS status,
        REQUEST_INTENT intent,
        Identifier identifier,
        String instantiatesUri) {
      this.status = status;
      this.intent = intent;
      this.identifier = identifier;
      this.instantiatesUri = instantiatesUri;
    }

    /**
     * @param id - The logical id of the resource, as used in the URL for the resource. Once
     *     assigned, this value never changes.
     */
    public CdshooksrequestgroupBuilder.Impl withId(@NonNull String id) {
      this.id = Optional.of(id);
      return this;
    }
    /**
     * @param meta - The metadata about the resource. This is content that is maintained by the
     *     infrastructure. Changes to the content might not always be associated with version
     *     changes to the resource.
     */
    public CdshooksrequestgroupBuilder.Impl withMeta(@NonNull Meta meta) {
      this.meta = Optional.of(meta);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withMeta(@NonNull MetaBuilder meta) {
      this.meta = Optional.of(meta.build());
      return this;
    }
    /**
     * @param text - A human-readable narrative that contains a summary of the resource and can be
     *     used to represent the content of the resource to a human. The narrative need not encode
     *     all the structured data, but is required to contain sufficient detail to make it
     *     "clinically safe" for a human to just read the narrative. Resource definitions may define
     *     what content should be represented in the narrative to ensure clinical safety.
     */
    public CdshooksrequestgroupBuilder.Impl withText(@NonNull Narrative text) {
      this.text = Optional.of(text);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withText(@NonNull NarrativeBuilder text) {
      this.text = Optional.of(text.build());
      return this;
    }
    /** @param code - A code that identifies what the overall request group is. */
    public CdshooksrequestgroupBuilder.Impl withCode(@NonNull CodeableConcept code) {
      this.code = Optional.of(code);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withCode(@NonNull CodeableConceptBuilder code) {
      this.code = Optional.of(code.build());
      return this;
    }
    /**
     * @param note - Provides a mechanism to communicate additional information about the response.
     */
    public CdshooksrequestgroupBuilder.Impl withNote(@NonNull Annotation... note) {
      this.note = Arrays.asList(note);
      return this;
    }
    /**
     * @param note - Provides a mechanism to communicate additional information about the response.
     */
    public CdshooksrequestgroupBuilder.Impl withNote(@NonNull Collection note) {
      this.note = Collections.unmodifiableCollection(note);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withNote(@NonNull AnnotationBuilder... note) {
      this.note = Arrays.stream(note).map(e -> e.build()).collect(toList());
      return this;
    }
    /** @param author - Provides a reference to the author of the request group. */
    public CdshooksrequestgroupBuilder.Impl withAuthor(@NonNull Reference author) {
      this.author = Optional.of(author);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withAuthor(@NonNull ReferenceBuilder author) {
      this.author = Optional.of(author.build());
      return this;
    }
    /**
     * @param basedOn - A plan, proposal or order that is fulfilled in whole or in part by this
     *     request.
     */
    public CdshooksrequestgroupBuilder.Impl withBasedOn(@NonNull Reference... basedOn) {
      this.basedOn = Arrays.asList(basedOn);
      return this;
    }
    /**
     * @param basedOn - A plan, proposal or order that is fulfilled in whole or in part by this
     *     request.
     */
    public CdshooksrequestgroupBuilder.Impl withBasedOn(@NonNull Collection basedOn) {
      this.basedOn = Collections.unmodifiableCollection(basedOn);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withBasedOn(@NonNull ReferenceBuilder... basedOn) {
      this.basedOn = Arrays.stream(basedOn).map(e -> e.build()).collect(toList());
      return this;
    }
    /** @param subject - The subject for which the request group was created. */
    public CdshooksrequestgroupBuilder.Impl withSubject(@NonNull Reference subject) {
      this.subject = Optional.of(subject);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withSubject(@NonNull ReferenceBuilder subject) {
      this.subject = Optional.of(subject.build());
      return this;
    }
    /** @param language - The base language in which the resource is written. */
    public CdshooksrequestgroupBuilder.Impl withLanguage(@NonNull LANGUAGES language) {
      this.language = Optional.of(language);
      return this;
    }
    /**
     * @param replaces - Completed or terminated request(s) whose function is taken by this new
     *     request.
     */
    public CdshooksrequestgroupBuilder.Impl withReplaces(@NonNull Reference... replaces) {
      this.replaces = Arrays.asList(replaces);
      return this;
    }
    /**
     * @param replaces - Completed or terminated request(s) whose function is taken by this new
     *     request.
     */
    public CdshooksrequestgroupBuilder.Impl withReplaces(@NonNull Collection replaces) {
      this.replaces = Collections.unmodifiableCollection(replaces);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withReplaces(@NonNull ReferenceBuilder... replaces) {
      this.replaces = Arrays.stream(replaces).map(e -> e.build()).collect(toList());
      return this;
    }
    /**
     * @param priority - Indicates how quickly the request should be addressed with respect to other
     *     requests.
     */
    public CdshooksrequestgroupBuilder.Impl withPriority(@NonNull REQUEST_PRIORITY priority) {
      this.priority = Optional.of(priority);
      return this;
    }
    /**
     * @param contained - These resources do not have an independent existence apart from the
     *     resource that contains them - they cannot be identified independently, and nor can they
     *     have their own independent transaction scope.
     */
    public CdshooksrequestgroupBuilder.Impl withContained(@NonNull Resource... contained) {
      this.contained = Arrays.asList(contained);
      return this;
    }
    /**
     * @param contained - These resources do not have an independent existence apart from the
     *     resource that contains them - they cannot be identified independently, and nor can they
     *     have their own independent transaction scope.
     */
    public CdshooksrequestgroupBuilder.Impl withContained(@NonNull Collection contained) {
      this.contained = Collections.unmodifiableCollection(contained);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withContained(@NonNull ResourceBuilder... contained) {
      this.contained = Arrays.stream(contained).map(e -> e.build()).collect(toList());
      return this;
    }
    /**
     * @param extension - May be used to represent additional information that is not part of the
     *     basic definition of the resource. To make the use of extensions safe and manageable,
     *     there is a strict set of governance applied to the definition and use of extensions.
     *     Though any implementer can define an extension, there is a set of requirements that SHALL
     *     be met as part of the definition of the extension.
     */
    public CdshooksrequestgroupBuilder.Impl withExtension(@NonNull Extension... extension) {
      this.extension = Arrays.asList(extension);
      return this;
    }
    /**
     * @param extension - May be used to represent additional information that is not part of the
     *     basic definition of the resource. To make the use of extensions safe and manageable,
     *     there is a strict set of governance applied to the definition and use of extensions.
     *     Though any implementer can define an extension, there is a set of requirements that SHALL
     *     be met as part of the definition of the extension.
     */
    public CdshooksrequestgroupBuilder.Impl withExtension(
        @NonNull Collection extension) {
      this.extension = Collections.unmodifiableCollection(extension);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withExtension(@NonNull ExtensionBuilder... extension) {
      this.extension = Arrays.stream(extension).map(e -> e.build()).collect(toList());
      return this;
    }
    /** @param encounter - Describes the context of the request group, if any. */
    public CdshooksrequestgroupBuilder.Impl withEncounter(@NonNull Reference encounter) {
      this.encounter = Optional.of(encounter);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withEncounter(@NonNull ReferenceBuilder encounter) {
      this.encounter = Optional.of(encounter.build());
      return this;
    }
    /** @param authoredOn - Indicates when the request group was created. */
    public CdshooksrequestgroupBuilder.Impl withAuthoredOn(@NonNull FHIRDateTime authoredOn) {
      this.authoredOn = Optional.of(authoredOn);
      return this;
    }
    /** @param reasonCode - Describes the reason for the request group in coded or textual form. */
    public CdshooksrequestgroupBuilder.Impl withReasonCode(@NonNull CodeableConcept... reasonCode) {
      this.reasonCode = Arrays.asList(reasonCode);
      return this;
    }
    /** @param reasonCode - Describes the reason for the request group in coded or textual form. */
    public CdshooksrequestgroupBuilder.Impl withReasonCode(
        @NonNull Collection reasonCode) {
      this.reasonCode = Collections.unmodifiableCollection(reasonCode);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withReasonCode(
        @NonNull CodeableConceptBuilder... reasonCode) {
      this.reasonCode = Arrays.stream(reasonCode).map(e -> e.build()).collect(toList());
      return this;
    }
    /**
     * @param implicitRules - A reference to a set of rules that were followed when the resource was
     *     constructed, and which must be understood when processing the content. Often, this is a
     *     reference to an implementation guide that defines the special rules along with other
     *     profiles etc.
     */
    public CdshooksrequestgroupBuilder.Impl withImplicitRules(@NonNull String implicitRules) {
      this.implicitRules = Optional.of(implicitRules);
      return this;
    }
    /**
     * @param groupIdentifier - A shared identifier common to all requests that were authorized more
     *     or less simultaneously by a single author, representing the identifier of the
     *     requisition, prescription or similar form.
     */
    public CdshooksrequestgroupBuilder.Impl withGroupIdentifier(
        @NonNull Identifier groupIdentifier) {
      this.groupIdentifier = Optional.of(groupIdentifier);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withGroupIdentifier(
        @NonNull IdentifierBuilder groupIdentifier) {
      this.groupIdentifier = Optional.of(groupIdentifier.build());
      return this;
    }
    /**
     * @param reasonReference - Indicates another resource whose existence justifies this request
     *     group.
     */
    public CdshooksrequestgroupBuilder.Impl withReasonReference(
        @NonNull Reference... reasonReference) {
      this.reasonReference = Arrays.asList(reasonReference);
      return this;
    }
    /**
     * @param reasonReference - Indicates another resource whose existence justifies this request
     *     group.
     */
    public CdshooksrequestgroupBuilder.Impl withReasonReference(
        @NonNull Collection reasonReference) {
      this.reasonReference = Collections.unmodifiableCollection(reasonReference);
      return this;
    }

    public CdshooksrequestgroupBuilder.Impl withReasonReference(
        @NonNull ReferenceBuilder... reasonReference) {
      this.reasonReference = Arrays.stream(reasonReference).map(e -> e.build()).collect(toList());
      return this;
    }
    /**
     * @param modifierExtension - May be used to represent additional information that is not part
     *     of the basic definition of the resource and that modifies the understanding of the
     *     element that contains it and/or the understanding of the containing element's
     *     descendants. Usually modifier elements provide negation or qualification. To make the use
     *     of extensions safe and manageable, there is a strict set of governance applied to the
     *     definition and use of extensions. Though any implementer is allowed to define an
     *     extension, there is a set of requirements that SHALL be met as part of the definition of
     *     the extension. Applications processing a resource are required to check for modifier
     *     extensions.
     *     

Modifier extensions SHALL NOT change the meaning of any elements on Resource or * DomainResource (including cannot change the meaning of modifierExtension itself). */ public CdshooksrequestgroupBuilder.Impl withModifierExtension( @NonNull Extension... modifierExtension) { this.modifierExtension = Arrays.asList(modifierExtension); return this; } /** * @param modifierExtension - May be used to represent additional information that is not part * of the basic definition of the resource and that modifies the understanding of the * element that contains it and/or the understanding of the containing element's * descendants. Usually modifier elements provide negation or qualification. To make the use * of extensions safe and manageable, there is a strict set of governance applied to the * definition and use of extensions. Though any implementer is allowed to define an * extension, there is a set of requirements that SHALL be met as part of the definition of * the extension. Applications processing a resource are required to check for modifier * extensions. *

Modifier extensions SHALL NOT change the meaning of any elements on Resource or * DomainResource (including cannot change the meaning of modifierExtension itself). */ public CdshooksrequestgroupBuilder.Impl withModifierExtension( @NonNull Collection modifierExtension) { this.modifierExtension = Collections.unmodifiableCollection(modifierExtension); return this; } public CdshooksrequestgroupBuilder.Impl withModifierExtension( @NonNull ExtensionBuilder... modifierExtension) { this.modifierExtension = Arrays.stream(modifierExtension).map(e -> e.build()).collect(toList()); return this; } /** * @param instantiatesCanonical - A canonical URL referencing a FHIR-defined protocol, * guideline, orderset or other definition that is adhered to in whole or in part by this * request. */ public CdshooksrequestgroupBuilder.Impl withInstantiatesCanonical( @NonNull String... instantiatesCanonical) { this.instantiatesCanonical = Arrays.asList(instantiatesCanonical); return this; } /** * @param instantiatesCanonical - A canonical URL referencing a FHIR-defined protocol, * guideline, orderset or other definition that is adhered to in whole or in part by this * request. */ public CdshooksrequestgroupBuilder.Impl withInstantiatesCanonical( @NonNull Collection instantiatesCanonical) { this.instantiatesCanonical = Collections.unmodifiableCollection(instantiatesCanonical); return this; } /** @param action - The actions, if any, produced by the evaluation of the artifact. */ public CdshooksrequestgroupBuilder.Impl withAction(@NonNull RequestGroup.Action... action) { this.action = Arrays.asList(action); return this; } /** @param action - The actions, if any, produced by the evaluation of the artifact. */ public CdshooksrequestgroupBuilder.Impl withAction( @NonNull Collection action) { this.action = Collections.unmodifiableCollection(action); return this; } public CdshooksrequestgroupBuilder.Impl withAction( @NonNull RequestGroup_ActionBuilder... action) { this.action = Arrays.stream(action).map(e -> e.build()).collect(toList()); return this; } public CdshooksrequestgroupBuilder.Impl withoutMeta() { this.meta = Optional.empty(); return this; } public Cdshooksrequestgroup build() { return new Cdshooksrequestgroup( OptionConverters.toScala(id), OptionConverters.toScala(meta), OptionConverters.toScala(text), OptionConverters.toScala(code), note.stream().collect(new LitSeqJCollector<>()), status, intent, OptionConverters.toScala(author), basedOn.stream().collect(new LitSeqJCollector<>()), OptionConverters.toScala(subject), OptionConverters.toScala(language), replaces.stream().collect(new LitSeqJCollector<>()), OptionConverters.toScala(priority), contained.stream().collect(new LitSeqJCollector<>()), extension.stream().collect(new LitSeqJCollector<>()), OptionConverters.toScala(encounter), identifier, OptionConverters.toScala(authoredOn), reasonCode.stream().collect(new LitSeqJCollector<>()), OptionConverters.toScala(implicitRules), instantiatesUri, OptionConverters.toScala(groupIdentifier), reasonReference.stream().collect(new LitSeqJCollector<>()), modifierExtension.stream().collect(new LitSeqJCollector<>()), instantiatesCanonical.stream().collect(new LitSeqJCollector<>()), action.stream().collect(new LitSeqJCollector<>()), LitUtils.emptyMetaElMap()); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy