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

com.ibm.fhir.model.resource.ImplementationGuide Maven / Gradle / Ivy

/*
 * (C) Copyright IBM Corp. 2019, 2021
 *
 * SPDX-License-Identifier: Apache-2.0
 */

package com.ibm.fhir.model.resource;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import javax.annotation.Generated;

import com.ibm.fhir.model.annotation.Binding;
import com.ibm.fhir.model.annotation.Choice;
import com.ibm.fhir.model.annotation.Constraint;
import com.ibm.fhir.model.annotation.Maturity;
import com.ibm.fhir.model.annotation.ReferenceTarget;
import com.ibm.fhir.model.annotation.Required;
import com.ibm.fhir.model.annotation.Summary;
import com.ibm.fhir.model.type.BackboneElement;
import com.ibm.fhir.model.type.Boolean;
import com.ibm.fhir.model.type.Canonical;
import com.ibm.fhir.model.type.Code;
import com.ibm.fhir.model.type.CodeableConcept;
import com.ibm.fhir.model.type.ContactDetail;
import com.ibm.fhir.model.type.DateTime;
import com.ibm.fhir.model.type.Element;
import com.ibm.fhir.model.type.Extension;
import com.ibm.fhir.model.type.Id;
import com.ibm.fhir.model.type.Markdown;
import com.ibm.fhir.model.type.Meta;
import com.ibm.fhir.model.type.Narrative;
import com.ibm.fhir.model.type.Reference;
import com.ibm.fhir.model.type.String;
import com.ibm.fhir.model.type.Uri;
import com.ibm.fhir.model.type.Url;
import com.ibm.fhir.model.type.UsageContext;
import com.ibm.fhir.model.type.code.BindingStrength;
import com.ibm.fhir.model.type.code.FHIRVersion;
import com.ibm.fhir.model.type.code.GuidePageGeneration;
import com.ibm.fhir.model.type.code.GuideParameterCode;
import com.ibm.fhir.model.type.code.PublicationStatus;
import com.ibm.fhir.model.type.code.ResourceType;
import com.ibm.fhir.model.type.code.SPDXLicense;
import com.ibm.fhir.model.type.code.StandardsStatus;
import com.ibm.fhir.model.util.ValidationSupport;
import com.ibm.fhir.model.visitor.Visitor;

