PECodeGenerator fixes

This commit is contained in:
Grahame Grieve 2024-11-01 23:11:45 +10:30
parent 90b6583ac5
commit 4db933235a
42 changed files with 9534 additions and 61 deletions

View File

@ -298,11 +298,17 @@ public class PEInstance {
return builder.getContext();
}
public Base addChild(String name, Type value) {
PEDefinition child = byName(definition.children(), name);
Base b = data.setProperty(child.schemaName(), value);
return b;
}
public Base addChild(String name, DataType value) {
PEDefinition child = byName(definition.children(), name);
Base b = data.setProperty(child.schemaName(), value);
return b;
}
public Base addChild(String name, Resource value) {
PEDefinition child = byName(definition.children(), name);
Base b = data.setProperty(child.schemaName(), value);
return b;
}
public Base addChild(String name, BackboneElement value) {
PEDefinition child = byName(definition.children(), name);

View File

@ -1620,7 +1620,9 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
} else if ("ValueSet".equals(cls)) {
return (T) valueSets.get(uri, version);
} else if ("CodeSystem".equals(cls)) {
return (T) codeSystems.get(uri, version);
return (T) codeSystems.get(uri, version);
} else if ("NamingSystem".equals(cls)) {
return (T) systems.get(uri, version);
} else if ("ConceptMap".equals(cls)) {
return (T) maps.get(uri, version);
} else if ("PlanDefinition".equals(cls)) {
@ -1628,9 +1630,9 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
} else if ("OperationDefinition".equals(cls)) {
OperationDefinition od = operations.get(uri, version);
return (T) od;
} else if ("Questionnaire.class".equals(cls)) {
} else if ("Questionnaire".equals(cls)) {
return (T) questionnaires.get(uri, version);
} else if ("SearchParameter.class".equals(cls)) {
} else if ("SearchParameter".equals(cls)) {
SearchParameter res = searchParameters.get(uri, version);
return (T) res;
}

View File

@ -50,6 +50,7 @@ import org.hl7.fhir.r5.model.ResourceFactory;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.DebugUtilities;
import org.hl7.fhir.utilities.Utilities;
/**
@ -341,6 +342,9 @@ public class PEBuilder {
List<PEDefinition> res = new ArrayList<>();
if (list.size() == 0) {
profile = context.fetchResource(StructureDefinition.class, url);
if (profile == null) {
DebugUtilities.breakpoint();
}
list = pu.getChildList(profile, profile.getSnapshot().getElementFirstRep());
}
if (list.size() > 0) {

View File

@ -42,6 +42,7 @@ import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.profilemodel.PEDefinition.PEDefinitionElementMode;
import org.hl7.fhir.utilities.DebugUtilities;
import org.hl7.fhir.utilities.Utilities;
public abstract class PEDefinition {
@ -84,6 +85,9 @@ public abstract class PEDefinition {
this.builder = builder;
this.name = name;
this.profile = profile;
if (profile == null) {
DebugUtilities.breakpoint();
}
this.definition = definition;
this.path = path == null ? name : ppath+"."+name;
}

View File

@ -299,10 +299,16 @@ public class PEInstance {
}
public Base addChild(String name, DataType value) {
PEDefinition child = byName(definition.children(), name);
Base b = data.setProperty(child.schemaName(), value);
return b;
}
PEDefinition child = byName(definition.children(), name);
Base b = data.setProperty(child.schemaName(), value);
return b;
}
public Base addChild(String name, Resource value) {
PEDefinition child = byName(definition.children(), name);
Base b = data.setProperty(child.schemaName(), value);
return b;
}
public Base addChild(String name, BackboneElement value) {
PEDefinition child = byName(definition.children(), name);

View File

@ -122,7 +122,7 @@ public class PECodeGenerator {
genAccessors(true, false, "id", "String", "", "String", "String", "Id", "Ids", false, "", false, false);
genLoad(true, false, "id", "id", "IdType", "", "String", "String", "Id", "Ids", false, false, null, false);
genSave(true, false, "id", "id", "IdType", "", "String", "String", "Id", "Ids", false, false, false, null, false);
genClear(false, "id");
genClear(false, "id", "String");
}
}
public void write(StringBuilder b, String copyright) {
@ -380,16 +380,20 @@ public class PECodeGenerator {
genAccessors(isPrim, isAbstract, name, type, init, ptype, ltype, cname, csname, field.isList(), field.documentation(), field.hasFixedValue(), isEnum);
genLoad(isPrim, isAbstract, name, sname, type, init, ptype, ltype, cname, csname, field.isList(), field.hasFixedValue(), field.types().get(0), isEnum);
genSave(isPrim, isAbstract, name, sname, type, init, ptype, ltype, cname, csname, field.isList(), field.hasFixedValue(), isExtension, field.types().get(0), isEnum);
genClear(field.isList(), name);
genClear(field.isList(), name, ptype);
}
} else {
// ignoring polymorphics for now
}
}
private void genClear(boolean list, String name) {
private void genClear(boolean list, String name, String ptype) {
if (list) {
w(clear, " "+name+".clear();");
} else if ("boolean".equals(ptype)) {
w(clear, " "+name+" = false;");
} else if ("int".equals(ptype)) {
w(clear, " "+name+" = 0;");
} else {
w(clear, " "+name+" = null;");
}
@ -407,7 +411,7 @@ public class PECodeGenerator {
} else if (isEnum) {
w(load, " if (src.hasChild(\""+name+"\")) {");
if ("CodeableConcept".equals(typeInfo.getName())) {
w(load, " "+name+" = "+type+".fromCodeableConcept((CodeableConcept) src.child(\""+name+"\").asDataType());");
w(load, " "+name+" = "+type+".fromCodeableConcept((CodeableConcept) src.child(\""+name+"\").asDataType());");
} else if ("Coding".equals(typeInfo.getName())) {
w(load, " "+name+" = "+type+".fromCoding((Coding) src.child(\""+name+"\").asDataType());");
} else {
@ -431,6 +435,8 @@ public class PECodeGenerator {
w(load, " if (src.hasChild(\""+name+"\")) {");
if ("BackboneElement".equals(type)) {
w(load, " "+name+" = ("+type+") src.child(\""+name+"\").asElement();");
} else if (Utilities.existsInList(type, workerContext.getResourceNames())) {
w(load, " "+name+" = ("+type+") src.child(\""+name+"\").asResource();");
} else {
w(load, " "+name+" = ("+type+") src.child(\""+name+"\").asDataType();");
}
@ -459,7 +465,13 @@ public class PECodeGenerator {
}
w(save, " }");
} else if (isPrim) {
w(save, " if ("+name+" != null) {");
if ("boolean".equals(ptype)) {
w(save, " if (true) { // for now, at least");
} else if ("int".equals(ptype)) {
w(save, " if ("+name+" != 0) {");
} else {
w(save, " if ("+name+" != null) {");
}
if (isExtension) {
w(save, " tgt.makeChild(\""+sname+"\").data().setProperty(\"value[x]\", new "+type+"("+name+"));");
} else if (Utilities.existsInList(type, "DateType", "InstantType", "DateTimeType")) {
@ -467,7 +479,7 @@ public class PECodeGenerator {
} else {
w(save, " tgt.makeChild(\""+sname+"\").data().setProperty(\"value\", new "+type+"("+name+"));");
}
w(save, " }");
w(save, " }");
} else if (typeInfo != null && typeInfo.getUrl() != null && !typeInfo.getUrl().startsWith("http://hl7.org/fhir/StructureDefinition")) {
w(save, " if ("+name+" != null) {");
w(save, " "+name+".save(tgt.makeChild(\""+sname+"\"), nulls);");
@ -501,7 +513,13 @@ public class PECodeGenerator {
w(accessors, " }");
w(accessors);
w(accessors, " public boolean has"+cname+"() {");
w(accessors, " return "+name+" != null;");
if ("boolean".equals(ptype)) {
w(accessors, " return true; // not "+name+" != false ?");
} else if ("int".equals(ptype)) {
w(accessors, " return "+name+" != 0;");
} else {
w(accessors, " return "+name+" != null;");
}
w(accessors, " }");
}
} else {

View File

@ -0,0 +1,881 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public class AdministrableProductDefinitionUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/AdministrableProductDefinition-uv-epi|1.0.0";
public enum PublicationStatus {
DRAFT, // "Draft" = http://hl7.org/fhir/publication-status#draft
ACTIVE, // "Active" = http://hl7.org/fhir/publication-status#active
RETIRED, // "Retired" = http://hl7.org/fhir/publication-status#retired
UNKNOWN; // "Unknown" = http://hl7.org/fhir/publication-status#unknown
public static PublicationStatus fromCode(String s) {
switch (s) {
case "draft": return DRAFT;
case "active": return ACTIVE;
case "retired": return RETIRED;
case "unknown": return UNKNOWN;
default: return null;
}
}
public static PublicationStatus fromCoding(Coding c) {
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "draft".equals(c.getCode())) {
return DRAFT;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "active".equals(c.getCode())) {
return ACTIVE;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "retired".equals(c.getCode())) {
return RETIRED;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "unknown".equals(c.getCode())) {
return UNKNOWN;
}
return null;
}
public static PublicationStatus fromCodeableConcept(CodeableConcept cc) {
for (Coding c : cc.getCoding()) {
PublicationStatus v = fromCoding(c);
if (v != null) {
return v;
}
}
return null;
}
public String toDisplay() {
switch (this) {
case DRAFT: return "Draft";
case ACTIVE: return "Active";
case RETIRED: return "Retired";
case UNKNOWN: return "Unknown";
default: return null;
}
}
public String toCode() {
switch (this) {
case DRAFT: return "draft";
case ACTIVE: return "active";
case RETIRED: return "retired";
case UNKNOWN: return "unknown";
default: return null;
}
}
public Coding toCoding() {
switch (this) {
case DRAFT: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("draft");
case ACTIVE: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("active");
case RETIRED: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("retired");
case UNKNOWN: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("unknown");
default: return null;
}
}
public CodeableConcept toCodeableConcept() {
Coding c = toCoding();
return c == null ? null : new CodeableConcept().addCoding(c);
}
}
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("1") @Max("*") @Doco("An identifier for the administrable product")
@Definition("An identifier for the administrable product.")
private List<Identifier> identifiers = new ArrayList<>();// @NotNull // An identifier for the administrable product
@Min("1") @Max("1") @Doco("draft | active | retired |unknown")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/publication-status|5.0.0")
@Definition("The status of this administrable product. Enables tracking the life-cycle of the content.")
private PublicationStatus status;// @NotNull // draft | active | retired |unknown
@Min("0") @Max("*") @Doco("References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product")
@Definition("References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product. If this administrable product describes the administration of a crushed tablet, the 'formOf' would be the product representing a distribution containing tablets and possibly also a cream. This is distinct from the 'producedFrom' which refers to the specific components of the product that are used in this preparation, rather than the product as a whole.")
private List<Reference> formOfs = new ArrayList<>(); // References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product
@Min("0") @Max("*") @Doco("Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form")
@Definition("Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form. In some cases, an administrable form might use all of the items from the overall product (or there might only be one item), while in other cases, an administrable form might use only a subset of the items available in the overall product. For example, an administrable form might involve combining a liquid and a powder available as part of an overall product, but not involve applying the also supplied cream.")
private List<Reference> producedFroms = new ArrayList<>(); // Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form
@Min("0") @Max("1") @Doco("A device that is integral to the medicinal product, in effect being considered as an \"ingredient\" of the medicinal product")
@Definition("A device that is integral to the medicinal product, in effect being considered as an \"ingredient\" of the medicinal product. This is not intended for devices that are just co-packaged.")
private Reference device; // A device that is integral to the medicinal product, in effect being considered as an "ingredient" of the medicinal product
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> properties = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> colors = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> flavors = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> scores = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> shapes = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> surfaceforms = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> sizes = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> images = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("0") @Max("*") @Doco("Characteristics e.g. a product's onset of action")
@Definition("Characteristics e.g. a product's onset of action.")
private List<BackboneElement> imprints = new ArrayList<>(); // Characteristics e.g. a product's onset of action
@Min("1") @Max("*") @Doco("The path by which the product is taken into or makes contact with the body")
@Definition("The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa).")
private List<BackboneElement> routeOfAdministrations = new ArrayList<>();// @NotNull // The path by which the product is taken into or makes contact with the body
/**
* Parameter-less constructor.
*
*/
public AdministrableProductDefinitionUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public AdministrableProductDefinitionUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static AdministrableProductDefinitionUvEpi fromSource(IWorkerContext context, AdministrableProductDefinition source) {
AdministrableProductDefinitionUvEpi theThing = new AdministrableProductDefinitionUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("status")) {
status = PublicationStatus.fromCode(src.child("status").asDataType().primitiveValue());
}
for (PEInstance item : src.children("formOf")) {
formOfs.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("producedFrom")) {
producedFroms.add((Reference) item.asDataType());
}
if (src.hasChild("device")) {
device = (Reference) src.child("device").asDataType();
}
for (PEInstance item : src.children("property")) {
properties.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("color")) {
colors.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("flavor")) {
flavors.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("score")) {
scores.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("shape")) {
shapes.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("surfaceform")) {
surfaceforms.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("size")) {
sizes.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("image")) {
images.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("imprint")) {
imprints.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("routeOfAdministration")) {
routeOfAdministrations.add((BackboneElement) item.asElement());
}
}
/**
* Build an instance of the object based on this source object
*
*/
public AdministrableProductDefinition build(IWorkerContext context) {
workerContext = context;
AdministrableProductDefinition theThing = new AdministrableProductDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, AdministrableProductDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("status");
if (status != null) {
tgt.addChild("status", status.toCode());
}
tgt.clear("formOf");
for (Reference item : formOfs) {
tgt.addChild("formOf", item);
}
tgt.clear("producedFrom");
for (Reference item : producedFroms) {
tgt.addChild("producedFrom", item);
}
tgt.clear("device");
if (device != null) {
tgt.addChild("device", device);
}
tgt.clear("property");
for (BackboneElement item : properties) {
tgt.addChild("property", item);
}
tgt.clear("color");
for (BackboneElement item : colors) {
tgt.addChild("color", item);
}
tgt.clear("flavor");
for (BackboneElement item : flavors) {
tgt.addChild("flavor", item);
}
tgt.clear("score");
for (BackboneElement item : scores) {
tgt.addChild("score", item);
}
tgt.clear("shape");
for (BackboneElement item : shapes) {
tgt.addChild("shape", item);
}
tgt.clear("surfaceform");
for (BackboneElement item : surfaceforms) {
tgt.addChild("surfaceform", item);
}
tgt.clear("size");
for (BackboneElement item : sizes) {
tgt.addChild("size", item);
}
tgt.clear("image");
for (BackboneElement item : images) {
tgt.addChild("image", item);
}
tgt.clear("imprint");
for (BackboneElement item : imprints) {
tgt.addChild("imprint", item);
}
tgt.clear("routeOfAdministration");
for (BackboneElement item : routeOfAdministrations) {
tgt.addChild("routeOfAdministration", item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public String getId() {
return id;
}
public AdministrableProductDefinitionUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public PublicationStatus getStatus() {
return status;
}
public AdministrableProductDefinitionUvEpi setStatus(PublicationStatus value) {
this.status = value;
return this;
}
public boolean hasStatus() {
return status != null;
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<Reference> getFormOfs() {
if (formOfs == null) { formOfs = new ArrayList<>(); }
return formOfs;
}
public boolean hasFormOfs() {
return formOfs != null && !formOfs.isEmpty();
}
public Reference addFormOf() {
Reference theThing = new Reference();
getFormOfs().add(theThing);
return theThing;
}
public boolean hasFormOf(Reference item) {
return hasFormOfs() && formOfs.contains(item);
}
public void removeFormOf(Reference item) {
if (hasFormOf(item)) {
formOfs.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<Reference> getProducedFroms() {
if (producedFroms == null) { producedFroms = new ArrayList<>(); }
return producedFroms;
}
public boolean hasProducedFroms() {
return producedFroms != null && !producedFroms.isEmpty();
}
public Reference addProducedFrom() {
Reference theThing = new Reference();
getProducedFroms().add(theThing);
return theThing;
}
public boolean hasProducedFrom(Reference item) {
return hasProducedFroms() && producedFroms.contains(item);
}
public void removeProducedFrom(Reference item) {
if (hasProducedFrom(item)) {
producedFroms.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public Reference getDevice() {
if (device == null) { device = new Reference(); }
return device;
}
public AdministrableProductDefinitionUvEpi setDevice(Reference value) {
this.device = value;
return this;
}
public boolean hasDevice() {
return device != null;
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getProperties() {
if (properties == null) { properties = new ArrayList<>(); }
return properties;
}
public boolean hasProperties() {
return properties != null && !properties.isEmpty();
}
public boolean hasProperty(BackboneElement item) {
return hasProperties() && properties.contains(item);
}
public void removeProperty(BackboneElement item) {
if (hasProperty(item)) {
properties.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getColors() {
if (colors == null) { colors = new ArrayList<>(); }
return colors;
}
public boolean hasColors() {
return colors != null && !colors.isEmpty();
}
public boolean hasColor(BackboneElement item) {
return hasColors() && colors.contains(item);
}
public void removeColor(BackboneElement item) {
if (hasColor(item)) {
colors.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getFlavors() {
if (flavors == null) { flavors = new ArrayList<>(); }
return flavors;
}
public boolean hasFlavors() {
return flavors != null && !flavors.isEmpty();
}
public boolean hasFlavor(BackboneElement item) {
return hasFlavors() && flavors.contains(item);
}
public void removeFlavor(BackboneElement item) {
if (hasFlavor(item)) {
flavors.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getScores() {
if (scores == null) { scores = new ArrayList<>(); }
return scores;
}
public boolean hasScores() {
return scores != null && !scores.isEmpty();
}
public boolean hasScore(BackboneElement item) {
return hasScores() && scores.contains(item);
}
public void removeScore(BackboneElement item) {
if (hasScore(item)) {
scores.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getShapes() {
if (shapes == null) { shapes = new ArrayList<>(); }
return shapes;
}
public boolean hasShapes() {
return shapes != null && !shapes.isEmpty();
}
public boolean hasShape(BackboneElement item) {
return hasShapes() && shapes.contains(item);
}
public void removeShape(BackboneElement item) {
if (hasShape(item)) {
shapes.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getSurfaceforms() {
if (surfaceforms == null) { surfaceforms = new ArrayList<>(); }
return surfaceforms;
}
public boolean hasSurfaceforms() {
return surfaceforms != null && !surfaceforms.isEmpty();
}
public boolean hasSurfaceform(BackboneElement item) {
return hasSurfaceforms() && surfaceforms.contains(item);
}
public void removeSurfaceform(BackboneElement item) {
if (hasSurfaceform(item)) {
surfaceforms.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getSizes() {
if (sizes == null) { sizes = new ArrayList<>(); }
return sizes;
}
public boolean hasSizes() {
return sizes != null && !sizes.isEmpty();
}
public boolean hasSize(BackboneElement item) {
return hasSizes() && sizes.contains(item);
}
public void removeSize(BackboneElement item) {
if (hasSize(item)) {
sizes.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getImages() {
if (images == null) { images = new ArrayList<>(); }
return images;
}
public boolean hasImages() {
return images != null && !images.isEmpty();
}
public boolean hasImage(BackboneElement item) {
return hasImages() && images.contains(item);
}
public void removeImage(BackboneElement item) {
if (hasImage(item)) {
images.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getImprints() {
if (imprints == null) { imprints = new ArrayList<>(); }
return imprints;
}
public boolean hasImprints() {
return imprints != null && !imprints.isEmpty();
}
public boolean hasImprint(BackboneElement item) {
return hasImprints() && imprints.contains(item);
}
public void removeImprint(BackboneElement item) {
if (hasImprint(item)) {
imprints.remove(item);
}
}
/**
* A medicinal product in the final form which is suitable for administering to a
* patient (after any mixing of multiple components, dissolution etc. has been
* performed).
*
*/
public List<BackboneElement> getRouteOfAdministrations() {
if (routeOfAdministrations == null) { routeOfAdministrations = new ArrayList<>(); }
return routeOfAdministrations;
}
public boolean hasRouteOfAdministrations() {
return routeOfAdministrations != null && !routeOfAdministrations.isEmpty();
}
public boolean hasRouteOfAdministration(BackboneElement item) {
return hasRouteOfAdministrations() && routeOfAdministrations.contains(item);
}
public void removeRouteOfAdministration(BackboneElement item) {
if (hasRouteOfAdministration(item)) {
routeOfAdministrations.remove(item);
}
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
status = null;
formOfs.clear();
producedFroms.clear();
device = null;
properties.clear();
colors.clear();
flavors.clear();
scores.clear();
shapes.clear();
surfaceforms.clear();
sizes.clear();
images.clear();
imprints.clear();
routeOfAdministrations.clear();
}
}

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class AuthorizationIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-authorization-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-authorization-identifier|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -0,0 +1,764 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public class BundleUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/Bundle-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("1") @Max("1") @Doco("Persistent identifier for the bundle")
@Definition("Persistent identifier that remains the same for all versions of this ePI. The identifier remains the same regardless of any changes to the Bundle and regardless of any changes made to the Resources within the Bundle. This purpose of this identifier is to ensure all versions of an ePI can be collected as a set under a common parent identifier.")
private Identifier identifier;// @NotNull // Persistent identifier for the bundle
@Min("1") @Max("1") @Doco("document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/bundle-type|5.0.0")
@Definition("Indicates the purpose of this bundle - how it is intended to be used.")
private String type;// @NotNull // document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification
@Min("1") @Max("1") @Doco("Persistent original date of approval")
@Definition("Original date in which this ePI document received its first authorization. As with the identifier, this date persists across versions. ")
private Date timestamp;// @NotNull // Persistent original date of approval
@Min("0") @Max("1") @Doco("If search, the total number of matches")
@Definition("If a set of search matches, this is the (potentially estimated) total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.")
private int total; // If search, the total number of matches
@Min("0") @Max("*") @Doco("Links related to this Bundle")
@Definition("A series of links that provide context to this bundle.")
private List<BackboneElement> links = new ArrayList<>(); // Links related to this Bundle
@Min("1") @Max("*") @Doco("Entry resource in the ePI bundle")
@Definition("An entry resource included in the ePI document bundle resource.")
private List<BackboneElement> entries = new ArrayList<>();// @NotNull // Entry resource in the ePI bundle
@Min("1") @Max("1") @Doco("ePI Composition")
@Definition("ePI Composition")
private BackboneElement composition;// @NotNull // ePI Composition
@Min("0") @Max("*") @Doco("Organization")
@Definition("Organization")
private List<BackboneElement> organizations = new ArrayList<>(); // Organization
@Min("0") @Max("*") @Doco("Regulated Authorization")
@Definition("Regulated Authorization")
private List<BackboneElement> authorizations = new ArrayList<>(); // Regulated Authorization
@Min("0") @Max("*") @Doco("Medicinal Product")
@Definition("Medicinal Product Definition")
private List<BackboneElement> medicinalProducts = new ArrayList<>(); // Medicinal Product
@Min("0") @Max("*") @Doco("Packaged Product")
@Definition("Packaged Product Definition")
private List<BackboneElement> packagedProducts = new ArrayList<>(); // Packaged Product
@Min("0") @Max("*") @Doco("Administrable Product")
@Definition("Administrable Product Definition")
private List<BackboneElement> administrableProducts = new ArrayList<>(); // Administrable Product
@Min("0") @Max("*") @Doco("Manufactured Item")
@Definition("Manufactured Item Definition")
private List<BackboneElement> manufacturedItems = new ArrayList<>(); // Manufactured Item
@Min("0") @Max("*") @Doco("Ingredient")
@Definition("Ingredient")
private List<BackboneElement> ingredients = new ArrayList<>(); // Ingredient
@Min("0") @Max("*") @Doco("Interactions, Warnings, Indications,Contraindications")
@Definition("ePI ClinicalUseDefinition used for Interactions, Warnings,Indication, Contraindication")
private List<BackboneElement> clinicalUses = new ArrayList<>(); // Interactions, Warnings, Indications,Contraindications
@Min("0") @Max("*") @Doco("Substance Definition")
@Definition("Substance Definition")
private List<BackboneElement> substanceDefinitions = new ArrayList<>(); // Substance Definition
@Min("0") @Max("*") @Doco("Binary")
@Definition("Binary")
private List<BackboneElement> binaries = new ArrayList<>(); // Binary
@Min("0") @Max("1") @Doco("Issues with the Bundle")
@Definition("Captures issues and warnings that relate to the construction of the Bundle and the content within it.")
private OperationOutcome issues; // Issues with the Bundle
/**
* Parameter-less constructor.
*
*/
public BundleUvEpi() {
initFixedValues();
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public BundleUvEpi(IWorkerContext context) {
initFixedValues();
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static BundleUvEpi fromSource(IWorkerContext context, Bundle source) {
BundleUvEpi theThing = new BundleUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
if (src.hasChild("identifier")) {
identifier = (Identifier) src.child("identifier").asDataType();
}
if (src.hasChild("type")) {
type = src.child("type").asDataType().primitiveValue();
}
if (src.hasChild("timestamp")) {
timestamp = ((InstantType) src.child("timestamp").asDataType()).getValue();
}
if (src.hasChild("total")) {
total = ((UnsignedIntType) src.child("total").asDataType()).getValue();
}
for (PEInstance item : src.children("link")) {
links.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("entry")) {
entries.add((BackboneElement) item.asElement());
}
if (src.hasChild("composition")) {
composition = (BackboneElement) src.child("composition").asElement();
}
for (PEInstance item : src.children("organization")) {
organizations.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("authorization")) {
authorizations.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("medicinalProduct")) {
medicinalProducts.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("packagedProduct")) {
packagedProducts.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("administrableProduct")) {
administrableProducts.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("manufacturedItem")) {
manufacturedItems.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("ingredient")) {
ingredients.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("clinicalUse")) {
clinicalUses.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("substanceDefinition")) {
substanceDefinitions.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("binary")) {
binaries.add((BackboneElement) item.asElement());
}
if (src.hasChild("issues")) {
issues = (OperationOutcome) src.child("issues").asResource();
}
}
/**
* Build an instance of the object based on this source object
*
*/
public Bundle build(IWorkerContext context) {
workerContext = context;
Bundle theThing = new Bundle();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, Bundle dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("identifier");
if (identifier != null) {
tgt.addChild("identifier", identifier);
}
tgt.clear("type");
if (type != null) {
tgt.makeChild("type").data().setProperty("value", new CodeType(type));
}
tgt.clear("timestamp");
if (timestamp != null) {
tgt.addChild("timestamp", new InstantType(timestamp));
}
tgt.clear("total");
if (total != 0) {
tgt.makeChild("total").data().setProperty("value", new UnsignedIntType(total));
}
tgt.clear("link");
for (BackboneElement item : links) {
tgt.addChild("link", item);
}
tgt.clear("entry");
for (BackboneElement item : entries) {
tgt.addChild("entry", item);
}
tgt.clear("composition");
if (composition != null) {
tgt.addChild("composition", composition);
}
tgt.clear("organization");
for (BackboneElement item : organizations) {
tgt.addChild("organization", item);
}
tgt.clear("authorization");
for (BackboneElement item : authorizations) {
tgt.addChild("authorization", item);
}
tgt.clear("medicinalProduct");
for (BackboneElement item : medicinalProducts) {
tgt.addChild("medicinalProduct", item);
}
tgt.clear("packagedProduct");
for (BackboneElement item : packagedProducts) {
tgt.addChild("packagedProduct", item);
}
tgt.clear("administrableProduct");
for (BackboneElement item : administrableProducts) {
tgt.addChild("administrableProduct", item);
}
tgt.clear("manufacturedItem");
for (BackboneElement item : manufacturedItems) {
tgt.addChild("manufacturedItem", item);
}
tgt.clear("ingredient");
for (BackboneElement item : ingredients) {
tgt.addChild("ingredient", item);
}
tgt.clear("clinicalUse");
for (BackboneElement item : clinicalUses) {
tgt.addChild("clinicalUse", item);
}
tgt.clear("substanceDefinition");
for (BackboneElement item : substanceDefinitions) {
tgt.addChild("substanceDefinition", item);
}
tgt.clear("binary");
for (BackboneElement item : binaries) {
tgt.addChild("binary", item);
}
tgt.clear("issues");
if (issues != null) {
tgt.addChild("issues", issues);
}
}
private void initFixedValues() {
type = "document";
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public String getId() {
return id;
}
public BundleUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public Identifier getIdentifier() {
if (identifier == null) { identifier = new Identifier(); }
return identifier;
}
public BundleUvEpi setIdentifier(Identifier value) {
this.identifier = value;
return this;
}
public boolean hasIdentifier() {
return identifier != null;
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public String getType() {
return type;
}
public boolean hasType() {
return true;
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public Date getTimestamp() {
return timestamp;
}
public BundleUvEpi setTimestamp(Date value) {
this.timestamp = value;
return this;
}
public boolean hasTimestamp() {
return timestamp != null;
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public int getTotal() {
return total;
}
public BundleUvEpi setTotal(int value) {
this.total = value;
return this;
}
public boolean hasTotal() {
return total != 0;
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getLinks() {
if (links == null) { links = new ArrayList<>(); }
return links;
}
public boolean hasLinks() {
return links != null && !links.isEmpty();
}
public boolean hasLink(BackboneElement item) {
return hasLinks() && links.contains(item);
}
public void removeLink(BackboneElement item) {
if (hasLink(item)) {
links.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getEntries() {
if (entries == null) { entries = new ArrayList<>(); }
return entries;
}
public boolean hasEntries() {
return entries != null && !entries.isEmpty();
}
public boolean hasEntry(BackboneElement item) {
return hasEntries() && entries.contains(item);
}
public void removeEntry(BackboneElement item) {
if (hasEntry(item)) {
entries.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public @Nullable BackboneElement getComposition() { // BackboneElement is abstract
return composition;
}
public BundleUvEpi setComposition(BackboneElement value) {
this.composition = value;
return this;
}
public boolean hasComposition() {
return composition != null;
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getOrganizations() {
if (organizations == null) { organizations = new ArrayList<>(); }
return organizations;
}
public boolean hasOrganizations() {
return organizations != null && !organizations.isEmpty();
}
public boolean hasOrganization(BackboneElement item) {
return hasOrganizations() && organizations.contains(item);
}
public void removeOrganization(BackboneElement item) {
if (hasOrganization(item)) {
organizations.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getAuthorizations() {
if (authorizations == null) { authorizations = new ArrayList<>(); }
return authorizations;
}
public boolean hasAuthorizations() {
return authorizations != null && !authorizations.isEmpty();
}
public boolean hasAuthorization(BackboneElement item) {
return hasAuthorizations() && authorizations.contains(item);
}
public void removeAuthorization(BackboneElement item) {
if (hasAuthorization(item)) {
authorizations.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getMedicinalProducts() {
if (medicinalProducts == null) { medicinalProducts = new ArrayList<>(); }
return medicinalProducts;
}
public boolean hasMedicinalProducts() {
return medicinalProducts != null && !medicinalProducts.isEmpty();
}
public boolean hasMedicinalProduct(BackboneElement item) {
return hasMedicinalProducts() && medicinalProducts.contains(item);
}
public void removeMedicinalProduct(BackboneElement item) {
if (hasMedicinalProduct(item)) {
medicinalProducts.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getPackagedProducts() {
if (packagedProducts == null) { packagedProducts = new ArrayList<>(); }
return packagedProducts;
}
public boolean hasPackagedProducts() {
return packagedProducts != null && !packagedProducts.isEmpty();
}
public boolean hasPackagedProduct(BackboneElement item) {
return hasPackagedProducts() && packagedProducts.contains(item);
}
public void removePackagedProduct(BackboneElement item) {
if (hasPackagedProduct(item)) {
packagedProducts.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getAdministrableProducts() {
if (administrableProducts == null) { administrableProducts = new ArrayList<>(); }
return administrableProducts;
}
public boolean hasAdministrableProducts() {
return administrableProducts != null && !administrableProducts.isEmpty();
}
public boolean hasAdministrableProduct(BackboneElement item) {
return hasAdministrableProducts() && administrableProducts.contains(item);
}
public void removeAdministrableProduct(BackboneElement item) {
if (hasAdministrableProduct(item)) {
administrableProducts.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getManufacturedItems() {
if (manufacturedItems == null) { manufacturedItems = new ArrayList<>(); }
return manufacturedItems;
}
public boolean hasManufacturedItems() {
return manufacturedItems != null && !manufacturedItems.isEmpty();
}
public boolean hasManufacturedItem(BackboneElement item) {
return hasManufacturedItems() && manufacturedItems.contains(item);
}
public void removeManufacturedItem(BackboneElement item) {
if (hasManufacturedItem(item)) {
manufacturedItems.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getIngredients() {
if (ingredients == null) { ingredients = new ArrayList<>(); }
return ingredients;
}
public boolean hasIngredients() {
return ingredients != null && !ingredients.isEmpty();
}
public boolean hasIngredient(BackboneElement item) {
return hasIngredients() && ingredients.contains(item);
}
public void removeIngredient(BackboneElement item) {
if (hasIngredient(item)) {
ingredients.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getClinicalUses() {
if (clinicalUses == null) { clinicalUses = new ArrayList<>(); }
return clinicalUses;
}
public boolean hasClinicalUses() {
return clinicalUses != null && !clinicalUses.isEmpty();
}
public boolean hasClinicalUse(BackboneElement item) {
return hasClinicalUses() && clinicalUses.contains(item);
}
public void removeClinicalUse(BackboneElement item) {
if (hasClinicalUse(item)) {
clinicalUses.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getSubstanceDefinitions() {
if (substanceDefinitions == null) { substanceDefinitions = new ArrayList<>(); }
return substanceDefinitions;
}
public boolean hasSubstanceDefinitions() {
return substanceDefinitions != null && !substanceDefinitions.isEmpty();
}
public boolean hasSubstanceDefinition(BackboneElement item) {
return hasSubstanceDefinitions() && substanceDefinitions.contains(item);
}
public void removeSubstanceDefinition(BackboneElement item) {
if (hasSubstanceDefinition(item)) {
substanceDefinitions.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public List<BackboneElement> getBinaries() {
if (binaries == null) { binaries = new ArrayList<>(); }
return binaries;
}
public boolean hasBinaries() {
return binaries != null && !binaries.isEmpty();
}
public boolean hasBinary(BackboneElement item) {
return hasBinaries() && binaries.contains(item);
}
public void removeBinary(BackboneElement item) {
if (hasBinary(item)) {
binaries.remove(item);
}
}
/**
* Electronic Product Information Bundle Document. A container for the collection
* of resources that make up the ePI document.
*
*/
public OperationOutcome getIssues() {
if (issues == null) { issues = new OperationOutcome(); }
return issues;
}
public BundleUvEpi setIssues(OperationOutcome value) {
this.issues = value;
return this;
}
public boolean hasIssues() {
return issues != null;
}
public void clear() {
id = null;
identifier = null;
type = null;
timestamp = null;
total = 0;
links.clear();
entries.clear();
composition = null;
organizations.clear();
authorizations.clear();
medicinalProducts.clear();
packagedProducts.clear();
administrableProducts.clear();
manufacturedItems.clear();
ingredients.clear();
clinicalUses.clear();
substanceDefinitions.clear();
binaries.clear();
issues = null;
}
}

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class CVRIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-cvr-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-cvr-identifier|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -0,0 +1,415 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public class ClinicalUseDefinitionContraindicationUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/ClinicalUseDefinition-contraindication-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("0") @Max("*") @Doco("Business identifier for this clinical use.")
@Definition("Business identifier for this issue.")
private List<Identifier> identifiers = new ArrayList<>(); // Business identifier for this clinical use.
@Min("1") @Max("1") @Doco("indication | contraindication | interaction | undesirable-effect | warning")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/clinical-use-definition-type|5.0.0")
@Definition("indication | contraindication | interaction | undesirable-effect | warning.")
private String type;// @NotNull // indication | contraindication | interaction | undesirable-effect | warning
@Min("1") @Max("*") @Doco("The medication, product, substance, device, procedure etc. for which this is an indication")
@Definition("The medication, product, substance, device, procedure etc. for which this is an indication.")
private List<Reference> subjects = new ArrayList<>();// @NotNull // The medication, product, substance, device, procedure etc. for which this is an indication
@Min("1") @Max("1") @Doco("Specifics for when this is a contraindication")
@Definition("Specifics for when this is a contraindication.")
private BackboneElement contraindication;// @NotNull // Specifics for when this is a contraindication
@Min("0") @Max("*") @Doco("The population group to which this applies")
@Definition("The population group to which this applies.")
private List<Reference> populations = new ArrayList<>(); // The population group to which this applies
/**
* Parameter-less constructor.
*
*/
public ClinicalUseDefinitionContraindicationUvEpi() {
initFixedValues();
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public ClinicalUseDefinitionContraindicationUvEpi(IWorkerContext context) {
initFixedValues();
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static ClinicalUseDefinitionContraindicationUvEpi fromSource(IWorkerContext context, ClinicalUseDefinition source) {
ClinicalUseDefinitionContraindicationUvEpi theThing = new ClinicalUseDefinitionContraindicationUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("type")) {
type = src.child("type").asDataType().primitiveValue();
}
for (PEInstance item : src.children("subject")) {
subjects.add((Reference) item.asDataType());
}
if (src.hasChild("contraindication")) {
contraindication = (BackboneElement) src.child("contraindication").asElement();
}
for (PEInstance item : src.children("population")) {
populations.add((Reference) item.asDataType());
}
}
/**
* Build an instance of the object based on this source object
*
*/
public ClinicalUseDefinition build(IWorkerContext context) {
workerContext = context;
ClinicalUseDefinition theThing = new ClinicalUseDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, ClinicalUseDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("type");
if (type != null) {
tgt.makeChild("type").data().setProperty("value", new CodeType(type));
}
tgt.clear("subject");
for (Reference item : subjects) {
tgt.addChild("subject", item);
}
tgt.clear("contraindication");
if (contraindication != null) {
tgt.addChild("contraindication", contraindication);
}
tgt.clear("population");
for (Reference item : populations) {
tgt.addChild("population", item);
}
}
private void initFixedValues() {
type = "contraindication";
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getId() {
return id;
}
public ClinicalUseDefinitionContraindicationUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getType() {
return type;
}
public boolean hasType() {
return true;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getSubjects() {
if (subjects == null) { subjects = new ArrayList<>(); }
return subjects;
}
public boolean hasSubjects() {
return subjects != null && !subjects.isEmpty();
}
public Reference addSubject() {
Reference theThing = new Reference();
getSubjects().add(theThing);
return theThing;
}
public boolean hasSubject(Reference item) {
return hasSubjects() && subjects.contains(item);
}
public void removeSubject(Reference item) {
if (hasSubject(item)) {
subjects.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public @Nullable BackboneElement getContraindication() { // BackboneElement is abstract
return contraindication;
}
public ClinicalUseDefinitionContraindicationUvEpi setContraindication(BackboneElement value) {
this.contraindication = value;
return this;
}
public boolean hasContraindication() {
return contraindication != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getPopulations() {
if (populations == null) { populations = new ArrayList<>(); }
return populations;
}
public boolean hasPopulations() {
return populations != null && !populations.isEmpty();
}
public Reference addPopulation() {
Reference theThing = new Reference();
getPopulations().add(theThing);
return theThing;
}
public boolean hasPopulation(Reference item) {
return hasPopulations() && populations.contains(item);
}
public void removePopulation(Reference item) {
if (hasPopulation(item)) {
populations.remove(item);
}
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
type = null;
subjects.clear();
contraindication = null;
populations.clear();
}
}

View File

@ -0,0 +1,415 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public class ClinicalUseDefinitionIndicationUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/ClinicalUseDefinition-indication-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("0") @Max("*") @Doco("Business identifier for this clinical use.")
@Definition("Business identifier for this issue.")
private List<Identifier> identifiers = new ArrayList<>(); // Business identifier for this clinical use.
@Min("1") @Max("1") @Doco("indication | contraindication | interaction | undesirable-effect | warning")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/clinical-use-definition-type|5.0.0")
@Definition("indication | contraindication | interaction | undesirable-effect | warning.")
private String type;// @NotNull // indication | contraindication | interaction | undesirable-effect | warning
@Min("1") @Max("*") @Doco("The medication, product, substance, device, procedure etc. for which this is an indication")
@Definition("The medication, product, substance, device, procedure etc. for which this is an indication.")
private List<Reference> subjects = new ArrayList<>();// @NotNull // The medication, product, substance, device, procedure etc. for which this is an indication
@Min("1") @Max("1") @Doco("Specifics for when this is an indication")
@Definition("Specifics for when this is an indication.")
private BackboneElement indication;// @NotNull // Specifics for when this is an indication
@Min("0") @Max("*") @Doco("The population group to which this applies")
@Definition("The population group to which this applies.")
private List<Reference> populations = new ArrayList<>(); // The population group to which this applies
/**
* Parameter-less constructor.
*
*/
public ClinicalUseDefinitionIndicationUvEpi() {
initFixedValues();
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public ClinicalUseDefinitionIndicationUvEpi(IWorkerContext context) {
initFixedValues();
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static ClinicalUseDefinitionIndicationUvEpi fromSource(IWorkerContext context, ClinicalUseDefinition source) {
ClinicalUseDefinitionIndicationUvEpi theThing = new ClinicalUseDefinitionIndicationUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("type")) {
type = src.child("type").asDataType().primitiveValue();
}
for (PEInstance item : src.children("subject")) {
subjects.add((Reference) item.asDataType());
}
if (src.hasChild("indication")) {
indication = (BackboneElement) src.child("indication").asElement();
}
for (PEInstance item : src.children("population")) {
populations.add((Reference) item.asDataType());
}
}
/**
* Build an instance of the object based on this source object
*
*/
public ClinicalUseDefinition build(IWorkerContext context) {
workerContext = context;
ClinicalUseDefinition theThing = new ClinicalUseDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, ClinicalUseDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("type");
if (type != null) {
tgt.makeChild("type").data().setProperty("value", new CodeType(type));
}
tgt.clear("subject");
for (Reference item : subjects) {
tgt.addChild("subject", item);
}
tgt.clear("indication");
if (indication != null) {
tgt.addChild("indication", indication);
}
tgt.clear("population");
for (Reference item : populations) {
tgt.addChild("population", item);
}
}
private void initFixedValues() {
type = "indication";
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getId() {
return id;
}
public ClinicalUseDefinitionIndicationUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getType() {
return type;
}
public boolean hasType() {
return true;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getSubjects() {
if (subjects == null) { subjects = new ArrayList<>(); }
return subjects;
}
public boolean hasSubjects() {
return subjects != null && !subjects.isEmpty();
}
public Reference addSubject() {
Reference theThing = new Reference();
getSubjects().add(theThing);
return theThing;
}
public boolean hasSubject(Reference item) {
return hasSubjects() && subjects.contains(item);
}
public void removeSubject(Reference item) {
if (hasSubject(item)) {
subjects.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public @Nullable BackboneElement getIndication() { // BackboneElement is abstract
return indication;
}
public ClinicalUseDefinitionIndicationUvEpi setIndication(BackboneElement value) {
this.indication = value;
return this;
}
public boolean hasIndication() {
return indication != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getPopulations() {
if (populations == null) { populations = new ArrayList<>(); }
return populations;
}
public boolean hasPopulations() {
return populations != null && !populations.isEmpty();
}
public Reference addPopulation() {
Reference theThing = new Reference();
getPopulations().add(theThing);
return theThing;
}
public boolean hasPopulation(Reference item) {
return hasPopulations() && populations.contains(item);
}
public void removePopulation(Reference item) {
if (hasPopulation(item)) {
populations.remove(item);
}
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
type = null;
subjects.clear();
indication = null;
populations.clear();
}
}

View File

@ -0,0 +1,415 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public class ClinicalUseDefinitionInteractionUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/ClinicalUseDefinition-interaction-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("0") @Max("*") @Doco("Business identifier for this clinical use.")
@Definition("Business identifier for this issue.")
private List<Identifier> identifiers = new ArrayList<>(); // Business identifier for this clinical use.
@Min("1") @Max("1") @Doco("indication | contraindication | interaction | undesirable-effect | warning")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/clinical-use-definition-type|5.0.0")
@Definition("indication | contraindication | interaction | undesirable-effect | warning.")
private String type;// @NotNull // indication | contraindication | interaction | undesirable-effect | warning
@Min("1") @Max("*") @Doco("The medication, product, substance, device, procedure etc. for which this is an indication")
@Definition("The medication, product, substance, device, procedure etc. for which this is an indication.")
private List<Reference> subjects = new ArrayList<>();// @NotNull // The medication, product, substance, device, procedure etc. for which this is an indication
@Min("0") @Max("1") @Doco("Specifics for when this is an interaction")
@Definition("Specifics for when this is an interaction.")
private BackboneElement interaction; // Specifics for when this is an interaction
@Min("0") @Max("*") @Doco("The population group to which this applies")
@Definition("The population group to which this applies.")
private List<Reference> populations = new ArrayList<>(); // The population group to which this applies
/**
* Parameter-less constructor.
*
*/
public ClinicalUseDefinitionInteractionUvEpi() {
initFixedValues();
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public ClinicalUseDefinitionInteractionUvEpi(IWorkerContext context) {
initFixedValues();
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static ClinicalUseDefinitionInteractionUvEpi fromSource(IWorkerContext context, ClinicalUseDefinition source) {
ClinicalUseDefinitionInteractionUvEpi theThing = new ClinicalUseDefinitionInteractionUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("type")) {
type = src.child("type").asDataType().primitiveValue();
}
for (PEInstance item : src.children("subject")) {
subjects.add((Reference) item.asDataType());
}
if (src.hasChild("interaction")) {
interaction = (BackboneElement) src.child("interaction").asElement();
}
for (PEInstance item : src.children("population")) {
populations.add((Reference) item.asDataType());
}
}
/**
* Build an instance of the object based on this source object
*
*/
public ClinicalUseDefinition build(IWorkerContext context) {
workerContext = context;
ClinicalUseDefinition theThing = new ClinicalUseDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, ClinicalUseDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("type");
if (type != null) {
tgt.makeChild("type").data().setProperty("value", new CodeType(type));
}
tgt.clear("subject");
for (Reference item : subjects) {
tgt.addChild("subject", item);
}
tgt.clear("interaction");
if (interaction != null) {
tgt.addChild("interaction", interaction);
}
tgt.clear("population");
for (Reference item : populations) {
tgt.addChild("population", item);
}
}
private void initFixedValues() {
type = "interaction";
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getId() {
return id;
}
public ClinicalUseDefinitionInteractionUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getType() {
return type;
}
public boolean hasType() {
return true;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getSubjects() {
if (subjects == null) { subjects = new ArrayList<>(); }
return subjects;
}
public boolean hasSubjects() {
return subjects != null && !subjects.isEmpty();
}
public Reference addSubject() {
Reference theThing = new Reference();
getSubjects().add(theThing);
return theThing;
}
public boolean hasSubject(Reference item) {
return hasSubjects() && subjects.contains(item);
}
public void removeSubject(Reference item) {
if (hasSubject(item)) {
subjects.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public @Nullable BackboneElement getInteraction() { // BackboneElement is abstract
return interaction;
}
public ClinicalUseDefinitionInteractionUvEpi setInteraction(BackboneElement value) {
this.interaction = value;
return this;
}
public boolean hasInteraction() {
return interaction != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getPopulations() {
if (populations == null) { populations = new ArrayList<>(); }
return populations;
}
public boolean hasPopulations() {
return populations != null && !populations.isEmpty();
}
public Reference addPopulation() {
Reference theThing = new Reference();
getPopulations().add(theThing);
return theThing;
}
public boolean hasPopulation(Reference item) {
return hasPopulations() && populations.contains(item);
}
public void removePopulation(Reference item) {
if (hasPopulation(item)) {
populations.remove(item);
}
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
type = null;
subjects.clear();
interaction = null;
populations.clear();
}
}

View File

@ -0,0 +1,415 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public class ClinicalUseDefinitionUndesirableEffectUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/ClinicalUseDefinition-undesirableEffect-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("0") @Max("*") @Doco("Business identifier for this clinical use.")
@Definition("Business identifier for this issue.")
private List<Identifier> identifiers = new ArrayList<>(); // Business identifier for this clinical use.
@Min("1") @Max("1") @Doco("indication | contraindication | interaction | undesirable-effect | warning")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/clinical-use-definition-type|5.0.0")
@Definition("indication | contraindication | interaction | undesirable-effect | warning.")
private String type;// @NotNull // indication | contraindication | interaction | undesirable-effect | warning
@Min("1") @Max("*") @Doco("The medication, product, substance, device, procedure etc. for which this is an indication")
@Definition("The medication, product, substance, device, procedure etc. for which this is an indication.")
private List<Reference> subjects = new ArrayList<>();// @NotNull // The medication, product, substance, device, procedure etc. for which this is an indication
@Min("0") @Max("*") @Doco("The population group to which this applies")
@Definition("The population group to which this applies.")
private List<Reference> populations = new ArrayList<>(); // The population group to which this applies
@Min("1") @Max("1") @Doco("A possible negative outcome from the use of this treatment")
@Definition("Describe the possible undesirable effects (negative outcomes) from the use of the medicinal product as treatment.")
private BackboneElement undesirableEffect;// @NotNull // A possible negative outcome from the use of this treatment
/**
* Parameter-less constructor.
*
*/
public ClinicalUseDefinitionUndesirableEffectUvEpi() {
initFixedValues();
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public ClinicalUseDefinitionUndesirableEffectUvEpi(IWorkerContext context) {
initFixedValues();
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static ClinicalUseDefinitionUndesirableEffectUvEpi fromSource(IWorkerContext context, ClinicalUseDefinition source) {
ClinicalUseDefinitionUndesirableEffectUvEpi theThing = new ClinicalUseDefinitionUndesirableEffectUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("type")) {
type = src.child("type").asDataType().primitiveValue();
}
for (PEInstance item : src.children("subject")) {
subjects.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("population")) {
populations.add((Reference) item.asDataType());
}
if (src.hasChild("undesirableEffect")) {
undesirableEffect = (BackboneElement) src.child("undesirableEffect").asElement();
}
}
/**
* Build an instance of the object based on this source object
*
*/
public ClinicalUseDefinition build(IWorkerContext context) {
workerContext = context;
ClinicalUseDefinition theThing = new ClinicalUseDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, ClinicalUseDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("type");
if (type != null) {
tgt.makeChild("type").data().setProperty("value", new CodeType(type));
}
tgt.clear("subject");
for (Reference item : subjects) {
tgt.addChild("subject", item);
}
tgt.clear("population");
for (Reference item : populations) {
tgt.addChild("population", item);
}
tgt.clear("undesirableEffect");
if (undesirableEffect != null) {
tgt.addChild("undesirableEffect", undesirableEffect);
}
}
private void initFixedValues() {
type = "undesirable-effect";
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getId() {
return id;
}
public ClinicalUseDefinitionUndesirableEffectUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getType() {
return type;
}
public boolean hasType() {
return true;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getSubjects() {
if (subjects == null) { subjects = new ArrayList<>(); }
return subjects;
}
public boolean hasSubjects() {
return subjects != null && !subjects.isEmpty();
}
public Reference addSubject() {
Reference theThing = new Reference();
getSubjects().add(theThing);
return theThing;
}
public boolean hasSubject(Reference item) {
return hasSubjects() && subjects.contains(item);
}
public void removeSubject(Reference item) {
if (hasSubject(item)) {
subjects.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getPopulations() {
if (populations == null) { populations = new ArrayList<>(); }
return populations;
}
public boolean hasPopulations() {
return populations != null && !populations.isEmpty();
}
public Reference addPopulation() {
Reference theThing = new Reference();
getPopulations().add(theThing);
return theThing;
}
public boolean hasPopulation(Reference item) {
return hasPopulations() && populations.contains(item);
}
public void removePopulation(Reference item) {
if (hasPopulation(item)) {
populations.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public @Nullable BackboneElement getUndesirableEffect() { // BackboneElement is abstract
return undesirableEffect;
}
public ClinicalUseDefinitionUndesirableEffectUvEpi setUndesirableEffect(BackboneElement value) {
this.undesirableEffect = value;
return this;
}
public boolean hasUndesirableEffect() {
return undesirableEffect != null;
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
type = null;
subjects.clear();
populations.clear();
undesirableEffect = null;
}
}

View File

@ -0,0 +1,415 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public class ClinicalUseDefinitionWarningUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/ClinicalUseDefinition-warning-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("0") @Max("*") @Doco("Business identifier for this clinical use.")
@Definition("Business identifier for this issue.")
private List<Identifier> identifiers = new ArrayList<>(); // Business identifier for this clinical use.
@Min("1") @Max("1") @Doco("indication | contraindication | interaction | undesirable-effect | warning")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/clinical-use-definition-type|5.0.0")
@Definition("indication | contraindication | interaction | undesirable-effect | warning.")
private String type;// @NotNull // indication | contraindication | interaction | undesirable-effect | warning
@Min("1") @Max("*") @Doco("The medication, product, substance, device, procedure etc. for which this is an indication")
@Definition("The medication, product, substance, device, procedure etc. for which this is an indication.")
private List<Reference> subjects = new ArrayList<>();// @NotNull // The medication, product, substance, device, procedure etc. for which this is an indication
@Min("0") @Max("*") @Doco("The population group to which this applies")
@Definition("The population group to which this applies.")
private List<Reference> populations = new ArrayList<>(); // The population group to which this applies
@Min("1") @Max("1") @Doco("Critical environmental, health or physical risks or hazards. For example 'Do not operate heavy machinery', 'May cause drowsiness'")
@Definition("A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'.")
private BackboneElement warning;// @NotNull // Critical environmental, health or physical risks or hazards. For example 'Do not operate heavy machinery', 'May cause drowsiness'
/**
* Parameter-less constructor.
*
*/
public ClinicalUseDefinitionWarningUvEpi() {
initFixedValues();
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public ClinicalUseDefinitionWarningUvEpi(IWorkerContext context) {
initFixedValues();
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static ClinicalUseDefinitionWarningUvEpi fromSource(IWorkerContext context, ClinicalUseDefinition source) {
ClinicalUseDefinitionWarningUvEpi theThing = new ClinicalUseDefinitionWarningUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("type")) {
type = src.child("type").asDataType().primitiveValue();
}
for (PEInstance item : src.children("subject")) {
subjects.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("population")) {
populations.add((Reference) item.asDataType());
}
if (src.hasChild("warning")) {
warning = (BackboneElement) src.child("warning").asElement();
}
}
/**
* Build an instance of the object based on this source object
*
*/
public ClinicalUseDefinition build(IWorkerContext context) {
workerContext = context;
ClinicalUseDefinition theThing = new ClinicalUseDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, ClinicalUseDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("type");
if (type != null) {
tgt.makeChild("type").data().setProperty("value", new CodeType(type));
}
tgt.clear("subject");
for (Reference item : subjects) {
tgt.addChild("subject", item);
}
tgt.clear("population");
for (Reference item : populations) {
tgt.addChild("population", item);
}
tgt.clear("warning");
if (warning != null) {
tgt.addChild("warning", warning);
}
}
private void initFixedValues() {
type = "warning";
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getId() {
return id;
}
public ClinicalUseDefinitionWarningUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public String getType() {
return type;
}
public boolean hasType() {
return true;
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getSubjects() {
if (subjects == null) { subjects = new ArrayList<>(); }
return subjects;
}
public boolean hasSubjects() {
return subjects != null && !subjects.isEmpty();
}
public Reference addSubject() {
Reference theThing = new Reference();
getSubjects().add(theThing);
return theThing;
}
public boolean hasSubject(Reference item) {
return hasSubjects() && subjects.contains(item);
}
public void removeSubject(Reference item) {
if (hasSubject(item)) {
subjects.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public List<Reference> getPopulations() {
if (populations == null) { populations = new ArrayList<>(); }
return populations;
}
public boolean hasPopulations() {
return populations != null && !populations.isEmpty();
}
public Reference addPopulation() {
Reference theThing = new Reference();
getPopulations().add(theThing);
return theThing;
}
public boolean hasPopulation(Reference item) {
return hasPopulations() && populations.contains(item);
}
public void removePopulation(Reference item) {
if (hasPopulation(item)) {
populations.remove(item);
}
}
/**
* A single issue - either an indication, contraindication, interaction or an
* undesirable effect for a medicinal product, medication, device or procedure.
*
*/
public @Nullable BackboneElement getWarning() { // BackboneElement is abstract
return warning;
}
public ClinicalUseDefinitionWarningUvEpi setWarning(BackboneElement value) {
this.warning = value;
return this;
}
public boolean hasWarning() {
return warning != null;
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
type = null;
subjects.clear();
populations.clear();
warning = null;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Extension for the last date a Condition-instance was confirmed valid in its
@ -32,7 +32,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class ConditionLastAssertedDate extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/ConditionLastAssertedDate|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/ConditionLastAssertedDate|3.2.0";
/**

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Measurements and simple assertions made about a patient, device or other
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreBasicObservation extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-basic-observation|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-basic-observation|3.2.0";
@Min("0") @Max("1") @Doco("")
private String id; //

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A clinical condition, problem, diagnosis, or other event, situation, issue, or
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreCondition extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-condition|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-condition|3.2.0";
@Min("0") @Max("1") @Doco("")
private String id; //

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreCprIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-cpr-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-cpr-identifier|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreDeCprIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-d-ecpr-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-d-ecpr-identifier|3.2.0";
public enum DkCoreDeCPRValueSet {
URNOID122081761613, // "D-eCPR" = http://hl7.dk/fhir/core/CodeSystem/dk-core-d-ecpr-codes#urn:oid:1.2.208.176.1.6.1.3

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Measurements and simple assertions made about a patient, device or other
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreObservation extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-observation|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-observation|3.2.0";
@Min("0") @Max("1") @Doco("")
private String id; //

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A formally or informally recognized grouping of people or organizations formed
@ -33,7 +33,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreOrganization extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-organization|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-organization|3.2.0";
@Min("0") @Max("1") @Doco("")
private String id; //

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Demographics and other administrative information about an individual or animal
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCorePatient extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-patient|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-patient|3.2.0";
@Min("0") @Max("1") @Doco("")
private String id; //

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A person who is directly or indirectly involved in the provisioning of
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCorePractitioner extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-practitioner|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-practitioner|3.2.0";
@Min("0") @Max("1") @Doco("")
private String id; //

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Information about a person that is involved in the care for a patient, but who
@ -32,7 +32,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreRelatedPerson extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-related-person|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-related-person|3.2.0";
@Min("0") @Max("1") @Doco("")
private String id; //

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class DkCoreXeCprIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-x-ecpr-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-x-ecpr-identifier|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class GLNIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-gln-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-gln-identifier|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -0,0 +1,522 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public class IngredientUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/Ingredient-uv-epi|1.0.0";
public enum PublicationStatus {
DRAFT, // "Draft" = http://hl7.org/fhir/publication-status#draft
ACTIVE, // "Active" = http://hl7.org/fhir/publication-status#active
RETIRED, // "Retired" = http://hl7.org/fhir/publication-status#retired
UNKNOWN; // "Unknown" = http://hl7.org/fhir/publication-status#unknown
public static PublicationStatus fromCode(String s) {
switch (s) {
case "draft": return DRAFT;
case "active": return ACTIVE;
case "retired": return RETIRED;
case "unknown": return UNKNOWN;
default: return null;
}
}
public static PublicationStatus fromCoding(Coding c) {
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "draft".equals(c.getCode())) {
return DRAFT;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "active".equals(c.getCode())) {
return ACTIVE;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "retired".equals(c.getCode())) {
return RETIRED;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "unknown".equals(c.getCode())) {
return UNKNOWN;
}
return null;
}
public static PublicationStatus fromCodeableConcept(CodeableConcept cc) {
for (Coding c : cc.getCoding()) {
PublicationStatus v = fromCoding(c);
if (v != null) {
return v;
}
}
return null;
}
public String toDisplay() {
switch (this) {
case DRAFT: return "Draft";
case ACTIVE: return "Active";
case RETIRED: return "Retired";
case UNKNOWN: return "Unknown";
default: return null;
}
}
public String toCode() {
switch (this) {
case DRAFT: return "draft";
case ACTIVE: return "active";
case RETIRED: return "retired";
case UNKNOWN: return "unknown";
default: return null;
}
}
public Coding toCoding() {
switch (this) {
case DRAFT: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("draft");
case ACTIVE: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("active");
case RETIRED: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("retired");
case UNKNOWN: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("unknown");
default: return null;
}
}
public CodeableConcept toCodeableConcept() {
Coding c = toCoding();
return c == null ? null : new CodeableConcept().addCoding(c);
}
}
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("0") @Max("1") @Doco("An identifier or code by which the ingredient can be referenced.")
@Definition("The identifier(s) of this Ingredient that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.")
private Identifier identifier; // An identifier or code by which the ingredient can be referenced.
@Min("1") @Max("1") @Doco("draft|active|retired|unknown")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/publication-status|5.0.0")
@Definition("The status of this ingredient. Enables tracking the life-cycle of the content.")
private PublicationStatus status;// @NotNull // draft|active|retired|unknown
@Min("0") @Max("*") @Doco("The product which this ingredient is a constituent part of")
@Definition("The product which this ingredient is a constituent part of.")
private List<Reference> _fors = new ArrayList<>(); // The product which this ingredient is a constituent part of
@Min("1") @Max("1") @Doco("Purpose of the ingredient within the product, e.g. active, inactive")
@BindingStrength("example") @ValueSet("http://hl7.org/fhir/uv/emedicinal-product-info/ValueSet/ingredientRole")
@Definition("A classification of the ingredient identifying its purpose within the product, e.g. active, inactive.")
private CodeableConcept role;// @NotNull // Purpose of the ingredient within the product, e.g. active, inactive
@Min("0") @Max("1") @Doco("If the ingredient is a known or suspected allergen.")
@Definition("If the ingredient is a known or suspected allergen. Note that this is a property of the substance, so if a reference to a SubstanceDefinition is used to decribe that (rather than just a code), the allergen information should go there, not here.")
private boolean allergenicIndicator; // If the ingredient is a known or suspected allergen.
@Min("0") @Max("*") @Doco("An organization that manufactures this ingredient")
@Definition("The organization(s) that manufacture this ingredient. Can be used to indicate: 1) Organizations we are aware of that manufacture this ingredient 2) Specific Manufacturer(s) currently being used 3) Set of organisations allowed to manufacture this ingredient for this product Users must be clear on the application of context relevant to their use case.")
private List<BackboneElement> manufacturers = new ArrayList<>(); // An organization that manufactures this ingredient
@Min("1") @Max("1") @Doco("The substance that comprises this ingredient")
@Definition("The substance that comprises this ingredient.")
private BackboneElement substance;// @NotNull // The substance that comprises this ingredient
/**
* Parameter-less constructor.
*
*/
public IngredientUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public IngredientUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static IngredientUvEpi fromSource(IWorkerContext context, Ingredient source) {
IngredientUvEpi theThing = new IngredientUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
if (src.hasChild("identifier")) {
identifier = (Identifier) src.child("identifier").asDataType();
}
if (src.hasChild("status")) {
status = PublicationStatus.fromCode(src.child("status").asDataType().primitiveValue());
}
for (PEInstance item : src.children("_for")) {
_fors.add((Reference) item.asDataType());
}
if (src.hasChild("role")) {
role = (CodeableConcept) src.child("role").asDataType();
}
if (src.hasChild("allergenicIndicator")) {
allergenicIndicator = ((BooleanType) src.child("allergenicIndicator").asDataType()).getValue();
}
for (PEInstance item : src.children("manufacturer")) {
manufacturers.add((BackboneElement) item.asElement());
}
if (src.hasChild("substance")) {
substance = (BackboneElement) src.child("substance").asElement();
}
}
/**
* Build an instance of the object based on this source object
*
*/
public Ingredient build(IWorkerContext context) {
workerContext = context;
Ingredient theThing = new Ingredient();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, Ingredient dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
if (identifier != null) {
tgt.addChild("identifier", identifier);
}
tgt.clear("status");
if (status != null) {
tgt.addChild("status", status.toCode());
}
tgt.clear("_for");
for (Reference item : _fors) {
tgt.addChild("_for", item);
}
tgt.clear("role");
if (role != null) {
tgt.addChild("role", role);
}
tgt.clear("allergenicIndicator");
if (true) { // for now, at least
tgt.makeChild("allergenicIndicator").data().setProperty("value", new BooleanType(allergenicIndicator));
}
tgt.clear("manufacturer");
for (BackboneElement item : manufacturers) {
tgt.addChild("manufacturer", item);
}
tgt.clear("substance");
if (substance != null) {
tgt.addChild("substance", substance);
}
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public String getId() {
return id;
}
public IngredientUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public Identifier getIdentifier() {
if (identifier == null) { identifier = new Identifier(); }
return identifier;
}
public IngredientUvEpi setIdentifier(Identifier value) {
this.identifier = value;
return this;
}
public boolean hasIdentifier() {
return identifier != null;
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public PublicationStatus getStatus() {
return status;
}
public IngredientUvEpi setStatus(PublicationStatus value) {
this.status = value;
return this;
}
public boolean hasStatus() {
return status != null;
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public List<Reference> get_fors() {
if (_fors == null) { _fors = new ArrayList<>(); }
return _fors;
}
public boolean has_fors() {
return _fors != null && !_fors.isEmpty();
}
public Reference add_for() {
Reference theThing = new Reference();
get_fors().add(theThing);
return theThing;
}
public boolean has_for(Reference item) {
return has_fors() && _fors.contains(item);
}
public void remove_for(Reference item) {
if (has_for(item)) {
_fors.remove(item);
}
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public CodeableConcept getRole() {
if (role == null) { role = new CodeableConcept(); }
return role;
}
public IngredientUvEpi setRole(CodeableConcept value) {
this.role = value;
return this;
}
public boolean hasRole() {
return role != null;
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public boolean getAllergenicIndicator() {
return allergenicIndicator;
}
public IngredientUvEpi setAllergenicIndicator(boolean value) {
this.allergenicIndicator = value;
return this;
}
public boolean hasAllergenicIndicator() {
return true; // not allergenicIndicator != false ?
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public List<BackboneElement> getManufacturers() {
if (manufacturers == null) { manufacturers = new ArrayList<>(); }
return manufacturers;
}
public boolean hasManufacturers() {
return manufacturers != null && !manufacturers.isEmpty();
}
public boolean hasManufacturer(BackboneElement item) {
return hasManufacturers() && manufacturers.contains(item);
}
public void removeManufacturer(BackboneElement item) {
if (hasManufacturer(item)) {
manufacturers.remove(item);
}
}
/**
* An ingredient of a manufactured item or pharmaceutical product.
*
*/
public @Nullable BackboneElement getSubstance() { // BackboneElement is abstract
return substance;
}
public IngredientUvEpi setSubstance(BackboneElement value) {
this.substance = value;
return this;
}
public boolean hasSubstance() {
return substance != null;
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifier = null;
status = null;
_fors.clear();
role = null;
allergenicIndicator = false;
manufacturers.clear();
substance = null;
}
}

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class KombitOrgIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-kombit-org-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-kombit-org-identifier|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -0,0 +1,863 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public class ManufacturedItemDefinitionUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/ManufacturedItemDefinition-uv-epi|1.0.0";
public enum PublicationStatus {
DRAFT, // "Draft" = http://hl7.org/fhir/publication-status#draft
ACTIVE, // "Active" = http://hl7.org/fhir/publication-status#active
RETIRED, // "Retired" = http://hl7.org/fhir/publication-status#retired
UNKNOWN; // "Unknown" = http://hl7.org/fhir/publication-status#unknown
public static PublicationStatus fromCode(String s) {
switch (s) {
case "draft": return DRAFT;
case "active": return ACTIVE;
case "retired": return RETIRED;
case "unknown": return UNKNOWN;
default: return null;
}
}
public static PublicationStatus fromCoding(Coding c) {
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "draft".equals(c.getCode())) {
return DRAFT;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "active".equals(c.getCode())) {
return ACTIVE;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "retired".equals(c.getCode())) {
return RETIRED;
}
if ("http://hl7.org/fhir/publication-status".equals(c.getSystem()) && "unknown".equals(c.getCode())) {
return UNKNOWN;
}
return null;
}
public static PublicationStatus fromCodeableConcept(CodeableConcept cc) {
for (Coding c : cc.getCoding()) {
PublicationStatus v = fromCoding(c);
if (v != null) {
return v;
}
}
return null;
}
public String toDisplay() {
switch (this) {
case DRAFT: return "Draft";
case ACTIVE: return "Active";
case RETIRED: return "Retired";
case UNKNOWN: return "Unknown";
default: return null;
}
}
public String toCode() {
switch (this) {
case DRAFT: return "draft";
case ACTIVE: return "active";
case RETIRED: return "retired";
case UNKNOWN: return "unknown";
default: return null;
}
}
public Coding toCoding() {
switch (this) {
case DRAFT: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("draft");
case ACTIVE: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("active");
case RETIRED: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("retired");
case UNKNOWN: return new Coding().setSystem("http://hl7.org/fhir/publication-status").setCode("unknown");
default: return null;
}
}
public CodeableConcept toCodeableConcept() {
Coding c = toCoding();
return c == null ? null : new CodeableConcept().addCoding(c);
}
}
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("1") @Max("*") @Doco("Unique identifier")
@Definition("Unique identifier.")
private List<Identifier> identifiers = new ArrayList<>();// @NotNull // Unique identifier
@Min("1") @Max("1") @Doco("draft|active|retired|unknown")
@BindingStrength("required") @ValueSet("http://hl7.org/fhir/ValueSet/publication-status|5.0.0")
@Definition("The status of this item. Enables tracking the life-cycle of the content.")
private PublicationStatus status;// @NotNull // draft|active|retired|unknown
@Min("1") @Max("1") @Doco("Dose form as manufactured (before any necessary transformation)")
@BindingStrength("example") @ValueSet("http://hl7.org/fhir/uv/emedicinal-product-info/ValueSet/manufacturedDoseForm")
@Definition("Dose form as manufactured and before any transformation into the pharmaceutical product.")
private CodeableConcept manufacturedDoseForm;// @NotNull // Dose form as manufactured (before any necessary transformation)
@Min("0") @Max("*") @Doco("Manufacturer of the item, one of several possible")
@Definition("Manufacturer of the item, one of several possible.")
private List<Reference> manufacturers = new ArrayList<>(); // Manufacturer of the item, one of several possible
@Min("0") @Max("*") @Doco("Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated")
@Definition("Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.")
private List<MarketingStatus> marketingStatuses = new ArrayList<>(); // Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> properties = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> colors = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> flavors = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> scores = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> shapes = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> surfaceforms = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> sizes = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> images = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("General characteristics of this item")
@Definition("General characteristics of this item.")
private List<BackboneElement> imprints = new ArrayList<>(); // General characteristics of this item
@Min("0") @Max("*") @Doco("Physical parts of the manufactured item, that it is intrisically made from. This is distinct from the ingredients that are part of its chemical makeup")
@Definition("Physical parts of the manufactured item, that it is intrisically made from. This is distinct from the ingredients that are part of its chemical makeup.")
private List<BackboneElement> components = new ArrayList<>(); // Physical parts of the manufactured item, that it is intrisically made from. This is distinct from the ingredients that are part of its chemical makeup
/**
* Parameter-less constructor.
*
*/
public ManufacturedItemDefinitionUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public ManufacturedItemDefinitionUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static ManufacturedItemDefinitionUvEpi fromSource(IWorkerContext context, ManufacturedItemDefinition source) {
ManufacturedItemDefinitionUvEpi theThing = new ManufacturedItemDefinitionUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("status")) {
status = PublicationStatus.fromCode(src.child("status").asDataType().primitiveValue());
}
if (src.hasChild("manufacturedDoseForm")) {
manufacturedDoseForm = (CodeableConcept) src.child("manufacturedDoseForm").asDataType();
}
for (PEInstance item : src.children("manufacturer")) {
manufacturers.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("marketingStatus")) {
marketingStatuses.add((MarketingStatus) item.asDataType());
}
for (PEInstance item : src.children("property")) {
properties.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("color")) {
colors.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("flavor")) {
flavors.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("score")) {
scores.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("shape")) {
shapes.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("surfaceform")) {
surfaceforms.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("size")) {
sizes.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("image")) {
images.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("imprint")) {
imprints.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("component")) {
components.add((BackboneElement) item.asElement());
}
}
/**
* Build an instance of the object based on this source object
*
*/
public ManufacturedItemDefinition build(IWorkerContext context) {
workerContext = context;
ManufacturedItemDefinition theThing = new ManufacturedItemDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, ManufacturedItemDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("status");
if (status != null) {
tgt.addChild("status", status.toCode());
}
tgt.clear("manufacturedDoseForm");
if (manufacturedDoseForm != null) {
tgt.addChild("manufacturedDoseForm", manufacturedDoseForm);
}
tgt.clear("manufacturer");
for (Reference item : manufacturers) {
tgt.addChild("manufacturer", item);
}
tgt.clear("marketingStatus");
for (MarketingStatus item : marketingStatuses) {
tgt.addChild("marketingStatus", item);
}
tgt.clear("property");
for (BackboneElement item : properties) {
tgt.addChild("property", item);
}
tgt.clear("color");
for (BackboneElement item : colors) {
tgt.addChild("color", item);
}
tgt.clear("flavor");
for (BackboneElement item : flavors) {
tgt.addChild("flavor", item);
}
tgt.clear("score");
for (BackboneElement item : scores) {
tgt.addChild("score", item);
}
tgt.clear("shape");
for (BackboneElement item : shapes) {
tgt.addChild("shape", item);
}
tgt.clear("surfaceform");
for (BackboneElement item : surfaceforms) {
tgt.addChild("surfaceform", item);
}
tgt.clear("size");
for (BackboneElement item : sizes) {
tgt.addChild("size", item);
}
tgt.clear("image");
for (BackboneElement item : images) {
tgt.addChild("image", item);
}
tgt.clear("imprint");
for (BackboneElement item : imprints) {
tgt.addChild("imprint", item);
}
tgt.clear("component");
for (BackboneElement item : components) {
tgt.addChild("component", item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public String getId() {
return id;
}
public ManufacturedItemDefinitionUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public PublicationStatus getStatus() {
return status;
}
public ManufacturedItemDefinitionUvEpi setStatus(PublicationStatus value) {
this.status = value;
return this;
}
public boolean hasStatus() {
return status != null;
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public CodeableConcept getManufacturedDoseForm() {
if (manufacturedDoseForm == null) { manufacturedDoseForm = new CodeableConcept(); }
return manufacturedDoseForm;
}
public ManufacturedItemDefinitionUvEpi setManufacturedDoseForm(CodeableConcept value) {
this.manufacturedDoseForm = value;
return this;
}
public boolean hasManufacturedDoseForm() {
return manufacturedDoseForm != null;
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<Reference> getManufacturers() {
if (manufacturers == null) { manufacturers = new ArrayList<>(); }
return manufacturers;
}
public boolean hasManufacturers() {
return manufacturers != null && !manufacturers.isEmpty();
}
public Reference addManufacturer() {
Reference theThing = new Reference();
getManufacturers().add(theThing);
return theThing;
}
public boolean hasManufacturer(Reference item) {
return hasManufacturers() && manufacturers.contains(item);
}
public void removeManufacturer(Reference item) {
if (hasManufacturer(item)) {
manufacturers.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<MarketingStatus> getMarketingStatuses() {
if (marketingStatuses == null) { marketingStatuses = new ArrayList<>(); }
return marketingStatuses;
}
public boolean hasMarketingStatuses() {
return marketingStatuses != null && !marketingStatuses.isEmpty();
}
public MarketingStatus addMarketingStatus() {
MarketingStatus theThing = new MarketingStatus();
getMarketingStatuses().add(theThing);
return theThing;
}
public boolean hasMarketingStatus(MarketingStatus item) {
return hasMarketingStatuses() && marketingStatuses.contains(item);
}
public void removeMarketingStatus(MarketingStatus item) {
if (hasMarketingStatus(item)) {
marketingStatuses.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getProperties() {
if (properties == null) { properties = new ArrayList<>(); }
return properties;
}
public boolean hasProperties() {
return properties != null && !properties.isEmpty();
}
public boolean hasProperty(BackboneElement item) {
return hasProperties() && properties.contains(item);
}
public void removeProperty(BackboneElement item) {
if (hasProperty(item)) {
properties.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getColors() {
if (colors == null) { colors = new ArrayList<>(); }
return colors;
}
public boolean hasColors() {
return colors != null && !colors.isEmpty();
}
public boolean hasColor(BackboneElement item) {
return hasColors() && colors.contains(item);
}
public void removeColor(BackboneElement item) {
if (hasColor(item)) {
colors.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getFlavors() {
if (flavors == null) { flavors = new ArrayList<>(); }
return flavors;
}
public boolean hasFlavors() {
return flavors != null && !flavors.isEmpty();
}
public boolean hasFlavor(BackboneElement item) {
return hasFlavors() && flavors.contains(item);
}
public void removeFlavor(BackboneElement item) {
if (hasFlavor(item)) {
flavors.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getScores() {
if (scores == null) { scores = new ArrayList<>(); }
return scores;
}
public boolean hasScores() {
return scores != null && !scores.isEmpty();
}
public boolean hasScore(BackboneElement item) {
return hasScores() && scores.contains(item);
}
public void removeScore(BackboneElement item) {
if (hasScore(item)) {
scores.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getShapes() {
if (shapes == null) { shapes = new ArrayList<>(); }
return shapes;
}
public boolean hasShapes() {
return shapes != null && !shapes.isEmpty();
}
public boolean hasShape(BackboneElement item) {
return hasShapes() && shapes.contains(item);
}
public void removeShape(BackboneElement item) {
if (hasShape(item)) {
shapes.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getSurfaceforms() {
if (surfaceforms == null) { surfaceforms = new ArrayList<>(); }
return surfaceforms;
}
public boolean hasSurfaceforms() {
return surfaceforms != null && !surfaceforms.isEmpty();
}
public boolean hasSurfaceform(BackboneElement item) {
return hasSurfaceforms() && surfaceforms.contains(item);
}
public void removeSurfaceform(BackboneElement item) {
if (hasSurfaceform(item)) {
surfaceforms.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getSizes() {
if (sizes == null) { sizes = new ArrayList<>(); }
return sizes;
}
public boolean hasSizes() {
return sizes != null && !sizes.isEmpty();
}
public boolean hasSize(BackboneElement item) {
return hasSizes() && sizes.contains(item);
}
public void removeSize(BackboneElement item) {
if (hasSize(item)) {
sizes.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getImages() {
if (images == null) { images = new ArrayList<>(); }
return images;
}
public boolean hasImages() {
return images != null && !images.isEmpty();
}
public boolean hasImage(BackboneElement item) {
return hasImages() && images.contains(item);
}
public void removeImage(BackboneElement item) {
if (hasImage(item)) {
images.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getImprints() {
if (imprints == null) { imprints = new ArrayList<>(); }
return imprints;
}
public boolean hasImprints() {
return imprints != null && !imprints.isEmpty();
}
public boolean hasImprint(BackboneElement item) {
return hasImprints() && imprints.contains(item);
}
public void removeImprint(BackboneElement item) {
if (hasImprint(item)) {
imprints.remove(item);
}
}
/**
* The definition and characteristics of a medicinal manufactured item, such as a
* tablet or capsule, as contained in a packaged medicinal product.
*
*/
public List<BackboneElement> getComponents() {
if (components == null) { components = new ArrayList<>(); }
return components;
}
public boolean hasComponents() {
return components != null && !components.isEmpty();
}
public boolean hasComponent(BackboneElement item) {
return hasComponents() && components.contains(item);
}
public void removeComponent(BackboneElement item) {
if (hasComponent(item)) {
components.remove(item);
}
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
status = null;
manufacturedDoseForm = null;
manufacturers.clear();
marketingStatuses.clear();
properties.clear();
colors.clear();
flavors.clear();
scores.clear();
shapes.clear();
surfaceforms.clear();
sizes.clear();
images.clear();
imprints.clear();
components.clear();
}
}

View File

@ -0,0 +1,775 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public class MedicinalProductDefinitionUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/MedicinalProductDefinition-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("1") @Max("*") @Doco("Business identifier for this product. Could be an MPID")
@Definition("Business identifier for this product. Could be an MPID. When in development or being regulated, products are typically referenced by official identifiers, assigned by a manufacturer or regulator, and unique to a product (which, when compared to a product instance being prescribed, is actually a product type). See also MedicinalProductDefinition.code.")
private List<Identifier> identifiers = new ArrayList<>();// @NotNull // Business identifier for this product. Could be an MPID
@Min("0") @Max("*") @Doco("Marketing status of the medicinal product, in contrast to marketing authorization")
@Definition("Marketing status of the medicinal product, in contrast to marketing authorization. This refers to the product being actually 'on the market' as opposed to being allowed to be on the market (which is an authorization).")
private List<MarketingStatus> marketingStatuses = new ArrayList<>(); // Marketing status of the medicinal product, in contrast to marketing authorization
@Min("0") @Max("*") @Doco("Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes")
@Definition("Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes. Used as a direct link when the item's packaging is not being recorded (see also PackagedProductDefinition.package.containedItem.item).")
private List<Reference> comprisedOfs = new ArrayList<>(); // Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes
@Min("0") @Max("*") @Doco("Additional documentation about the medicinal product")
@Definition("Additional information or supporting documentation about the medicinal product.")
private List<Reference> attachedDocuments = new ArrayList<>(); // Additional documentation about the medicinal product
@Min("0") @Max("*") @Doco("A master file for the medicinal product (e.g. Pharmacovigilance System Master File)")
@Definition("A master file for the medicinal product (e.g. Pharmacovigilance System Master File). Drug master files (DMFs) are documents submitted to regulatory agencies to provide confidential detailed information about facilities, processes or articles used in the manufacturing, processing, packaging and storing of drug products.")
private List<Reference> masterFiles = new ArrayList<>(); // A master file for the medicinal product (e.g. Pharmacovigilance System Master File)
@Min("0") @Max("*") @Doco("A product specific contact, person (in a role), or an organization")
@Definition("A product specific contact, person (in a role), or an organization.")
private List<BackboneElement> contacts = new ArrayList<>(); // A product specific contact, person (in a role), or an organization
@Min("0") @Max("*") @Doco("Clinical trials or studies that this product is involved in")
@Definition("Clinical trials or studies that this product is involved in.")
private List<Reference> clinicalTrials = new ArrayList<>(); // Clinical trials or studies that this product is involved in
@Min("0") @Max("*") @Doco("A code that this product is known by, within some formal terminology")
@BindingStrength("example") @ValueSet("http://hl7.org/fhir/ValueSet/medication-codes")
@Definition("A code that this product is known by, usually within some formal terminology, perhaps assigned by a third party (i.e. not the manufacturer or regulator). Products (types of medications) tend to be known by identifiers during development and within regulatory process. However when they are prescribed they tend to be identified by codes. The same product may be have multiple codes, applied to it by multiple organizations.")
private List<Coding> codes = new ArrayList<>(); // A code that this product is known by, within some formal terminology
@Min("1") @Max("*") @Doco("The product's name, including full name and possibly coded parts")
@Definition("The product's name, including full name and possibly coded parts.")
private List<BackboneElement> names = new ArrayList<>();// @NotNull // The product's name, including full name and possibly coded parts
@Min("0") @Max("*") @Doco("Reference to another product, e.g. for linking authorised to investigational product")
@Definition("Reference to another product, e.g. for linking authorised to investigational product, or a virtual product.")
private List<BackboneElement> crossReferences = new ArrayList<>(); // Reference to another product, e.g. for linking authorised to investigational product
@Min("0") @Max("*") @Doco("A manufacturing or administrative process for the medicinal product")
@Definition("A manufacturing or administrative process or step associated with (or performed on) the medicinal product.")
private List<BackboneElement> operations = new ArrayList<>(); // A manufacturing or administrative process for the medicinal product
@Min("0") @Max("*") @Doco("Key product features such as \"sugar free\", \"modified release\"")
@Definition("Allows the key product features to be recorded, such as \"sugar free\", \"modified release\", \"parallel import\".")
private List<BackboneElement> characteristics = new ArrayList<>(); // Key product features such as "sugar free", "modified release"
/**
* Parameter-less constructor.
*
*/
public MedicinalProductDefinitionUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public MedicinalProductDefinitionUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static MedicinalProductDefinitionUvEpi fromSource(IWorkerContext context, MedicinalProductDefinition source) {
MedicinalProductDefinitionUvEpi theThing = new MedicinalProductDefinitionUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
for (PEInstance item : src.children("marketingStatus")) {
marketingStatuses.add((MarketingStatus) item.asDataType());
}
for (PEInstance item : src.children("comprisedOf")) {
comprisedOfs.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("attachedDocument")) {
attachedDocuments.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("masterFile")) {
masterFiles.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("contact")) {
contacts.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("clinicalTrial")) {
clinicalTrials.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("code")) {
codes.add((Coding) item.asDataType());
}
for (PEInstance item : src.children("name")) {
names.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("crossReference")) {
crossReferences.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("operation")) {
operations.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("characteristic")) {
characteristics.add((BackboneElement) item.asElement());
}
}
/**
* Build an instance of the object based on this source object
*
*/
public MedicinalProductDefinition build(IWorkerContext context) {
workerContext = context;
MedicinalProductDefinition theThing = new MedicinalProductDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, MedicinalProductDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("marketingStatus");
for (MarketingStatus item : marketingStatuses) {
tgt.addChild("marketingStatus", item);
}
tgt.clear("comprisedOf");
for (Reference item : comprisedOfs) {
tgt.addChild("comprisedOf", item);
}
tgt.clear("attachedDocument");
for (Reference item : attachedDocuments) {
tgt.addChild("attachedDocument", item);
}
tgt.clear("masterFile");
for (Reference item : masterFiles) {
tgt.addChild("masterFile", item);
}
tgt.clear("contact");
for (BackboneElement item : contacts) {
tgt.addChild("contact", item);
}
tgt.clear("clinicalTrial");
for (Reference item : clinicalTrials) {
tgt.addChild("clinicalTrial", item);
}
tgt.clear("code");
for (Coding item : codes) {
tgt.addChild("code", item);
}
tgt.clear("name");
for (BackboneElement item : names) {
tgt.addChild("name", item);
}
tgt.clear("crossReference");
for (BackboneElement item : crossReferences) {
tgt.addChild("crossReference", item);
}
tgt.clear("operation");
for (BackboneElement item : operations) {
tgt.addChild("operation", item);
}
tgt.clear("characteristic");
for (BackboneElement item : characteristics) {
tgt.addChild("characteristic", item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public String getId() {
return id;
}
public MedicinalProductDefinitionUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<MarketingStatus> getMarketingStatuses() {
if (marketingStatuses == null) { marketingStatuses = new ArrayList<>(); }
return marketingStatuses;
}
public boolean hasMarketingStatuses() {
return marketingStatuses != null && !marketingStatuses.isEmpty();
}
public MarketingStatus addMarketingStatus() {
MarketingStatus theThing = new MarketingStatus();
getMarketingStatuses().add(theThing);
return theThing;
}
public boolean hasMarketingStatus(MarketingStatus item) {
return hasMarketingStatuses() && marketingStatuses.contains(item);
}
public void removeMarketingStatus(MarketingStatus item) {
if (hasMarketingStatus(item)) {
marketingStatuses.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Reference> getComprisedOfs() {
if (comprisedOfs == null) { comprisedOfs = new ArrayList<>(); }
return comprisedOfs;
}
public boolean hasComprisedOfs() {
return comprisedOfs != null && !comprisedOfs.isEmpty();
}
public Reference addComprisedOf() {
Reference theThing = new Reference();
getComprisedOfs().add(theThing);
return theThing;
}
public boolean hasComprisedOf(Reference item) {
return hasComprisedOfs() && comprisedOfs.contains(item);
}
public void removeComprisedOf(Reference item) {
if (hasComprisedOf(item)) {
comprisedOfs.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Reference> getAttachedDocuments() {
if (attachedDocuments == null) { attachedDocuments = new ArrayList<>(); }
return attachedDocuments;
}
public boolean hasAttachedDocuments() {
return attachedDocuments != null && !attachedDocuments.isEmpty();
}
public Reference addAttachedDocument() {
Reference theThing = new Reference();
getAttachedDocuments().add(theThing);
return theThing;
}
public boolean hasAttachedDocument(Reference item) {
return hasAttachedDocuments() && attachedDocuments.contains(item);
}
public void removeAttachedDocument(Reference item) {
if (hasAttachedDocument(item)) {
attachedDocuments.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Reference> getMasterFiles() {
if (masterFiles == null) { masterFiles = new ArrayList<>(); }
return masterFiles;
}
public boolean hasMasterFiles() {
return masterFiles != null && !masterFiles.isEmpty();
}
public Reference addMasterFile() {
Reference theThing = new Reference();
getMasterFiles().add(theThing);
return theThing;
}
public boolean hasMasterFile(Reference item) {
return hasMasterFiles() && masterFiles.contains(item);
}
public void removeMasterFile(Reference item) {
if (hasMasterFile(item)) {
masterFiles.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<BackboneElement> getContacts() {
if (contacts == null) { contacts = new ArrayList<>(); }
return contacts;
}
public boolean hasContacts() {
return contacts != null && !contacts.isEmpty();
}
public boolean hasContact(BackboneElement item) {
return hasContacts() && contacts.contains(item);
}
public void removeContact(BackboneElement item) {
if (hasContact(item)) {
contacts.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Reference> getClinicalTrials() {
if (clinicalTrials == null) { clinicalTrials = new ArrayList<>(); }
return clinicalTrials;
}
public boolean hasClinicalTrials() {
return clinicalTrials != null && !clinicalTrials.isEmpty();
}
public Reference addClinicalTrial() {
Reference theThing = new Reference();
getClinicalTrials().add(theThing);
return theThing;
}
public boolean hasClinicalTrial(Reference item) {
return hasClinicalTrials() && clinicalTrials.contains(item);
}
public void removeClinicalTrial(Reference item) {
if (hasClinicalTrial(item)) {
clinicalTrials.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<Coding> getCodes() {
if (codes == null) { codes = new ArrayList<>(); }
return codes;
}
public boolean hasCodes() {
return codes != null && !codes.isEmpty();
}
public Coding addCode() {
Coding theThing = new Coding();
getCodes().add(theThing);
return theThing;
}
public boolean hasCode(Coding item) {
return hasCodes() && codes.contains(item);
}
public void removeCode(Coding item) {
if (hasCode(item)) {
codes.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<BackboneElement> getNames() {
if (names == null) { names = new ArrayList<>(); }
return names;
}
public boolean hasNames() {
return names != null && !names.isEmpty();
}
public boolean hasName(BackboneElement item) {
return hasNames() && names.contains(item);
}
public void removeName(BackboneElement item) {
if (hasName(item)) {
names.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<BackboneElement> getCrossReferences() {
if (crossReferences == null) { crossReferences = new ArrayList<>(); }
return crossReferences;
}
public boolean hasCrossReferences() {
return crossReferences != null && !crossReferences.isEmpty();
}
public boolean hasCrossReference(BackboneElement item) {
return hasCrossReferences() && crossReferences.contains(item);
}
public void removeCrossReference(BackboneElement item) {
if (hasCrossReference(item)) {
crossReferences.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<BackboneElement> getOperations() {
if (operations == null) { operations = new ArrayList<>(); }
return operations;
}
public boolean hasOperations() {
return operations != null && !operations.isEmpty();
}
public boolean hasOperation(BackboneElement item) {
return hasOperations() && operations.contains(item);
}
public void removeOperation(BackboneElement item) {
if (hasOperation(item)) {
operations.remove(item);
}
}
/**
* A medicinal product, being a substance or combination of substances that is
* intended to treat, prevent or diagnose a disease, or to restore, correct or
* modify physiological functions by exerting a pharmacological, immunological or
* metabolic action. This resource is intended to define and detail such products
* and their properties, for uses other than direct patient care (e.g. regulatory
* use, or drug catalogs).
*
*/
public List<BackboneElement> getCharacteristics() {
if (characteristics == null) { characteristics = new ArrayList<>(); }
return characteristics;
}
public boolean hasCharacteristics() {
return characteristics != null && !characteristics.isEmpty();
}
public boolean hasCharacteristic(BackboneElement item) {
return hasCharacteristics() && characteristics.contains(item);
}
public void removeCharacteristic(BackboneElement item) {
if (hasCharacteristic(item)) {
characteristics.remove(item);
}
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
marketingStatuses.clear();
comprisedOfs.clear();
attachedDocuments.clear();
masterFiles.clear();
contacts.clear();
clinicalTrials.clear();
codes.clear();
names.clear();
crossReferences.clear();
operations.clear();
characteristics.clear();
}
}

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Identifier holding the official identifier for a danish municipality
@ -30,7 +30,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class MunicipalityCodes extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-municipalityCodes|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-municipalityCodes|3.2.0";
@Min("0") @Max("1") @Doco("Value of extension")
@Definition("Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).")

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Extension for the date where a condition lost focus in a specific clinical
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class NotFollowedAnymore extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/NotFollowedAnymore|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/NotFollowedAnymore|3.2.0";
/**

View File

@ -0,0 +1,470 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public class OrganizationUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/Organization-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("1") @Max("*") @Doco("Identifies this organization across multiple systems")
@Definition("Identifier for the organization that is used to identify the organization across multiple disparate systems.")
private List<Identifier> identifiers = new ArrayList<>();// @NotNull // Identifies this organization across multiple systems
@Min("0") @Max("1") @Doco("Organization's legal name")
@Definition("A name associated with the organization.")
private String name; // Organization's legal name
@Min("0") @Max("*") @Doco("Official contact details for the Organization")
@Definition("The contact details of communication devices available relevant to the specific Organization. This can include addresses, phone numbers, fax numbers, mobile numbers, email addresses and web sites.")
private List<ExtendedContactDetail> contacts = new ArrayList<>(); // Official contact details for the Organization
@Min("0") @Max("1") @Doco("The organization of which this organization forms a part")
@Definition("The organization of which this organization forms a part.")
private Reference partOf; // The organization of which this organization forms a part
@Min("0") @Max("*") @Doco("Technical endpoints providing access to services operated for the organization")
@Definition("Technical endpoints providing access to services operated for the organization.")
private List<Reference> endpoints = new ArrayList<>(); // Technical endpoints providing access to services operated for the organization
@Min("0") @Max("*") @Doco("Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care")
@Definition("The official certifications, accreditations, training, designations and licenses that authorize and/or otherwise endorse the provision of care by the organization.\r\rFor example, an approval to provide a type of services issued by a certifying body (such as the US Joint Commission) to an organization.")
private List<BackboneElement> qualifications = new ArrayList<>(); // Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care
/**
* Parameter-less constructor.
*
*/
public OrganizationUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public OrganizationUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static OrganizationUvEpi fromSource(IWorkerContext context, Organization source) {
OrganizationUvEpi theThing = new OrganizationUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("name")) {
name = ((StringType) src.child("name").asDataType()).getValue();
}
for (PEInstance item : src.children("contact")) {
contacts.add((ExtendedContactDetail) item.asDataType());
}
if (src.hasChild("partOf")) {
partOf = (Reference) src.child("partOf").asDataType();
}
for (PEInstance item : src.children("endpoint")) {
endpoints.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("qualification")) {
qualifications.add((BackboneElement) item.asElement());
}
}
/**
* Build an instance of the object based on this source object
*
*/
public Organization build(IWorkerContext context) {
workerContext = context;
Organization theThing = new Organization();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, Organization dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("name");
if (name != null) {
tgt.makeChild("name").data().setProperty("value", new StringType(name));
}
tgt.clear("contact");
for (ExtendedContactDetail item : contacts) {
tgt.addChild("contact", item);
}
tgt.clear("partOf");
if (partOf != null) {
tgt.addChild("partOf", partOf);
}
tgt.clear("endpoint");
for (Reference item : endpoints) {
tgt.addChild("endpoint", item);
}
tgt.clear("qualification");
for (BackboneElement item : qualifications) {
tgt.addChild("qualification", item);
}
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public String getId() {
return id;
}
public OrganizationUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public String getName() {
return name;
}
public OrganizationUvEpi setName(String value) {
this.name = value;
return this;
}
public boolean hasName() {
return name != null;
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public List<ExtendedContactDetail> getContacts() {
if (contacts == null) { contacts = new ArrayList<>(); }
return contacts;
}
public boolean hasContacts() {
return contacts != null && !contacts.isEmpty();
}
public ExtendedContactDetail addContact() {
ExtendedContactDetail theThing = new ExtendedContactDetail();
getContacts().add(theThing);
return theThing;
}
public boolean hasContact(ExtendedContactDetail item) {
return hasContacts() && contacts.contains(item);
}
public void removeContact(ExtendedContactDetail item) {
if (hasContact(item)) {
contacts.remove(item);
}
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public Reference getPartOf() {
if (partOf == null) { partOf = new Reference(); }
return partOf;
}
public OrganizationUvEpi setPartOf(Reference value) {
this.partOf = value;
return this;
}
public boolean hasPartOf() {
return partOf != null;
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public List<Reference> getEndpoints() {
if (endpoints == null) { endpoints = new ArrayList<>(); }
return endpoints;
}
public boolean hasEndpoints() {
return endpoints != null && !endpoints.isEmpty();
}
public Reference addEndpoint() {
Reference theThing = new Reference();
getEndpoints().add(theThing);
return theThing;
}
public boolean hasEndpoint(Reference item) {
return hasEndpoints() && endpoints.contains(item);
}
public void removeEndpoint(Reference item) {
if (hasEndpoint(item)) {
endpoints.remove(item);
}
}
/**
* A formally or informally recognized grouping of people or organizations formed
* for the purpose of achieving some form of collective action. Includes
* companies, institutions, corporations, departments, community groups, healthcare
* practice groups, payer/insurer, etc.
*
*/
public List<BackboneElement> getQualifications() {
if (qualifications == null) { qualifications = new ArrayList<>(); }
return qualifications;
}
public boolean hasQualifications() {
return qualifications != null && !qualifications.isEmpty();
}
public boolean hasQualification(BackboneElement item) {
return hasQualifications() && qualifications.contains(item);
}
public void removeQualification(BackboneElement item) {
if (hasQualification(item)) {
qualifications.remove(item);
}
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
name = null;
contacts.clear();
partOf = null;
endpoints.clear();
qualifications.clear();
}
}

View File

@ -0,0 +1,565 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* A medically related item or items, in a container or package.
*
*/
public class PackagedProductDefinitionUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/PackagedProductDefinition-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("0") @Max("*") @Doco("A unique identifier for this package as whole - not for the content of the package")
@Definition("A unique identifier for this package as whole - not the the content of the package. Unique instance identifiers assigned to a package by manufacturers, regulators, drug catalogue custodians or other organizations.")
private List<Identifier> identifiers = new ArrayList<>(); // A unique identifier for this package as whole - not for the content of the package
@Min("1") @Max("1") @Doco("A name for this package. Typically as listed in a drug formulary, catalogue, inventory etc")
@Definition("A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.")
private String name;// @NotNull // A name for this package. Typically as listed in a drug formulary, catalogue, inventory etc
@Min("0") @Max("*") @Doco("The product that this is a pack for")
@Definition("The product this package model relates to, not the contents of the package (for which see package.containedItem).")
private List<Reference> packageFors = new ArrayList<>(); // The product that this is a pack for
@Min("0") @Max("*") @Doco("A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. See also packaging.containedItem.amount (especially the long definition)")
@Definition("A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. This attribute differs from containedItem.amount in that it can give a single aggregated count of all tablet types in a pack, even when these are different manufactured items. For example a pill pack of 21 tablets plus 7 sugar tablets, can be denoted here as '28 tablets'. This attribute is repeatable so that the different item types in one pack type can be counted (e.g. a count of vials and count of syringes). Each repeat must have different units, so that it is clear what the different sets of counted items are, and it is not intended to allow different counts of similar items (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to represent different pack sizes (e.g. 20 pack vs. 50 pack) - which would be different instances of this resource.")
private List<Quantity> containedItemQuantities = new ArrayList<>(); // A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. See also packaging.containedItem.amount (especially the long definition)
@Min("0") @Max("*") @Doco("The legal status of supply of the packaged item as classified by the regulator.")
@Definition("The legal status of supply of the packaged item as classified by the regulator.")
private List<BackboneElement> legalStatusOfSupplies = new ArrayList<>(); // The legal status of supply of the packaged item as classified by the regulator.
@Min("0") @Max("*") @Doco("Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.")
@Definition("Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.")
private List<MarketingStatus> marketingStatuses = new ArrayList<>(); // Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.
@Min("0") @Max("*") @Doco("Manufacturer of this package type (multiple means these are all possible manufacturers)")
@Definition("Manufacturer of this package type. When there are multiple it means these are all possible manufacturers.")
private List<Reference> manufacturers = new ArrayList<>(); // Manufacturer of this package type (multiple means these are all possible manufacturers)
@Min("0") @Max("*") @Doco("Additional information or supporting documentation about the packaged product")
@Definition("Additional information or supporting documentation about the packaged product.")
private List<Reference> attachedDocuments = new ArrayList<>(); // Additional information or supporting documentation about the packaged product
@Min("0") @Max("1") @Doco("A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap")
@Definition("A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item).")
private BackboneElement packaging; // A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap
/**
* Parameter-less constructor.
*
*/
public PackagedProductDefinitionUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public PackagedProductDefinitionUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static PackagedProductDefinitionUvEpi fromSource(IWorkerContext context, PackagedProductDefinition source) {
PackagedProductDefinitionUvEpi theThing = new PackagedProductDefinitionUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
if (src.hasChild("name")) {
name = ((StringType) src.child("name").asDataType()).getValue();
}
for (PEInstance item : src.children("packageFor")) {
packageFors.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("containedItemQuantity")) {
containedItemQuantities.add((Quantity) item.asDataType());
}
for (PEInstance item : src.children("legalStatusOfSupply")) {
legalStatusOfSupplies.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("marketingStatus")) {
marketingStatuses.add((MarketingStatus) item.asDataType());
}
for (PEInstance item : src.children("manufacturer")) {
manufacturers.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("attachedDocument")) {
attachedDocuments.add((Reference) item.asDataType());
}
if (src.hasChild("packaging")) {
packaging = (BackboneElement) src.child("packaging").asElement();
}
}
/**
* Build an instance of the object based on this source object
*
*/
public PackagedProductDefinition build(IWorkerContext context) {
workerContext = context;
PackagedProductDefinition theThing = new PackagedProductDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, PackagedProductDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("name");
if (name != null) {
tgt.makeChild("name").data().setProperty("value", new StringType(name));
}
tgt.clear("packageFor");
for (Reference item : packageFors) {
tgt.addChild("packageFor", item);
}
tgt.clear("containedItemQuantity");
for (Quantity item : containedItemQuantities) {
tgt.addChild("containedItemQuantity", item);
}
tgt.clear("legalStatusOfSupply");
for (BackboneElement item : legalStatusOfSupplies) {
tgt.addChild("legalStatusOfSupply", item);
}
tgt.clear("marketingStatus");
for (MarketingStatus item : marketingStatuses) {
tgt.addChild("marketingStatus", item);
}
tgt.clear("manufacturer");
for (Reference item : manufacturers) {
tgt.addChild("manufacturer", item);
}
tgt.clear("attachedDocument");
for (Reference item : attachedDocuments) {
tgt.addChild("attachedDocument", item);
}
tgt.clear("packaging");
if (packaging != null) {
tgt.addChild("packaging", packaging);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public String getId() {
return id;
}
public PackagedProductDefinitionUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public String getName() {
return name;
}
public PackagedProductDefinitionUvEpi setName(String value) {
this.name = value;
return this;
}
public boolean hasName() {
return name != null;
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<Reference> getPackageFors() {
if (packageFors == null) { packageFors = new ArrayList<>(); }
return packageFors;
}
public boolean hasPackageFors() {
return packageFors != null && !packageFors.isEmpty();
}
public Reference addPackageFor() {
Reference theThing = new Reference();
getPackageFors().add(theThing);
return theThing;
}
public boolean hasPackageFor(Reference item) {
return hasPackageFors() && packageFors.contains(item);
}
public void removePackageFor(Reference item) {
if (hasPackageFor(item)) {
packageFors.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<Quantity> getContainedItemQuantities() {
if (containedItemQuantities == null) { containedItemQuantities = new ArrayList<>(); }
return containedItemQuantities;
}
public boolean hasContainedItemQuantities() {
return containedItemQuantities != null && !containedItemQuantities.isEmpty();
}
public Quantity addContainedItemQuantity() {
Quantity theThing = new Quantity();
getContainedItemQuantities().add(theThing);
return theThing;
}
public boolean hasContainedItemQuantity(Quantity item) {
return hasContainedItemQuantities() && containedItemQuantities.contains(item);
}
public void removeContainedItemQuantity(Quantity item) {
if (hasContainedItemQuantity(item)) {
containedItemQuantities.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<BackboneElement> getLegalStatusOfSupplies() {
if (legalStatusOfSupplies == null) { legalStatusOfSupplies = new ArrayList<>(); }
return legalStatusOfSupplies;
}
public boolean hasLegalStatusOfSupplies() {
return legalStatusOfSupplies != null && !legalStatusOfSupplies.isEmpty();
}
public boolean hasLegalStatusOfSupply(BackboneElement item) {
return hasLegalStatusOfSupplies() && legalStatusOfSupplies.contains(item);
}
public void removeLegalStatusOfSupply(BackboneElement item) {
if (hasLegalStatusOfSupply(item)) {
legalStatusOfSupplies.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<MarketingStatus> getMarketingStatuses() {
if (marketingStatuses == null) { marketingStatuses = new ArrayList<>(); }
return marketingStatuses;
}
public boolean hasMarketingStatuses() {
return marketingStatuses != null && !marketingStatuses.isEmpty();
}
public MarketingStatus addMarketingStatus() {
MarketingStatus theThing = new MarketingStatus();
getMarketingStatuses().add(theThing);
return theThing;
}
public boolean hasMarketingStatus(MarketingStatus item) {
return hasMarketingStatuses() && marketingStatuses.contains(item);
}
public void removeMarketingStatus(MarketingStatus item) {
if (hasMarketingStatus(item)) {
marketingStatuses.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<Reference> getManufacturers() {
if (manufacturers == null) { manufacturers = new ArrayList<>(); }
return manufacturers;
}
public boolean hasManufacturers() {
return manufacturers != null && !manufacturers.isEmpty();
}
public Reference addManufacturer() {
Reference theThing = new Reference();
getManufacturers().add(theThing);
return theThing;
}
public boolean hasManufacturer(Reference item) {
return hasManufacturers() && manufacturers.contains(item);
}
public void removeManufacturer(Reference item) {
if (hasManufacturer(item)) {
manufacturers.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public List<Reference> getAttachedDocuments() {
if (attachedDocuments == null) { attachedDocuments = new ArrayList<>(); }
return attachedDocuments;
}
public boolean hasAttachedDocuments() {
return attachedDocuments != null && !attachedDocuments.isEmpty();
}
public Reference addAttachedDocument() {
Reference theThing = new Reference();
getAttachedDocuments().add(theThing);
return theThing;
}
public boolean hasAttachedDocument(Reference item) {
return hasAttachedDocuments() && attachedDocuments.contains(item);
}
public void removeAttachedDocument(Reference item) {
if (hasAttachedDocument(item)) {
attachedDocuments.remove(item);
}
}
/**
* A medically related item or items, in a container or package.
*
*/
public @Nullable BackboneElement getPackaging() { // BackboneElement is abstract
return packaging;
}
public PackagedProductDefinitionUvEpi setPackaging(BackboneElement value) {
this.packaging = value;
return this;
}
public boolean hasPackaging() {
return packaging != null;
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
name = null;
packageFors.clear();
containedItemQuantities.clear();
legalStatusOfSupplies.clear();
marketingStatuses.clear();
manufacturers.clear();
attachedDocuments.clear();
packaging = null;
}
}

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class ProducentId extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-producent-id|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-producent-id|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Identifier holding the official organization identifier for a danish region
@ -30,7 +30,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class RegionalSubDivisionCodes extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-RegionalSubDivisionCodes|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-RegionalSubDivisionCodes|3.2.0";
@Min("0") @Max("1") @Doco("Value of extension")
@Definition("Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).")

View File

@ -0,0 +1,539 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public class RegulatedAuthorizationUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/RegulatedAuthorization-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("1") @Max("*") @Doco("Identifier assigned by the health authority to a single medicinal product")
@Definition("Business identifier for the authorization, typically assigned by the authorizing body.")
private List<Identifier> identifiers = new ArrayList<>();// @NotNull // Identifier assigned by the health authority to a single medicinal product
@Min("1") @Max("*") @Doco("The product type, treatment, facility or activity that is being authorized")
@Definition("The product type, treatment, facility or activity that is being authorized.")
private List<Reference> subjects = new ArrayList<>();// @NotNull // The product type, treatment, facility or activity that is being authorized
@Min("0") @Max("1") @Doco("The time period in which the regulatory approval etc. is in effect, e.g. a Marketing Authorization includes the date of authorization and/or expiration date")
@Definition("The time period in which the regulatory approval, clearance or licencing is in effect. As an example, a Marketing Authorization includes the date of authorization and/or an expiration date.")
private Period validityPeriod; // The time period in which the regulatory approval etc. is in effect, e.g. a Marketing Authorization includes the date of authorization and/or expiration date
@Min("0") @Max("*") @Doco("Reference to the Clinical Use Definition")
@Definition("Condition for which the use of the regulated product applies.")
private List<CodeableReference> indications = new ArrayList<>(); // Reference to the Clinical Use Definition
@Min("1") @Max("1") @Doco("The organization that has been granted this authorization, by the regulator")
@Definition("The organization that has been granted this authorization, by some authoritative body (the 'regulator').")
private Reference holder;// @NotNull // The organization that has been granted this authorization, by the regulator
@Min("0") @Max("1") @Doco("The regulatory authority or authorizing body granting the authorization")
@Definition("The regulatory authority or authorizing body granting the authorization. For example, European Medicines Agency (EMA), Food and Drug Administration (FDA), Health Canada (HC), etc.")
private Reference regulator; // The regulatory authority or authorizing body granting the authorization
@Min("0") @Max("*") @Doco("Additional information or supporting documentation about the authorization")
@Definition("Additional information or supporting documentation about the authorization.")
private List<Reference> attachedDocuments = new ArrayList<>(); // Additional information or supporting documentation about the authorization
@Min("0") @Max("1") @Doco("The case or regulatory procedure for granting or amending a regulated authorization. Note: This area is subject to ongoing review and the workgroup is seeking implementer feedback on its use (see link at bottom of page)")
@Definition("The case or regulatory procedure for granting or amending a regulated authorization. An authorization is granted in response to submissions/applications by those seeking authorization. A case is the administrative process that deals with the application(s) that relate to this and assesses them. Note: This area is subject to ongoing review and the workgroup is seeking implementer feedback on its use (see link at bottom of page).")
private BackboneElement _case; // The case or regulatory procedure for granting or amending a regulated authorization. Note: This area is subject to ongoing review and the workgroup is seeking implementer feedback on its use (see link at bottom of page)
/**
* Parameter-less constructor.
*
*/
public RegulatedAuthorizationUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public RegulatedAuthorizationUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static RegulatedAuthorizationUvEpi fromSource(IWorkerContext context, RegulatedAuthorization source) {
RegulatedAuthorizationUvEpi theThing = new RegulatedAuthorizationUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
for (PEInstance item : src.children("subject")) {
subjects.add((Reference) item.asDataType());
}
if (src.hasChild("validityPeriod")) {
validityPeriod = (Period) src.child("validityPeriod").asDataType();
}
for (PEInstance item : src.children("indication")) {
indications.add((CodeableReference) item.asDataType());
}
if (src.hasChild("holder")) {
holder = (Reference) src.child("holder").asDataType();
}
if (src.hasChild("regulator")) {
regulator = (Reference) src.child("regulator").asDataType();
}
for (PEInstance item : src.children("attachedDocument")) {
attachedDocuments.add((Reference) item.asDataType());
}
if (src.hasChild("_case")) {
_case = (BackboneElement) src.child("_case").asElement();
}
}
/**
* Build an instance of the object based on this source object
*
*/
public RegulatedAuthorization build(IWorkerContext context) {
workerContext = context;
RegulatedAuthorization theThing = new RegulatedAuthorization();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, RegulatedAuthorization dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("subject");
for (Reference item : subjects) {
tgt.addChild("subject", item);
}
tgt.clear("validityPeriod");
if (validityPeriod != null) {
tgt.addChild("validityPeriod", validityPeriod);
}
tgt.clear("indication");
for (CodeableReference item : indications) {
tgt.addChild("indication", item);
}
tgt.clear("holder");
if (holder != null) {
tgt.addChild("holder", holder);
}
tgt.clear("regulator");
if (regulator != null) {
tgt.addChild("regulator", regulator);
}
tgt.clear("attachedDocument");
for (Reference item : attachedDocuments) {
tgt.addChild("attachedDocument", item);
}
tgt.clear("_case");
if (_case != null) {
tgt.addChild("_case", _case);
}
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public String getId() {
return id;
}
public RegulatedAuthorizationUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public List<Reference> getSubjects() {
if (subjects == null) { subjects = new ArrayList<>(); }
return subjects;
}
public boolean hasSubjects() {
return subjects != null && !subjects.isEmpty();
}
public Reference addSubject() {
Reference theThing = new Reference();
getSubjects().add(theThing);
return theThing;
}
public boolean hasSubject(Reference item) {
return hasSubjects() && subjects.contains(item);
}
public void removeSubject(Reference item) {
if (hasSubject(item)) {
subjects.remove(item);
}
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public Period getValidityPeriod() {
if (validityPeriod == null) { validityPeriod = new Period(); }
return validityPeriod;
}
public RegulatedAuthorizationUvEpi setValidityPeriod(Period value) {
this.validityPeriod = value;
return this;
}
public boolean hasValidityPeriod() {
return validityPeriod != null;
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public List<CodeableReference> getIndications() {
if (indications == null) { indications = new ArrayList<>(); }
return indications;
}
public boolean hasIndications() {
return indications != null && !indications.isEmpty();
}
public CodeableReference addIndication() {
CodeableReference theThing = new CodeableReference();
getIndications().add(theThing);
return theThing;
}
public boolean hasIndication(CodeableReference item) {
return hasIndications() && indications.contains(item);
}
public void removeIndication(CodeableReference item) {
if (hasIndication(item)) {
indications.remove(item);
}
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public Reference getHolder() {
if (holder == null) { holder = new Reference(); }
return holder;
}
public RegulatedAuthorizationUvEpi setHolder(Reference value) {
this.holder = value;
return this;
}
public boolean hasHolder() {
return holder != null;
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public Reference getRegulator() {
if (regulator == null) { regulator = new Reference(); }
return regulator;
}
public RegulatedAuthorizationUvEpi setRegulator(Reference value) {
this.regulator = value;
return this;
}
public boolean hasRegulator() {
return regulator != null;
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public List<Reference> getAttachedDocuments() {
if (attachedDocuments == null) { attachedDocuments = new ArrayList<>(); }
return attachedDocuments;
}
public boolean hasAttachedDocuments() {
return attachedDocuments != null && !attachedDocuments.isEmpty();
}
public Reference addAttachedDocument() {
Reference theThing = new Reference();
getAttachedDocuments().add(theThing);
return theThing;
}
public boolean hasAttachedDocument(Reference item) {
return hasAttachedDocuments() && attachedDocuments.contains(item);
}
public void removeAttachedDocument(Reference item) {
if (hasAttachedDocument(item)) {
attachedDocuments.remove(item);
}
}
/**
* Regulatory approval, clearance or licencing related to a regulated product,
* treatment, facility or activity that is cited in a guidance, regulation, rule or
* legislative act. An example is Market Authorization relating to a Medicinal
* Product.
*
*/
public @Nullable BackboneElement get_case() { // BackboneElement is abstract
return _case;
}
public RegulatedAuthorizationUvEpi set_case(BackboneElement value) {
this._case = value;
return this;
}
public boolean has_case() {
return _case != null;
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
subjects.clear();
validityPeriod = null;
indications.clear();
holder = null;
regulator = null;
attachedDocuments.clear();
_case = null;
}
}

View File

@ -22,7 +22,7 @@ import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 28/10/24, 7:31 am
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* An identifier - identifies some entity uniquely and unambiguously. Typically
@ -31,7 +31,7 @@ import org.hl7.fhir.r5.profilemodel.gen.Definition;
*/
public class SORIdentifier extends PEGeneratedBase {
private static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-sor-identifier|3.2.0";
public static final String CANONICAL_URL = "http://hl7.dk/fhir/core/StructureDefinition/dk-core-sor-identifier|3.2.0";
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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.")

View File

@ -0,0 +1,876 @@
package org.hl7.fhir.r5.test.profiles;
import java.util.List;
import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Date;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.profilemodel.PEBuilder;
import org.hl7.fhir.r5.profilemodel.PEInstance;
import org.hl7.fhir.r5.profilemodel.PEBuilder.PEElementPropertiesPolicy;
import org.hl7.fhir.r5.profilemodel.gen.PEGeneratedBase;
import org.hl7.fhir.r5.profilemodel.gen.Min;
import org.hl7.fhir.r5.profilemodel.gen.Max;
import org.hl7.fhir.r5.profilemodel.gen.Label;
import org.hl7.fhir.r5.profilemodel.gen.Doco;
import org.hl7.fhir.r5.profilemodel.gen.BindingStrength;
import org.hl7.fhir.r5.profilemodel.gen.ValueSet;
import org.hl7.fhir.r5.profilemodel.gen.MustSupport;
import org.hl7.fhir.r5.profilemodel.gen.Definition;
// Generated by the HAPI Java Profile Generator, 1/11/24, 11:07 pm
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public class SubstanceDefinitionUvEpi extends PEGeneratedBase {
public static final String CANONICAL_URL = "http://hl7.org/fhir/uv/emedicinal-product-info/StructureDefinition/SubstanceDefinition-uv-epi|1.0.0";
@Min("0") @Max("1") @Doco("")
private String id; //
@Min("0") @Max("*") @Doco("Additional content defined by implementations")
@Definition("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 managable, 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.")
private List<Extension> extensions = new ArrayList<>(); // Additional content defined by implementations
@Min("0") @Max("*") @Doco("Extensions that cannot be ignored")
@Definition("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 managable, 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.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).")
private List<Extension> modifierExtensions = new ArrayList<>(); // Extensions that cannot be ignored
@Min("1") @Max("*") @Doco("Identifier by which this substance is known")
@Definition("Identifier by which this substance is known.")
private List<Identifier> identifiers = new ArrayList<>();// @NotNull // Identifier by which this substance is known
@Min("0") @Max("*") @Doco("Supporting literature")
@Definition("Supporting literature.")
private List<Reference> informationSources = new ArrayList<>(); // Supporting literature
@Min("0") @Max("*") @Doco("Textual comment about the substance's catalogue or registry record")
@Definition("Textual comment about the substance's catalogue or registry record.")
private List<Annotation> notes = new ArrayList<>(); // Textual comment about the substance's catalogue or registry record
@Min("0") @Max("*") @Doco("The entity that creates, makes, produces or fabricates the substance")
@Definition("The entity that creates, makes, produces or fabricates the substance. This is a set of potential manufacturers but is not necessarily comprehensive.")
private List<Reference> manufacturers = new ArrayList<>(); // The entity that creates, makes, produces or fabricates the substance
@Min("0") @Max("*") @Doco("An entity that is the source for the substance. It may be different from the manufacturer")
@Definition("An entity that is the source for the substance. It may be different from the manufacturer. Supplier is synonymous to a distributor.")
private List<Reference> suppliers = new ArrayList<>(); // An entity that is the source for the substance. It may be different from the manufacturer
@Min("0") @Max("*") @Doco("Moiety, for structural modifications")
@Definition("Moiety, for structural modifications.")
private List<BackboneElement> moieties = new ArrayList<>(); // Moiety, for structural modifications
@Min("0") @Max("*") @Doco("General specifications for this substance")
@Definition("General specifications for this substance.")
private List<BackboneElement> characterizations = new ArrayList<>(); // General specifications for this substance
@Min("0") @Max("*") @Doco("General specifications for this substance")
@Definition("General specifications for this substance.")
private List<BackboneElement> properties = new ArrayList<>(); // General specifications for this substance
@Min("0") @Max("1") @Doco("General information detailing this substance")
@Definition("General information detailing this substance.")
private Reference referenceInformation; // General information detailing this substance
@Min("0") @Max("*") @Doco("The average mass of a molecule of a compound")
@Definition("The average mass of a molecule of a compound compared to 1/12 the mass of carbon 12 and calculated as the sum of the atomic weights of the constituent atoms.")
private List<BackboneElement> molecularWeights = new ArrayList<>(); // The average mass of a molecule of a compound
@Min("0") @Max("1") @Doco("Structural information")
@Definition("Structural information.")
private BackboneElement structure; // Structural information
@Min("0") @Max("*") @Doco("Codes associated with the substance.")
@Definition("Codes associated with the substance.")
private List<BackboneElement> codes = new ArrayList<>(); // Codes associated with the substance.
@Min("0") @Max("*") @Doco("International Non-Proprietary Name (INN) of the substance; or United States Adopted Name (USAN) if applicable.")
@Definition("Names applicable to this substance.")
private List<BackboneElement> names = new ArrayList<>(); // International Non-Proprietary Name (INN) of the substance; or United States Adopted Name (USAN) if applicable.
@Min("0") @Max("*") @Doco("A link between this substance and another")
@Definition("A link between this substance and another, with details of the relationship.")
private List<BackboneElement> relationships = new ArrayList<>(); // A link between this substance and another
@Min("0") @Max("1") @Doco("Data items specific to nucleic acids")
@Definition("Data items specific to nucleic acids.")
private Reference nucleicAcid; // Data items specific to nucleic acids
@Min("0") @Max("1") @Doco("Data items specific to polymers")
@Definition("Data items specific to polymers.")
private Reference polymer; // Data items specific to polymers
@Min("0") @Max("1") @Doco("Data items specific to proteins")
@Definition("Data items specific to proteins.")
private Reference protein; // Data items specific to proteins
@Min("0") @Max("1") @Doco("Material or taxonomic/anatomical source")
@Definition("Material or taxonomic/anatomical source for the substance.")
private BackboneElement sourceMaterial; // Material or taxonomic/anatomical source
/**
* Parameter-less constructor.
*
*/
public SubstanceDefinitionUvEpi() {
}
/**
* Construct an instance of the object, and fill out all the fixed values
*
*/
public SubstanceDefinitionUvEpi(IWorkerContext context) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, builder.createResource(CANONICAL_URL, false));
load(src);
}
/**
* Populate an instance of the object based on this source object
*
*/
public static SubstanceDefinitionUvEpi fromSource(IWorkerContext context, SubstanceDefinition source) {
SubstanceDefinitionUvEpi theThing = new SubstanceDefinitionUvEpi();
theThing.workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance src = builder.buildPEInstance(CANONICAL_URL, source);
theThing.load(src);
return theThing;
}
public void load(PEInstance src) {
clear();
if (src.hasChild("id")) {
id = ((IdType) src.child("id").asDataType()).getValue();
}
for (PEInstance item : src.children("extension")) {
extensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("modifierExtension")) {
modifierExtensions.add((Extension) item.asDataType());
}
for (PEInstance item : src.children("identifier")) {
identifiers.add((Identifier) item.asDataType());
}
for (PEInstance item : src.children("informationSource")) {
informationSources.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("note")) {
notes.add((Annotation) item.asDataType());
}
for (PEInstance item : src.children("manufacturer")) {
manufacturers.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("supplier")) {
suppliers.add((Reference) item.asDataType());
}
for (PEInstance item : src.children("moiety")) {
moieties.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("characterization")) {
characterizations.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("property")) {
properties.add((BackboneElement) item.asElement());
}
if (src.hasChild("referenceInformation")) {
referenceInformation = (Reference) src.child("referenceInformation").asDataType();
}
for (PEInstance item : src.children("molecularWeight")) {
molecularWeights.add((BackboneElement) item.asElement());
}
if (src.hasChild("structure")) {
structure = (BackboneElement) src.child("structure").asElement();
}
for (PEInstance item : src.children("code")) {
codes.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("name")) {
names.add((BackboneElement) item.asElement());
}
for (PEInstance item : src.children("relationship")) {
relationships.add((BackboneElement) item.asElement());
}
if (src.hasChild("nucleicAcid")) {
nucleicAcid = (Reference) src.child("nucleicAcid").asDataType();
}
if (src.hasChild("polymer")) {
polymer = (Reference) src.child("polymer").asDataType();
}
if (src.hasChild("protein")) {
protein = (Reference) src.child("protein").asDataType();
}
if (src.hasChild("sourceMaterial")) {
sourceMaterial = (BackboneElement) src.child("sourceMaterial").asElement();
}
}
/**
* Build an instance of the object based on this source object
*
*/
public SubstanceDefinition build(IWorkerContext context) {
workerContext = context;
SubstanceDefinition theThing = new SubstanceDefinition();
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, theThing);
save(tgt, false);
return theThing;
}
/**
* Save this profile class into an existing resource (overwriting anything that
* exists in the profile)
*
*/
public void save(IWorkerContext context, SubstanceDefinition dest, boolean nulls) {
workerContext = context;
PEBuilder builder = new PEBuilder(context, PEElementPropertiesPolicy.EXTENSION, true);
PEInstance tgt = builder.buildPEInstance(CANONICAL_URL, dest);
save(tgt, nulls);
}
public void save(PEInstance tgt, boolean nulls) {
tgt.clear("id");
if (id != null) {
tgt.makeChild("id").data().setProperty("value", new IdType(id));
}
tgt.clear("extension");
for (Extension item : extensions) {
tgt.addChild("extension", item);
}
tgt.clear("modifierExtension");
for (Extension item : modifierExtensions) {
tgt.addChild("modifierExtension", item);
}
tgt.clear("identifier");
for (Identifier item : identifiers) {
tgt.addChild("identifier", item);
}
tgt.clear("informationSource");
for (Reference item : informationSources) {
tgt.addChild("informationSource", item);
}
tgt.clear("note");
for (Annotation item : notes) {
tgt.addChild("note", item);
}
tgt.clear("manufacturer");
for (Reference item : manufacturers) {
tgt.addChild("manufacturer", item);
}
tgt.clear("supplier");
for (Reference item : suppliers) {
tgt.addChild("supplier", item);
}
tgt.clear("moiety");
for (BackboneElement item : moieties) {
tgt.addChild("moiety", item);
}
tgt.clear("characterization");
for (BackboneElement item : characterizations) {
tgt.addChild("characterization", item);
}
tgt.clear("property");
for (BackboneElement item : properties) {
tgt.addChild("property", item);
}
tgt.clear("referenceInformation");
if (referenceInformation != null) {
tgt.addChild("referenceInformation", referenceInformation);
}
tgt.clear("molecularWeight");
for (BackboneElement item : molecularWeights) {
tgt.addChild("molecularWeight", item);
}
tgt.clear("structure");
if (structure != null) {
tgt.addChild("structure", structure);
}
tgt.clear("code");
for (BackboneElement item : codes) {
tgt.addChild("code", item);
}
tgt.clear("name");
for (BackboneElement item : names) {
tgt.addChild("name", item);
}
tgt.clear("relationship");
for (BackboneElement item : relationships) {
tgt.addChild("relationship", item);
}
tgt.clear("nucleicAcid");
if (nucleicAcid != null) {
tgt.addChild("nucleicAcid", nucleicAcid);
}
tgt.clear("polymer");
if (polymer != null) {
tgt.addChild("polymer", polymer);
}
tgt.clear("protein");
if (protein != null) {
tgt.addChild("protein", protein);
}
tgt.clear("sourceMaterial");
if (sourceMaterial != null) {
tgt.addChild("sourceMaterial", sourceMaterial);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public String getId() {
return id;
}
public SubstanceDefinitionUvEpi setId(String value) {
this.id = value;
return this;
}
public boolean hasId() {
return id != null;
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<Extension> getExtensions() {
if (extensions == null) { extensions = new ArrayList<>(); }
return extensions;
}
public boolean hasExtensions() {
return extensions != null && !extensions.isEmpty();
}
public Extension addExtension() {
Extension theThing = new Extension();
getExtensions().add(theThing);
return theThing;
}
public boolean hasExtension(Extension item) {
return hasExtensions() && extensions.contains(item);
}
public void removeExtension(Extension item) {
if (hasExtension(item)) {
extensions.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<Extension> getModifierExtensions() {
if (modifierExtensions == null) { modifierExtensions = new ArrayList<>(); }
return modifierExtensions;
}
public boolean hasModifierExtensions() {
return modifierExtensions != null && !modifierExtensions.isEmpty();
}
public Extension addModifierExtension() {
Extension theThing = new Extension();
getModifierExtensions().add(theThing);
return theThing;
}
public boolean hasModifierExtension(Extension item) {
return hasModifierExtensions() && modifierExtensions.contains(item);
}
public void removeModifierExtension(Extension item) {
if (hasModifierExtension(item)) {
modifierExtensions.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<Identifier> getIdentifiers() {
if (identifiers == null) { identifiers = new ArrayList<>(); }
return identifiers;
}
public boolean hasIdentifiers() {
return identifiers != null && !identifiers.isEmpty();
}
public Identifier addIdentifier() {
Identifier theThing = new Identifier();
getIdentifiers().add(theThing);
return theThing;
}
public boolean hasIdentifier(Identifier item) {
return hasIdentifiers() && identifiers.contains(item);
}
public void removeIdentifier(Identifier item) {
if (hasIdentifier(item)) {
identifiers.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<Reference> getInformationSources() {
if (informationSources == null) { informationSources = new ArrayList<>(); }
return informationSources;
}
public boolean hasInformationSources() {
return informationSources != null && !informationSources.isEmpty();
}
public Reference addInformationSource() {
Reference theThing = new Reference();
getInformationSources().add(theThing);
return theThing;
}
public boolean hasInformationSource(Reference item) {
return hasInformationSources() && informationSources.contains(item);
}
public void removeInformationSource(Reference item) {
if (hasInformationSource(item)) {
informationSources.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<Annotation> getNotes() {
if (notes == null) { notes = new ArrayList<>(); }
return notes;
}
public boolean hasNotes() {
return notes != null && !notes.isEmpty();
}
public Annotation addNote() {
Annotation theThing = new Annotation();
getNotes().add(theThing);
return theThing;
}
public boolean hasNote(Annotation item) {
return hasNotes() && notes.contains(item);
}
public void removeNote(Annotation item) {
if (hasNote(item)) {
notes.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<Reference> getManufacturers() {
if (manufacturers == null) { manufacturers = new ArrayList<>(); }
return manufacturers;
}
public boolean hasManufacturers() {
return manufacturers != null && !manufacturers.isEmpty();
}
public Reference addManufacturer() {
Reference theThing = new Reference();
getManufacturers().add(theThing);
return theThing;
}
public boolean hasManufacturer(Reference item) {
return hasManufacturers() && manufacturers.contains(item);
}
public void removeManufacturer(Reference item) {
if (hasManufacturer(item)) {
manufacturers.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<Reference> getSuppliers() {
if (suppliers == null) { suppliers = new ArrayList<>(); }
return suppliers;
}
public boolean hasSuppliers() {
return suppliers != null && !suppliers.isEmpty();
}
public Reference addSupplier() {
Reference theThing = new Reference();
getSuppliers().add(theThing);
return theThing;
}
public boolean hasSupplier(Reference item) {
return hasSuppliers() && suppliers.contains(item);
}
public void removeSupplier(Reference item) {
if (hasSupplier(item)) {
suppliers.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<BackboneElement> getMoieties() {
if (moieties == null) { moieties = new ArrayList<>(); }
return moieties;
}
public boolean hasMoieties() {
return moieties != null && !moieties.isEmpty();
}
public boolean hasMoiety(BackboneElement item) {
return hasMoieties() && moieties.contains(item);
}
public void removeMoiety(BackboneElement item) {
if (hasMoiety(item)) {
moieties.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<BackboneElement> getCharacterizations() {
if (characterizations == null) { characterizations = new ArrayList<>(); }
return characterizations;
}
public boolean hasCharacterizations() {
return characterizations != null && !characterizations.isEmpty();
}
public boolean hasCharacterization(BackboneElement item) {
return hasCharacterizations() && characterizations.contains(item);
}
public void removeCharacterization(BackboneElement item) {
if (hasCharacterization(item)) {
characterizations.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<BackboneElement> getProperties() {
if (properties == null) { properties = new ArrayList<>(); }
return properties;
}
public boolean hasProperties() {
return properties != null && !properties.isEmpty();
}
public boolean hasProperty(BackboneElement item) {
return hasProperties() && properties.contains(item);
}
public void removeProperty(BackboneElement item) {
if (hasProperty(item)) {
properties.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public Reference getReferenceInformation() {
if (referenceInformation == null) { referenceInformation = new Reference(); }
return referenceInformation;
}
public SubstanceDefinitionUvEpi setReferenceInformation(Reference value) {
this.referenceInformation = value;
return this;
}
public boolean hasReferenceInformation() {
return referenceInformation != null;
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<BackboneElement> getMolecularWeights() {
if (molecularWeights == null) { molecularWeights = new ArrayList<>(); }
return molecularWeights;
}
public boolean hasMolecularWeights() {
return molecularWeights != null && !molecularWeights.isEmpty();
}
public boolean hasMolecularWeight(BackboneElement item) {
return hasMolecularWeights() && molecularWeights.contains(item);
}
public void removeMolecularWeight(BackboneElement item) {
if (hasMolecularWeight(item)) {
molecularWeights.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public @Nullable BackboneElement getStructure() { // BackboneElement is abstract
return structure;
}
public SubstanceDefinitionUvEpi setStructure(BackboneElement value) {
this.structure = value;
return this;
}
public boolean hasStructure() {
return structure != null;
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<BackboneElement> getCodes() {
if (codes == null) { codes = new ArrayList<>(); }
return codes;
}
public boolean hasCodes() {
return codes != null && !codes.isEmpty();
}
public boolean hasCode(BackboneElement item) {
return hasCodes() && codes.contains(item);
}
public void removeCode(BackboneElement item) {
if (hasCode(item)) {
codes.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<BackboneElement> getNames() {
if (names == null) { names = new ArrayList<>(); }
return names;
}
public boolean hasNames() {
return names != null && !names.isEmpty();
}
public boolean hasName(BackboneElement item) {
return hasNames() && names.contains(item);
}
public void removeName(BackboneElement item) {
if (hasName(item)) {
names.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public List<BackboneElement> getRelationships() {
if (relationships == null) { relationships = new ArrayList<>(); }
return relationships;
}
public boolean hasRelationships() {
return relationships != null && !relationships.isEmpty();
}
public boolean hasRelationship(BackboneElement item) {
return hasRelationships() && relationships.contains(item);
}
public void removeRelationship(BackboneElement item) {
if (hasRelationship(item)) {
relationships.remove(item);
}
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public Reference getNucleicAcid() {
if (nucleicAcid == null) { nucleicAcid = new Reference(); }
return nucleicAcid;
}
public SubstanceDefinitionUvEpi setNucleicAcid(Reference value) {
this.nucleicAcid = value;
return this;
}
public boolean hasNucleicAcid() {
return nucleicAcid != null;
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public Reference getPolymer() {
if (polymer == null) { polymer = new Reference(); }
return polymer;
}
public SubstanceDefinitionUvEpi setPolymer(Reference value) {
this.polymer = value;
return this;
}
public boolean hasPolymer() {
return polymer != null;
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public Reference getProtein() {
if (protein == null) { protein = new Reference(); }
return protein;
}
public SubstanceDefinitionUvEpi setProtein(Reference value) {
this.protein = value;
return this;
}
public boolean hasProtein() {
return protein != null;
}
/**
* The detailed description of a substance, typically at a level beyond what is
* used for prescribing.
*
*/
public @Nullable BackboneElement getSourceMaterial() { // BackboneElement is abstract
return sourceMaterial;
}
public SubstanceDefinitionUvEpi setSourceMaterial(BackboneElement value) {
this.sourceMaterial = value;
return this;
}
public boolean hasSourceMaterial() {
return sourceMaterial != null;
}
public void clear() {
id = null;
extensions.clear();
modifierExtensions.clear();
identifiers.clear();
informationSources.clear();
notes.clear();
manufacturers.clear();
suppliers.clear();
moieties.clear();
characterizations.clear();
properties.clear();
referenceInformation = null;
molecularWeights.clear();
structure = null;
codes.clear();
names.clear();
relationships.clear();
nucleicAcid = null;
polymer = null;
protein = null;
sourceMaterial = null;
}
}

View File

@ -740,10 +740,71 @@ public class Utilities {
upcase = true;
}
}
return s.toString();
String res = s.toString();
if (isJavaReservedWord(res)) {
return "_"+res;
} else {
return res;
}
}
public static boolean isJavaReservedWord(String word) {
if (word.equals("abstract")) return true;
if (word.equals("assert")) return true;
if (word.equals("boolean")) return true;
if (word.equals("break")) return true;
if (word.equals("byte")) return true;
if (word.equals("case")) return true;
if (word.equals("catch")) return true;
if (word.equals("char")) return true;
if (word.equals("class")) return true;
if (word.equals("const")) return true;
if (word.equals("continue")) return true;
if (word.equals("default")) return true;
if (word.equals("double")) return true;
if (word.equals("do")) return true;
if (word.equals("else")) return true;
if (word.equals("enum")) return true;
if (word.equals("extends")) return true;
if (word.equals("false")) return true;
if (word.equals("final")) return true;
if (word.equals("finally")) return true;
if (word.equals("float")) return true;
if (word.equals("for")) return true;
if (word.equals("goto")) return true;
if (word.equals("if")) return true;
if (word.equals("implements")) return true;
if (word.equals("import")) return true;
if (word.equals("instanceof")) return true;
if (word.equals("int")) return true;
if (word.equals("interface")) return true;
if (word.equals("long")) return true;
if (word.equals("native")) return true;
if (word.equals("new")) return true;
if (word.equals("null")) return true;
if (word.equals("package")) return true;
if (word.equals("private")) return true;
if (word.equals("protected")) return true;
if (word.equals("public")) return true;
if (word.equals("return")) return true;
if (word.equals("short")) return true;
if (word.equals("static")) return true;
if (word.equals("strictfp")) return true;
if (word.equals("super")) return true;
if (word.equals("switch")) return true;
if (word.equals("synchronized")) return true;
if (word.equals("this")) return true;
if (word.equals("throw")) return true;
if (word.equals("throws")) return true;
if (word.equals("transient")) return true;
if (word.equals("true")) return true;
if (word.equals("try")) return true;
if (word.equals("void")) return true;
if (word.equals("volatile")) return true;
if (word.equals("while")) return true;
if (word.equals("Exception")) return true;
return false;
}
public static boolean isToken(String tail) {
if (tail == null || tail.length() == 0)
return false;