/**
 * A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR 
 * resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to 
 * publish a computable definition of all the parts.
 * 
 * 

Maturity level: FMM1 (Trial Use) */ @Maturity( level = 1, status = StandardsStatus.Value.TRIAL_USE ) @Constraint( id = "ig-0", level = "Warning", location = "(base)", description = "Name should be usable as an identifier for the module by machine processing applications such as code generation", expression = "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')" ) @Constraint( id = "ig-1", level = "Rule", location = "ImplementationGuide.definition", description = "If a resource has a groupingId, it must refer to a grouping defined in the Implementation Guide", expression = "resource.groupingId.all(%context.grouping.id contains $this)" ) @Constraint( id = "ig-2", level = "Rule", location = "(base)", description = "If a resource has a fhirVersion, it must be oe of the versions defined for the Implementation Guide", expression = "definition.resource.fhirVersion.all(%context.fhirVersion contains $this)" ) @Constraint( id = "implementationGuide-3", level = "Warning", location = "(base)", description = "SHALL, if possible, contain a code from value set http://hl7.org/fhir/ValueSet/jurisdiction", expression = "jurisdiction.exists() implies (jurisdiction.all(memberOf('http://hl7.org/fhir/ValueSet/jurisdiction', 'extensible')))", generated = true ) @Generated("com.ibm.fhir.tools.CodeGenerator") public class ImplementationGuide extends DomainResource { @Summary @Required private final Uri url; @Summary private final String version; @Summary @Required private final String name; @Summary private final String title; @Summary @Binding( bindingName = "PublicationStatus", strength = BindingStrength.Value.REQUIRED, description = "The lifecycle status of an artifact.", valueSet = "http://hl7.org/fhir/ValueSet/publication-status|4.0.1" ) @Required private final PublicationStatus status; @Summary private final Boolean experimental; @Summary private final DateTime date; @Summary private final String publisher; @Summary private final List contact; private final Markdown description; @Summary private final List useContext; @Summary @Binding( bindingName = "Jurisdiction", strength = BindingStrength.Value.EXTENSIBLE, description = "Countries and regions within which this artifact is targeted for use.", valueSet = "http://hl7.org/fhir/ValueSet/jurisdiction" ) private final List jurisdiction; private final Markdown copyright; @Summary @Required private final Id packageId; @Summary @Binding( bindingName = "SPDXLicense", strength = BindingStrength.Value.REQUIRED, description = "The license that applies to an Implementation Guide (using an SPDX license Identifiers, or 'not-open-source'). The binding is required but new SPDX license Identifiers are allowed to be used (https://spdx.org/licenses/).", valueSet = "http://hl7.org/fhir/ValueSet/spdx-license|4.0.1" ) private final SPDXLicense license; @Summary @Binding( bindingName = "FHIRVersion", strength = BindingStrength.Value.REQUIRED, description = "All published FHIR Versions.", valueSet = "http://hl7.org/fhir/ValueSet/FHIR-version|4.0.1" ) @Required private final List fhirVersion; @Summary private final List dependsOn; @Summary private final List global; private final Definition definition; private final Manifest manifest; private ImplementationGuide(Builder builder) { super(builder); url = builder.url; version = builder.version; name = builder.name; title = builder.title; status = builder.status; experimental = builder.experimental; date = builder.date; publisher = builder.publisher; contact = Collections.unmodifiableList(builder.contact); description = builder.description; useContext = Collections.unmodifiableList(builder.useContext); jurisdiction = Collections.unmodifiableList(builder.jurisdiction); copyright = builder.copyright; packageId = builder.packageId; license = builder.license; fhirVersion = Collections.unmodifiableList(builder.fhirVersion); dependsOn = Collections.unmodifiableList(builder.dependsOn); global = Collections.unmodifiableList(builder.global); definition = builder.definition; manifest = builder.manifest; } /** * An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, * design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal * address at which at which an authoritative instance of this implementation guide is (or will be) published. This URL * can be the target of a canonical reference. It SHALL remain the same when the implementation guide is stored on * different servers. * * @return * An immutable object of type {@link Uri} that is non-null. */ public Uri getUrl() { return url; } /** * The identifier that is used to identify this version of the implementation guide when it is referenced in a * specification, model, design or instance. This is an arbitrary value managed by the implementation guide author and is * not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not * available. There is also no expectation that versions can be placed in a lexicographical sequence. * * @return * An immutable object of type {@link String} that may be null. */ public String getVersion() { return version; } /** * A natural language name identifying the implementation guide. This name should be usable as an identifier for the * module by machine processing applications such as code generation. * * @return * An immutable object of type {@link String} that is non-null. */ public String getName() { return name; } /** * A short, descriptive, user-friendly title for the implementation guide. * * @return * An immutable object of type {@link String} that may be null. */ public String getTitle() { return title; } /** * The status of this implementation guide. Enables tracking the life-cycle of the content. * * @return * An immutable object of type {@link PublicationStatus} that is non-null. */ public PublicationStatus getStatus() { return status; } /** * A Boolean value to indicate that this implementation guide is authored for testing purposes (or * education/evaluation/marketing) and is not intended to be used for genuine usage. * * @return * An immutable object of type {@link Boolean} that may be null. */ public Boolean getExperimental() { return experimental; } /** * The date (and optionally time) when the implementation guide was published. The date must change when the business * version changes and it must change if the status code changes. In addition, it should change when the substantive * content of the implementation guide changes. * * @return * An immutable object of type {@link DateTime} that may be null. */ public DateTime getDate() { return date; } /** * The name of the organization or individual that published the implementation guide. * * @return * An immutable object of type {@link String} that may be null. */ public String getPublisher() { return publisher; } /** * Contact details to assist a user in finding and communicating with the publisher. * * @return * An unmodifiable list containing immutable objects of type {@link ContactDetail} that may be empty. */ public List getContact() { return contact; } /** * A free text natural language description of the implementation guide from a consumer's perspective. * * @return * An immutable object of type {@link Markdown} that may be null. */ public Markdown getDescription() { return description; } /** * The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be * general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and * may be used to assist with indexing and searching for appropriate implementation guide instances. * * @return * An unmodifiable list containing immutable objects of type {@link UsageContext} that may be empty. */ public List getUseContext() { return useContext; } /** * A legal or geographic region in which the implementation guide is intended to be used. * * @return * An unmodifiable list containing immutable objects of type {@link CodeableConcept} that may be empty. */ public List getJurisdiction() { return jurisdiction; } /** * A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally * legal restrictions on the use and publishing of the implementation guide. * * @return * An immutable object of type {@link Markdown} that may be null. */ public Markdown getCopyright() { return copyright; } /** * The NPM package name for this Implementation Guide, used in the NPM package distribution, which is the primary * mechanism by which FHIR based tooling manages IG dependencies. This value must be globally unique, and should be * assigned with care. * * @return * An immutable object of type {@link Id} that is non-null. */ public Id getPackageId() { return packageId; } /** * The license that applies to this Implementation Guide, using an SPDX license code, or 'not-open-source'. * * @return * An immutable object of type {@link SPDXLicense} that may be null. */ public SPDXLicense getLicense() { return license; } /** * The version(s) of the FHIR specification that this ImplementationGuide targets - e.g. describes how to use. The value * of this element is the formal version of the specification, without the revision number, e.g. [publication].[major]. * [minor], which is 4.0.1. for this version. * * @return * An unmodifiable list containing immutable objects of type {@link FHIRVersion} that is non-empty. */ public List getFhirVersion() { return fhirVersion; } /** * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, * profiles etc.defined in other implementation guides. * * @return * An unmodifiable list containing immutable objects of type {@link DependsOn} that may be empty. */ public List getDependsOn() { return dependsOn; } /** * A set of profiles that all resources covered by this implementation guide must conform to. * * @return * An unmodifiable list containing immutable objects of type {@link Global} that may be empty. */ public List getGlobal() { return global; } /** * The information needed by an IG publisher tool to publish the whole implementation guide. * * @return * An immutable object of type {@link Definition} that may be null. */ public Definition getDefinition() { return definition; } /** * Information about an assembled implementation guide, created by the publication tooling. * * @return * An immutable object of type {@link Manifest} that may be null. */ public Manifest getManifest() { return manifest; } @Override public boolean hasChildren() { return super.hasChildren() || (url != null) || (version != null) || (name != null) || (title != null) || (status != null) || (experimental != null) || (date != null) || (publisher != null) || !contact.isEmpty() || (description != null) || !useContext.isEmpty() || !jurisdiction.isEmpty() || (copyright != null) || (packageId != null) || (license != null) || !fhirVersion.isEmpty() || !dependsOn.isEmpty() || !global.isEmpty() || (definition != null) || (manifest != null); } @Override public void accept(java.lang.String elementName, int elementIndex, Visitor visitor) { if (visitor.preVisit(this)) { visitor.visitStart(elementName, elementIndex, this); if (visitor.visit(elementName, elementIndex, this)) { // visit children accept(id, "id", visitor); accept(meta, "meta", visitor); accept(implicitRules, "implicitRules", visitor); accept(language, "language", visitor); accept(text, "text", visitor); accept(contained, "contained", visitor, com.ibm.fhir.model.resource.Resource.class); accept(extension, "extension", visitor, Extension.class); accept(modifierExtension, "modifierExtension", visitor, Extension.class); accept(url, "url", visitor); accept(version, "version", visitor); accept(name, "name", visitor); accept(title, "title", visitor); accept(status, "status", visitor); accept(experimental, "experimental", visitor); accept(date, "date", visitor); accept(publisher, "publisher", visitor); accept(contact, "contact", visitor, ContactDetail.class); accept(description, "description", visitor); accept(useContext, "useContext", visitor, UsageContext.class); accept(jurisdiction, "jurisdiction", visitor, CodeableConcept.class); accept(copyright, "copyright", visitor); accept(packageId, "packageId", visitor); accept(license, "license", visitor); accept(fhirVersion, "fhirVersion", visitor, FHIRVersion.class); accept(dependsOn, "dependsOn", visitor, DependsOn.class); accept(global, "global", visitor, Global.class); accept(definition, "definition", visitor); accept(manifest, "manifest", visitor); } visitor.visitEnd(elementName, elementIndex, this); visitor.postVisit(this); } } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ImplementationGuide other = (ImplementationGuide) obj; return Objects.equals(id, other.id) && Objects.equals(meta, other.meta) && Objects.equals(implicitRules, other.implicitRules) && Objects.equals(language, other.language) && Objects.equals(text, other.text) && Objects.equals(contained, other.contained) && Objects.equals(extension, other.extension) && Objects.equals(modifierExtension, other.modifierExtension) && Objects.equals(url, other.url) && Objects.equals(version, other.version) && Objects.equals(name, other.name) && Objects.equals(title, other.title) && Objects.equals(status, other.status) && Objects.equals(experimental, other.experimental) && Objects.equals(date, other.date) && Objects.equals(publisher, other.publisher) && Objects.equals(contact, other.contact) && Objects.equals(description, other.description) && Objects.equals(useContext, other.useContext) && Objects.equals(jurisdiction, other.jurisdiction) && Objects.equals(copyright, other.copyright) && Objects.equals(packageId, other.packageId) && Objects.equals(license, other.license) && Objects.equals(fhirVersion, other.fhirVersion) && Objects.equals(dependsOn, other.dependsOn) && Objects.equals(global, other.global) && Objects.equals(definition, other.definition) && Objects.equals(manifest, other.manifest); } @Override public int hashCode() { int result = hashCode; if (result == 0) { result = Objects.hash(id, meta, implicitRules, language, text, contained, extension, modifierExtension, url, version, name, title, status, experimental, date, publisher, contact, description, useContext, jurisdiction, copyright, packageId, license, fhirVersion, dependsOn, global, definition, manifest); hashCode = result; } return result; } @Override public Builder toBuilder() { return new Builder().from(this); } public static Builder builder() { return new Builder(); } public static class Builder extends DomainResource.Builder { private Uri url; private String version; private String name; private String title; private PublicationStatus status; private Boolean experimental; private DateTime date; private String publisher; private List contact = new ArrayList<>(); private Markdown description; private List useContext = new ArrayList<>(); private List jurisdiction = new ArrayList<>(); private Markdown copyright; private Id packageId; private SPDXLicense license; private List fhirVersion = new ArrayList<>(); private List dependsOn = new ArrayList<>(); private List global = new ArrayList<>(); private Definition definition; private Manifest manifest; private Builder() { super(); } /** * The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. * * @param id * Logical id of this artifact * * @return * A reference to this Builder instance */ @Override public Builder id(java.lang.String id) { return (Builder) super.id(id); } /** * 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. * * @param meta * Metadata about the resource * * @return * A reference to this Builder instance */ @Override public Builder meta(Meta meta) { return (Builder) super.meta(meta); } /** * 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. * * @param implicitRules * A set of rules under which this content was created * * @return * A reference to this Builder instance */ @Override public Builder implicitRules(Uri implicitRules) { return (Builder) super.implicitRules(implicitRules); } /** * The base language in which the resource is written. * * @param language * Language of the resource content * * @return * A reference to this Builder instance */ @Override public Builder language(Code language) { return (Builder) super.language(language); } /** * 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. * * @param text * Text summary of the resource, for human interpretation * * @return * A reference to this Builder instance */ @Override public Builder text(Narrative text) { return (Builder) super.text(text); } /** * 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. * *

Adds new element(s) to the existing list * * @param contained * Contained, inline Resources * * @return * A reference to this Builder instance */ @Override public Builder contained(com.ibm.fhir.model.resource.Resource... contained) { return (Builder) super.contained(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. * *

Replaces the existing list with a new one containing elements from the Collection * * @param contained * Contained, inline Resources * * @return * A reference to this Builder instance */ @Override public Builder contained(Collection contained) { return (Builder) super.contained(contained); } /** * 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. * *

Adds new element(s) to the existing list * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Extension... extension) { return (Builder) super.extension(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. * *

Replaces the existing list with a new one containing elements from the Collection * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Collection extension) { return (Builder) super.extension(extension); } /** * 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). * *

Adds new element(s) to the existing list * * @param modifierExtension * Extensions that cannot be ignored * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Extension... modifierExtension) { return (Builder) super.modifierExtension(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). * *

Replaces the existing list with a new one containing elements from the Collection * * @param modifierExtension * Extensions that cannot be ignored * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Collection modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, * design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal * address at which at which an authoritative instance of this implementation guide is (or will be) published. This URL * can be the target of a canonical reference. It SHALL remain the same when the implementation guide is stored on * different servers. * *

This element is required. * * @param url * Canonical identifier for this implementation guide, represented as a URI (globally unique) * * @return * A reference to this Builder instance */ public Builder url(Uri url) { this.url = url; return this; } /** * The identifier that is used to identify this version of the implementation guide when it is referenced in a * specification, model, design or instance. This is an arbitrary value managed by the implementation guide author and is * not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not * available. There is also no expectation that versions can be placed in a lexicographical sequence. * * @param version * Business version of the implementation guide * * @return * A reference to this Builder instance */ public Builder version(String version) { this.version = version; return this; } /** * A natural language name identifying the implementation guide. This name should be usable as an identifier for the * module by machine processing applications such as code generation. * *

This element is required. * * @param name * Name for this implementation guide (computer friendly) * * @return * A reference to this Builder instance */ public Builder name(String name) { this.name = name; return this; } /** * A short, descriptive, user-friendly title for the implementation guide. * * @param title * Name for this implementation guide (human friendly) * * @return * A reference to this Builder instance */ public Builder title(String title) { this.title = title; return this; } /** * The status of this implementation guide. Enables tracking the life-cycle of the content. * *

This element is required. * * @param status * draft | active | retired | unknown * * @return * A reference to this Builder instance */ public Builder status(PublicationStatus status) { this.status = status; return this; } /** * A Boolean value to indicate that this implementation guide is authored for testing purposes (or * education/evaluation/marketing) and is not intended to be used for genuine usage. * * @param experimental * For testing purposes, not real usage * * @return * A reference to this Builder instance */ public Builder experimental(Boolean experimental) { this.experimental = experimental; return this; } /** * The date (and optionally time) when the implementation guide was published. The date must change when the business * version changes and it must change if the status code changes. In addition, it should change when the substantive * content of the implementation guide changes. * * @param date * Date last changed * * @return * A reference to this Builder instance */ public Builder date(DateTime date) { this.date = date; return this; } /** * The name of the organization or individual that published the implementation guide. * * @param publisher * Name of the publisher (organization or individual) * * @return * A reference to this Builder instance */ public Builder publisher(String publisher) { this.publisher = publisher; return this; } /** * Contact details to assist a user in finding and communicating with the publisher. * *

Adds new element(s) to the existing list * * @param contact * Contact details for the publisher * * @return * A reference to this Builder instance */ public Builder contact(ContactDetail... contact) { for (ContactDetail value : contact) { this.contact.add(value); } return this; } /** * Contact details to assist a user in finding and communicating with the publisher. * *

Replaces the existing list with a new one containing elements from the Collection * * @param contact * Contact details for the publisher * * @return * A reference to this Builder instance */ public Builder contact(Collection contact) { this.contact = new ArrayList<>(contact); return this; } /** * A free text natural language description of the implementation guide from a consumer's perspective. * * @param description * Natural language description of the implementation guide * * @return * A reference to this Builder instance */ public Builder description(Markdown description) { this.description = description; return this; } /** * The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be * general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and * may be used to assist with indexing and searching for appropriate implementation guide instances. * *

Adds new element(s) to the existing list * * @param useContext * The context that the content is intended to support * * @return * A reference to this Builder instance */ public Builder useContext(UsageContext... useContext) { for (UsageContext value : useContext) { this.useContext.add(value); } return this; } /** * The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be * general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and * may be used to assist with indexing and searching for appropriate implementation guide instances. * *

Replaces the existing list with a new one containing elements from the Collection * * @param useContext * The context that the content is intended to support * * @return * A reference to this Builder instance */ public Builder useContext(Collection useContext) { this.useContext = new ArrayList<>(useContext); return this; } /** * A legal or geographic region in which the implementation guide is intended to be used. * *

Adds new element(s) to the existing list * * @param jurisdiction * Intended jurisdiction for implementation guide (if applicable) * * @return * A reference to this Builder instance */ public Builder jurisdiction(CodeableConcept... jurisdiction) { for (CodeableConcept value : jurisdiction) { this.jurisdiction.add(value); } return this; } /** * A legal or geographic region in which the implementation guide is intended to be used. * *

Replaces the existing list with a new one containing elements from the Collection * * @param jurisdiction * Intended jurisdiction for implementation guide (if applicable) * * @return * A reference to this Builder instance */ public Builder jurisdiction(Collection jurisdiction) { this.jurisdiction = new ArrayList<>(jurisdiction); return this; } /** * A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally * legal restrictions on the use and publishing of the implementation guide. * * @param copyright * Use and/or publishing restrictions * * @return * A reference to this Builder instance */ public Builder copyright(Markdown copyright) { this.copyright = copyright; return this; } /** * The NPM package name for this Implementation Guide, used in the NPM package distribution, which is the primary * mechanism by which FHIR based tooling manages IG dependencies. This value must be globally unique, and should be * assigned with care. * *

This element is required. * * @param packageId * NPM Package name for IG * * @return * A reference to this Builder instance */ public Builder packageId(Id packageId) { this.packageId = packageId; return this; } /** * The license that applies to this Implementation Guide, using an SPDX license code, or 'not-open-source'. * * @param license * SPDX license code for this IG (or not-open-source) * * @return * A reference to this Builder instance */ public Builder license(SPDXLicense license) { this.license = license; return this; } /** * The version(s) of the FHIR specification that this ImplementationGuide targets - e.g. describes how to use. The value * of this element is the formal version of the specification, without the revision number, e.g. [publication].[major]. * [minor], which is 4.0.1. for this version. * *

Adds new element(s) to the existing list * *

This element is required. * * @param fhirVersion * FHIR Version(s) this Implementation Guide targets * * @return * A reference to this Builder instance */ public Builder fhirVersion(FHIRVersion... fhirVersion) { for (FHIRVersion value : fhirVersion) { this.fhirVersion.add(value); } return this; } /** * The version(s) of the FHIR specification that this ImplementationGuide targets - e.g. describes how to use. The value * of this element is the formal version of the specification, without the revision number, e.g. [publication].[major]. * [minor], which is 4.0.1. for this version. * *

Replaces the existing list with a new one containing elements from the Collection * *

This element is required. * * @param fhirVersion * FHIR Version(s) this Implementation Guide targets * * @return * A reference to this Builder instance */ public Builder fhirVersion(Collection fhirVersion) { this.fhirVersion = new ArrayList<>(fhirVersion); return this; } /** * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, * profiles etc.defined in other implementation guides. * *

Adds new element(s) to the existing list * * @param dependsOn * Another Implementation guide this depends on * * @return * A reference to this Builder instance */ public Builder dependsOn(DependsOn... dependsOn) { for (DependsOn value : dependsOn) { this.dependsOn.add(value); } return this; } /** * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, * profiles etc.defined in other implementation guides. * *

Replaces the existing list with a new one containing elements from the Collection * * @param dependsOn * Another Implementation guide this depends on * * @return * A reference to this Builder instance */ public Builder dependsOn(Collection dependsOn) { this.dependsOn = new ArrayList<>(dependsOn); return this; } /** * A set of profiles that all resources covered by this implementation guide must conform to. * *

Adds new element(s) to the existing list * * @param global * Profiles that apply globally * * @return * A reference to this Builder instance */ public Builder global(Global... global) { for (Global value : global) { this.global.add(value); } return this; } /** * A set of profiles that all resources covered by this implementation guide must conform to. * *

Replaces the existing list with a new one containing elements from the Collection * * @param global * Profiles that apply globally * * @return * A reference to this Builder instance */ public Builder global(Collection global) { this.global = new ArrayList<>(global); return this; } /** * The information needed by an IG publisher tool to publish the whole implementation guide. * * @param definition * Information needed to build the IG * * @return * A reference to this Builder instance */ public Builder definition(Definition definition) { this.definition = definition; return this; } /** * Information about an assembled implementation guide, created by the publication tooling. * * @param manifest * Information about an assembled IG * * @return * A reference to this Builder instance */ public Builder manifest(Manifest manifest) { this.manifest = manifest; return this; } /** * Build the {@link ImplementationGuide} * *

Required elements: *

    *
  • url
  • *
  • name
  • *
  • status
  • *
  • packageId
  • *
  • fhirVersion
  • *
* * @return * An immutable object of type {@link ImplementationGuide} * @throws IllegalStateException * if the current state cannot be built into a valid ImplementationGuide per the base specification */ @Override public ImplementationGuide build() { ImplementationGuide implementationGuide = new ImplementationGuide(this); if (validating) { validate(implementationGuide); } return implementationGuide; } protected void validate(ImplementationGuide implementationGuide) { super.validate(implementationGuide); ValidationSupport.requireNonNull(implementationGuide.url, "url"); ValidationSupport.requireNonNull(implementationGuide.name, "name"); ValidationSupport.requireNonNull(implementationGuide.status, "status"); ValidationSupport.checkList(implementationGuide.contact, "contact", ContactDetail.class); ValidationSupport.checkList(implementationGuide.useContext, "useContext", UsageContext.class); ValidationSupport.checkList(implementationGuide.jurisdiction, "jurisdiction", CodeableConcept.class); ValidationSupport.requireNonNull(implementationGuide.packageId, "packageId"); ValidationSupport.checkNonEmptyList(implementationGuide.fhirVersion, "fhirVersion", FHIRVersion.class); ValidationSupport.checkList(implementationGuide.dependsOn, "dependsOn", DependsOn.class); ValidationSupport.checkList(implementationGuide.global, "global", Global.class); } protected Builder from(ImplementationGuide implementationGuide) { super.from(implementationGuide); url = implementationGuide.url; version = implementationGuide.version; name = implementationGuide.name; title = implementationGuide.title; status = implementationGuide.status; experimental = implementationGuide.experimental; date = implementationGuide.date; publisher = implementationGuide.publisher; contact.addAll(implementationGuide.contact); description = implementationGuide.description; useContext.addAll(implementationGuide.useContext); jurisdiction.addAll(implementationGuide.jurisdiction); copyright = implementationGuide.copyright; packageId = implementationGuide.packageId; license = implementationGuide.license; fhirVersion.addAll(implementationGuide.fhirVersion); dependsOn.addAll(implementationGuide.dependsOn); global.addAll(implementationGuide.global); definition = implementationGuide.definition; manifest = implementationGuide.manifest; return this; } } /** * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, * profiles etc.defined in other implementation guides. */ public static class DependsOn extends BackboneElement { @Summary @Required private final Canonical uri; @Summary private final Id packageId; @Summary private final String version; private DependsOn(Builder builder) { super(builder); uri = builder.uri; packageId = builder.packageId; version = builder.version; } /** * A canonical reference to the Implementation guide for the dependency. * * @return * An immutable object of type {@link Canonical} that is non-null. */ public Canonical getUri() { return uri; } /** * The NPM package name for the Implementation Guide that this IG depends on. * * @return * An immutable object of type {@link Id} that may be null. */ public Id getPackageId() { return packageId; } /** * The version of the IG that is depended on, when the correct version is required to understand the IG correctly. * * @return * An immutable object of type {@link String} that may be null. */ public String getVersion() { return version; } @Override public boolean hasChildren() { return super.hasChildren() || (uri != null) || (packageId != null) || (version != null); } @Override public void accept(java.lang.String elementName, int elementIndex, Visitor visitor) { if (visitor.preVisit(this)) { visitor.visitStart(elementName, elementIndex, this); if (visitor.visit(elementName, elementIndex, this)) { // visit children accept(id, "id", visitor); accept(extension, "extension", visitor, Extension.class); accept(modifierExtension, "modifierExtension", visitor, Extension.class); accept(uri, "uri", visitor); accept(packageId, "packageId", visitor); accept(version, "version", visitor); } visitor.visitEnd(elementName, elementIndex, this); visitor.postVisit(this); } } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } DependsOn other = (DependsOn) obj; return Objects.equals(id, other.id) && Objects.equals(extension, other.extension) && Objects.equals(modifierExtension, other.modifierExtension) && Objects.equals(uri, other.uri) && Objects.equals(packageId, other.packageId) && Objects.equals(version, other.version); } @Override public int hashCode() { int result = hashCode; if (result == 0) { result = Objects.hash(id, extension, modifierExtension, uri, packageId, version); hashCode = result; } return result; } @Override public Builder toBuilder() { return new Builder().from(this); } public static Builder builder() { return new Builder(); } public static class Builder extends BackboneElement.Builder { private Canonical uri; private Id packageId; private String version; private Builder() { super(); } /** * Unique id for the element within a resource (for internal references). This may be any string value that does not * contain spaces. * * @param id * Unique id for inter-element referencing * * @return * A reference to this Builder instance */ @Override public Builder id(java.lang.String id) { return (Builder) super.id(id); } /** * May be used to represent additional information that is not part of the basic definition of the element. 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. * *

Adds new element(s) to the existing list * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Extension... extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element. 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. * *

Replaces the existing list with a new one containing elements from the Collection * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Collection extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained 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 can 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). * *

Adds new element(s) to the existing list * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Extension... modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained 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 can 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). * *

Replaces the existing list with a new one containing elements from the Collection * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Collection modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * A canonical reference to the Implementation guide for the dependency. * *

This element is required. * * @param uri * Identity of the IG that this depends on * * @return * A reference to this Builder instance */ public Builder uri(Canonical uri) { this.uri = uri; return this; } /** * The NPM package name for the Implementation Guide that this IG depends on. * * @param packageId * NPM Package name for IG this depends on * * @return * A reference to this Builder instance */ public Builder packageId(Id packageId) { this.packageId = packageId; return this; } /** * The version of the IG that is depended on, when the correct version is required to understand the IG correctly. * * @param version * Version of the IG * * @return * A reference to this Builder instance */ public Builder version(String version) { this.version = version; return this; } /** * Build the {@link DependsOn} * *

Required elements: *

    *
  • uri
  • *
* * @return * An immutable object of type {@link DependsOn} * @throws IllegalStateException * if the current state cannot be built into a valid DependsOn per the base specification */ @Override public DependsOn build() { DependsOn dependsOn = new DependsOn(this); if (validating) { validate(dependsOn); } return dependsOn; } protected void validate(DependsOn dependsOn) { super.validate(dependsOn); ValidationSupport.requireNonNull(dependsOn.uri, "uri"); ValidationSupport.requireValueOrChildren(dependsOn); } protected Builder from(DependsOn dependsOn) { super.from(dependsOn); uri = dependsOn.uri; packageId = dependsOn.packageId; version = dependsOn.version; return this; } } } /** * A set of profiles that all resources covered by this implementation guide must conform to. */ public static class Global extends BackboneElement { @Summary @Binding( bindingName = "ResourceType", strength = BindingStrength.Value.REQUIRED, description = "One of the resource types defined as part of this version of FHIR.", valueSet = "http://hl7.org/fhir/ValueSet/resource-types|4.0.1" ) @Required private final ResourceType type; @Summary @Required private final Canonical profile; private Global(Builder builder) { super(builder); type = builder.type; profile = builder.profile; } /** * The type of resource that all instances must conform to. * * @return * An immutable object of type {@link ResourceType} that is non-null. */ public ResourceType getType() { return type; } /** * A reference to the profile that all instances must conform to. * * @return * An immutable object of type {@link Canonical} that is non-null. */ public Canonical getProfile() { return profile; } @Override public boolean hasChildren() { return super.hasChildren() || (type != null) || (profile != null); } @Override public void accept(java.lang.String elementName, int elementIndex, Visitor visitor) { if (visitor.preVisit(this)) { visitor.visitStart(elementName, elementIndex, this); if (visitor.visit(elementName, elementIndex, this)) { // visit children accept(id, "id", visitor); accept(extension, "extension", visitor, Extension.class); accept(modifierExtension, "modifierExtension", visitor, Extension.class); accept(type, "type", visitor); accept(profile, "profile", visitor); } visitor.visitEnd(elementName, elementIndex, this); visitor.postVisit(this); } } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Global other = (Global) obj; return Objects.equals(id, other.id) && Objects.equals(extension, other.extension) && Objects.equals(modifierExtension, other.modifierExtension) && Objects.equals(type, other.type) && Objects.equals(profile, other.profile); } @Override public int hashCode() { int result = hashCode; if (result == 0) { result = Objects.hash(id, extension, modifierExtension, type, profile); hashCode = result; } return result; } @Override public Builder toBuilder() { return new Builder().from(this); } public static Builder builder() { return new Builder(); } public static class Builder extends BackboneElement.Builder { private ResourceType type; private Canonical profile; private Builder() { super(); } /** * Unique id for the element within a resource (for internal references). This may be any string value that does not * contain spaces. * * @param id * Unique id for inter-element referencing * * @return * A reference to this Builder instance */ @Override public Builder id(java.lang.String id) { return (Builder) super.id(id); } /** * May be used to represent additional information that is not part of the basic definition of the element. 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. * *

Adds new element(s) to the existing list * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Extension... extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element. 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. * *

Replaces the existing list with a new one containing elements from the Collection * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Collection extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained 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 can 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). * *

Adds new element(s) to the existing list * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Extension... modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained 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 can 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). * *

Replaces the existing list with a new one containing elements from the Collection * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Collection modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * The type of resource that all instances must conform to. * *

This element is required. * * @param type * Type this profile applies to * * @return * A reference to this Builder instance */ public Builder type(ResourceType type) { this.type = type; return this; } /** * A reference to the profile that all instances must conform to. * *

This element is required. * * @param profile * Profile that all resources must conform to * * @return * A reference to this Builder instance */ public Builder profile(Canonical profile) { this.profile = profile; return this; } /** * Build the {@link Global} * *

Required elements: *

    *
  • type
  • *
  • profile
  • *
* * @return * An immutable object of type {@link Global} * @throws IllegalStateException * if the current state cannot be built into a valid Global per the base specification */ @Override public Global build() { Global global = new Global(this); if (validating) { validate(global); } return global; } protected void validate(Global global) { super.validate(global); ValidationSupport.requireNonNull(global.type, "type"); ValidationSupport.requireNonNull(global.profile, "profile"); ValidationSupport.requireValueOrChildren(global); } protected Builder from(Global global) { super.from(global); type = global.type; profile = global.profile; return this; } } } /** * The information needed by an IG publisher tool to publish the whole implementation guide. */ public static class Definition extends BackboneElement { private final List grouping; @Required private final List resource; private final Page page; private final List parameter; private final List