More structures work from hl7

This commit is contained in:
jamesagnew 2014-12-09 08:24:35 -05:00
parent 45e48c62bf
commit cee02ea605
156 changed files with 28600 additions and 4591 deletions

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
@DatatypeDef(name="Address")
public class Address extends Type {
public enum AddressUse {
public enum AddressUse implements FhirEnum {
/**
* A communication address at a home.
*/
@ -64,7 +64,10 @@ public class Address extends Type {
* added to help the parsers
*/
NULL;
public static AddressUse fromCode(String codeString) throws Exception {
public static final AddressUseEnumFactory ENUM_FACTORY = new AddressUseEnumFactory();
public static AddressUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("home".equals(codeString))
@ -75,8 +78,9 @@ public class Address extends Type {
return TEMP;
if ("old".equals(codeString))
return OLD;
throw new Exception("Unknown AddressUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case HOME: return "home";
@ -115,8 +119,8 @@ public class Address extends Type {
}
}
public static class AddressUseEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class AddressUseEnumFactory implements EnumFactory<AddressUse> {
public AddressUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -128,9 +132,9 @@ public class Address extends Type {
return AddressUse.TEMP;
if ("old".equals(codeString))
return AddressUse.OLD;
throw new Exception("Unknown AddressUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(AddressUse code) throws IllegalArgumentException {
if (code == AddressUse.HOME)
return "home";
if (code == AddressUse.WORK)
@ -249,7 +253,7 @@ P.O. Box number, delivery hints, and similar address information.
this.use = null;
else {
if (this.use == null)
this.use = new Enumeration<AddressUse>();
this.use = new Enumeration<AddressUse>(AddressUse.ENUM_FACTORY);
this.use.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Alert", profile="http://hl7.org/fhir/Profile/Alert")
public class Alert extends DomainResource {
public enum AlertStatus {
public enum AlertStatus implements FhirEnum {
/**
* A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert.
*/
@ -62,7 +62,10 @@ public class Alert extends DomainResource {
* added to help the parsers
*/
NULL;
public static AlertStatus fromCode(String codeString) throws Exception {
public static final AlertStatusEnumFactory ENUM_FACTORY = new AlertStatusEnumFactory();
public static AlertStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("active".equals(codeString))
@ -71,8 +74,9 @@ public class Alert extends DomainResource {
return INACTIVE;
if ("entered in error".equals(codeString))
return ENTEREDINERROR;
throw new Exception("Unknown AlertStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ACTIVE: return "active";
@ -107,8 +111,8 @@ public class Alert extends DomainResource {
}
}
public static class AlertStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class AlertStatusEnumFactory implements EnumFactory<AlertStatus> {
public AlertStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class Alert extends DomainResource {
return AlertStatus.INACTIVE;
if ("entered in error".equals(codeString))
return AlertStatus.ENTEREDINERROR;
throw new Exception("Unknown AlertStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(AlertStatus code) throws IllegalArgumentException {
if (code == AlertStatus.ACTIVE)
return "active";
if (code == AlertStatus.INACTIVE)
@ -290,7 +294,7 @@ public class Alert extends DomainResource {
*/
public Alert setStatus(AlertStatus value) {
if (this.status == null)
this.status = new Enumeration<AlertStatus>();
this.status = new Enumeration<AlertStatus>(AlertStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance")
public class AllergyIntolerance extends DomainResource {
public enum AllergyIntoleranceStatus {
public enum AllergyIntoleranceStatus implements FhirEnum {
/**
* A low level of certainty about the propensity for a reaction to the identified Substance.
*/
@ -66,7 +66,10 @@ public class AllergyIntolerance extends DomainResource {
* added to help the parsers
*/
NULL;
public static AllergyIntoleranceStatus fromCode(String codeString) throws Exception {
public static final AllergyIntoleranceStatusEnumFactory ENUM_FACTORY = new AllergyIntoleranceStatusEnumFactory();
public static AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("unconfirmed".equals(codeString))
@ -77,8 +80,9 @@ public class AllergyIntolerance extends DomainResource {
return RESOLVED;
if ("refuted".equals(codeString))
return REFUTED;
throw new Exception("Unknown AllergyIntoleranceStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case UNCONFIRMED: return "unconfirmed";
@ -117,8 +121,8 @@ public class AllergyIntolerance extends DomainResource {
}
}
public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory<AllergyIntoleranceStatus> {
public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -130,9 +134,9 @@ public class AllergyIntolerance extends DomainResource {
return AllergyIntoleranceStatus.RESOLVED;
if ("refuted".equals(codeString))
return AllergyIntoleranceStatus.REFUTED;
throw new Exception("Unknown AllergyIntoleranceStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(AllergyIntoleranceStatus code) throws IllegalArgumentException {
if (code == AllergyIntoleranceStatus.UNCONFIRMED)
return "unconfirmed";
if (code == AllergyIntoleranceStatus.CONFIRMED)
@ -145,32 +149,43 @@ public class AllergyIntolerance extends DomainResource {
}
}
public enum AllergyIntoleranceCriticality {
public enum AllergyIntoleranceCriticality implements FhirEnum {
/**
* The potential clinical impact of a future reaction is estimated as low risk. Future exposure to the Substance is considered a relative contra-indication.
* The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication.
*/
LOW,
/**
* The potential clinical impact of a future reaction is estimated as high risk. Future exposure to the Substance may be considered an absolute contra-indication.
* The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication.
*/
HIGH,
/**
* Unable to assess the potential clinical impact with the information available.
*/
UNASSESSIBLE,
/**
* added to help the parsers
*/
NULL;
public static AllergyIntoleranceCriticality fromCode(String codeString) throws Exception {
public static final AllergyIntoleranceCriticalityEnumFactory ENUM_FACTORY = new AllergyIntoleranceCriticalityEnumFactory();
public static AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("low".equals(codeString))
return LOW;
if ("high".equals(codeString))
return HIGH;
throw new Exception("Unknown AllergyIntoleranceCriticality code '"+codeString+"'");
if ("unassessible".equals(codeString))
return UNASSESSIBLE;
throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case LOW: return "low";
case HIGH: return "high";
case UNASSESSIBLE: return "unassessible";
default: return "?";
}
}
@ -178,13 +193,15 @@ public class AllergyIntolerance extends DomainResource {
switch (this) {
case LOW: return "";
case HIGH: return "";
case UNASSESSIBLE: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case LOW: return "The potential clinical impact of a future reaction is estimated as low risk. Future exposure to the Substance is considered a relative contra-indication.";
case HIGH: return "The potential clinical impact of a future reaction is estimated as high risk. Future exposure to the Substance may be considered an absolute contra-indication.";
case LOW: return "The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication.";
case HIGH: return "The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication.";
case UNASSESSIBLE: return "Unable to assess the potential clinical impact with the information available.";
default: return "?";
}
}
@ -192,13 +209,14 @@ public class AllergyIntolerance extends DomainResource {
switch (this) {
case LOW: return "Low Risk";
case HIGH: return "High Risk";
case UNASSESSIBLE: return "Unable to determine";
default: return "?";
}
}
}
public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory<AllergyIntoleranceCriticality> {
public AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -206,18 +224,22 @@ public class AllergyIntolerance extends DomainResource {
return AllergyIntoleranceCriticality.LOW;
if ("high".equals(codeString))
return AllergyIntoleranceCriticality.HIGH;
throw new Exception("Unknown AllergyIntoleranceCriticality code '"+codeString+"'");
if ("unassessible".equals(codeString))
return AllergyIntoleranceCriticality.UNASSESSIBLE;
throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(AllergyIntoleranceCriticality code) throws IllegalArgumentException {
if (code == AllergyIntoleranceCriticality.LOW)
return "low";
if (code == AllergyIntoleranceCriticality.HIGH)
return "high";
if (code == AllergyIntoleranceCriticality.UNASSESSIBLE)
return "unassessible";
return "?";
}
}
public enum AllergyIntoleranceType {
public enum AllergyIntoleranceType implements FhirEnum {
/**
* Immune mediated reaction, including allergic reactions and hypersensitivities.
*/
@ -230,15 +252,19 @@ public class AllergyIntolerance extends DomainResource {
* added to help the parsers
*/
NULL;
public static AllergyIntoleranceType fromCode(String codeString) throws Exception {
public static final AllergyIntoleranceTypeEnumFactory ENUM_FACTORY = new AllergyIntoleranceTypeEnumFactory();
public static AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("immune".equals(codeString))
return IMMUNE;
if ("non-immune".equals(codeString))
return NONIMMUNE;
throw new Exception("Unknown AllergyIntoleranceType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case IMMUNE: return "immune";
@ -269,8 +295,8 @@ public class AllergyIntolerance extends DomainResource {
}
}
public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory<AllergyIntoleranceType> {
public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -278,9 +304,9 @@ public class AllergyIntolerance extends DomainResource {
return AllergyIntoleranceType.IMMUNE;
if ("non-immune".equals(codeString))
return AllergyIntoleranceType.NONIMMUNE;
throw new Exception("Unknown AllergyIntoleranceType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(AllergyIntoleranceType code) throws IllegalArgumentException {
if (code == AllergyIntoleranceType.IMMUNE)
return "immune";
if (code == AllergyIntoleranceType.NONIMMUNE)
@ -289,7 +315,7 @@ public class AllergyIntolerance extends DomainResource {
}
}
public enum AllergyIntoleranceCategory {
public enum AllergyIntoleranceCategory implements FhirEnum {
/**
* Any substance consumed to provide nutritional support for the body.
*/
@ -306,7 +332,10 @@ public class AllergyIntolerance extends DomainResource {
* added to help the parsers
*/
NULL;
public static AllergyIntoleranceCategory fromCode(String codeString) throws Exception {
public static final AllergyIntoleranceCategoryEnumFactory ENUM_FACTORY = new AllergyIntoleranceCategoryEnumFactory();
public static AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("food".equals(codeString))
@ -315,8 +344,9 @@ public class AllergyIntolerance extends DomainResource {
return MEDICATION;
if ("environment".equals(codeString))
return ENVIRONMENT;
throw new Exception("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case FOOD: return "food";
@ -351,8 +381,8 @@ public class AllergyIntolerance extends DomainResource {
}
}
public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory<AllergyIntoleranceCategory> {
public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -362,9 +392,9 @@ public class AllergyIntolerance extends DomainResource {
return AllergyIntoleranceCategory.MEDICATION;
if ("environment".equals(codeString))
return AllergyIntoleranceCategory.ENVIRONMENT;
throw new Exception("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(AllergyIntoleranceCategory code) throws IllegalArgumentException {
if (code == AllergyIntoleranceCategory.FOOD)
return "food";
if (code == AllergyIntoleranceCategory.MEDICATION)
@ -375,7 +405,7 @@ public class AllergyIntolerance extends DomainResource {
}
}
public enum ReactionEventCertainty {
public enum ReactionEventCertainty implements FhirEnum {
/**
* There is a low level of clinical certainty that the reaction was caused by the identified Substance.
*/
@ -392,7 +422,10 @@ public class AllergyIntolerance extends DomainResource {
* added to help the parsers
*/
NULL;
public static ReactionEventCertainty fromCode(String codeString) throws Exception {
public static final ReactionEventCertaintyEnumFactory ENUM_FACTORY = new ReactionEventCertaintyEnumFactory();
public static ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("unlikely".equals(codeString))
@ -401,8 +434,9 @@ public class AllergyIntolerance extends DomainResource {
return LIKELY;
if ("confirmed".equals(codeString))
return CONFIRMED;
throw new Exception("Unknown ReactionEventCertainty code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case UNLIKELY: return "unlikely";
@ -437,8 +471,8 @@ public class AllergyIntolerance extends DomainResource {
}
}
public static class ReactionEventCertaintyEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ReactionEventCertaintyEnumFactory implements EnumFactory<ReactionEventCertainty> {
public ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -448,9 +482,9 @@ public class AllergyIntolerance extends DomainResource {
return ReactionEventCertainty.LIKELY;
if ("confirmed".equals(codeString))
return ReactionEventCertainty.CONFIRMED;
throw new Exception("Unknown ReactionEventCertainty code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ReactionEventCertainty code) throws IllegalArgumentException {
if (code == ReactionEventCertainty.UNLIKELY)
return "unlikely";
if (code == ReactionEventCertainty.LIKELY)
@ -461,7 +495,7 @@ public class AllergyIntolerance extends DomainResource {
}
}
public enum ReactionEventSeverity {
public enum ReactionEventSeverity implements FhirEnum {
/**
* Causes mild physiological effects.
*/
@ -478,7 +512,10 @@ public class AllergyIntolerance extends DomainResource {
* added to help the parsers
*/
NULL;
public static ReactionEventSeverity fromCode(String codeString) throws Exception {
public static final ReactionEventSeverityEnumFactory ENUM_FACTORY = new ReactionEventSeverityEnumFactory();
public static ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("mild".equals(codeString))
@ -487,8 +524,9 @@ public class AllergyIntolerance extends DomainResource {
return MODERATE;
if ("severe".equals(codeString))
return SEVERE;
throw new Exception("Unknown ReactionEventSeverity code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case MILD: return "mild";
@ -523,8 +561,8 @@ public class AllergyIntolerance extends DomainResource {
}
}
public static class ReactionEventSeverityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ReactionEventSeverityEnumFactory implements EnumFactory<ReactionEventSeverity> {
public ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -534,9 +572,9 @@ public class AllergyIntolerance extends DomainResource {
return ReactionEventSeverity.MODERATE;
if ("severe".equals(codeString))
return ReactionEventSeverity.SEVERE;
throw new Exception("Unknown ReactionEventSeverity code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ReactionEventSeverity code) throws IllegalArgumentException {
if (code == ReactionEventSeverity.MILD)
return "mild";
if (code == ReactionEventSeverity.MODERATE)
@ -685,7 +723,7 @@ public class AllergyIntolerance extends DomainResource {
this.certainty = null;
else {
if (this.certainty == null)
this.certainty = new Enumeration<ReactionEventCertainty>();
this.certainty = new Enumeration<ReactionEventCertainty>(ReactionEventCertainty.ENUM_FACTORY);
this.certainty.setValue(value);
}
return this;
@ -801,14 +839,14 @@ public class AllergyIntolerance extends DomainResource {
/**
* @return Record of the date and/or time of the onset of the Reaction.
*/
public DateAndTime getOnset() {
public Date getOnset() {
return this.onset == null ? null : this.onset.getValue();
}
/**
* @param value Record of the date and/or time of the onset of the Reaction.
*/
public AllergyIntoleranceEventComponent setOnset(DateAndTime value) {
public AllergyIntoleranceEventComponent setOnset(Date value) {
if (value == null)
this.onset = null;
else {
@ -886,7 +924,7 @@ public class AllergyIntolerance extends DomainResource {
this.severity = null;
else {
if (this.severity == null)
this.severity = new Enumeration<ReactionEventSeverity>();
this.severity = new Enumeration<ReactionEventSeverity>(ReactionEventSeverity.ENUM_FACTORY);
this.severity.setValue(value);
}
return this;
@ -1063,7 +1101,7 @@ public class AllergyIntolerance extends DomainResource {
* Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.
*/
@Child(name="criticality", type={CodeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="low | high - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." )
@Description(shortDefinition="low | high | unassessible - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." )
protected Enumeration<AllergyIntoleranceCriticality> criticality;
/**
@ -1174,14 +1212,14 @@ public class AllergyIntolerance extends DomainResource {
/**
* @return Date when the sensitivity was recorded.
*/
public DateAndTime getRecordedDate() {
public Date getRecordedDate() {
return this.recordedDate == null ? null : this.recordedDate.getValue();
}
/**
* @param value Date when the sensitivity was recorded.
*/
public AllergyIntolerance setRecordedDate(DateAndTime value) {
public AllergyIntolerance setRecordedDate(Date value) {
if (value == null)
this.recordedDate = null;
else {
@ -1342,7 +1380,7 @@ public class AllergyIntolerance extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<AllergyIntoleranceStatus>();
this.status = new Enumeration<AllergyIntoleranceStatus>(AllergyIntoleranceStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -1391,7 +1429,7 @@ public class AllergyIntolerance extends DomainResource {
this.criticality = null;
else {
if (this.criticality == null)
this.criticality = new Enumeration<AllergyIntoleranceCriticality>();
this.criticality = new Enumeration<AllergyIntoleranceCriticality>(AllergyIntoleranceCriticality.ENUM_FACTORY);
this.criticality.setValue(value);
}
return this;
@ -1440,7 +1478,7 @@ public class AllergyIntolerance extends DomainResource {
this.type = null;
else {
if (this.type == null)
this.type = new Enumeration<AllergyIntoleranceType>();
this.type = new Enumeration<AllergyIntoleranceType>(AllergyIntoleranceType.ENUM_FACTORY);
this.type.setValue(value);
}
return this;
@ -1489,7 +1527,7 @@ public class AllergyIntolerance extends DomainResource {
this.category = null;
else {
if (this.category == null)
this.category = new Enumeration<AllergyIntoleranceCategory>();
this.category = new Enumeration<AllergyIntoleranceCategory>(AllergyIntoleranceCategory.ENUM_FACTORY);
this.category.setValue(value);
}
return this;
@ -1526,14 +1564,14 @@ public class AllergyIntolerance extends DomainResource {
/**
* @return Represents the date and/or time of the last known occurence of a reaction event.
*/
public DateAndTime getLastOccurence() {
public Date getLastOccurence() {
return this.lastOccurence == null ? null : this.lastOccurence.getValue();
}
/**
* @param value Represents the date and/or time of the last known occurence of a reaction event.
*/
public AllergyIntolerance setLastOccurence(DateAndTime value) {
public AllergyIntolerance setLastOccurence(Date value) {
if (value == null)
this.lastOccurence = null;
else {
@ -1692,13 +1730,13 @@ public class AllergyIntolerance extends DomainResource {
public static final String SP_LASTDATE = "last-date";
@SearchParamDefinition(name="severity", path="AllergyIntolerance.event.severity", description="mild | moderate | severe (of event as a whole)", type="token" )
public static final String SP_SEVERITY = "severity";
@SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="immune | non-immune - Underlying mechanism (if known)", type="token" )
public static final String SP_TYPE = "type";
@SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate", description="When recorded", type="date" )
public static final String SP_DATE = "date";
@SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="immune | non-immune - Underlying mechanism (if known)", type="token" )
public static final String SP_TYPE = "type";
@SearchParamDefinition(name="substance", path="AllergyIntolerance.substance|AllergyIntolerance.event.substance", description="Substance, (or class) considered to be responsible for risk", type="token" )
public static final String SP_SUBSTANCE = "substance";
@SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high - Estimated potential clinical harm", type="token" )
@SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high | unassessible - Estimated potential clinical harm", type="token" )
public static final String SP_CRITICALITY = "criticality";
@SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment - Category of Substance", type="token" )
public static final String SP_CATEGORY = "category";

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment")
public class Appointment extends DomainResource {
public enum Participantrequired {
public enum Participantrequired implements FhirEnum {
/**
* The participant is required to attend the appointment.
*/
@ -62,7 +62,10 @@ public class Appointment extends DomainResource {
* added to help the parsers
*/
NULL;
public static Participantrequired fromCode(String codeString) throws Exception {
public static final ParticipantrequiredEnumFactory ENUM_FACTORY = new ParticipantrequiredEnumFactory();
public static Participantrequired fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("required".equals(codeString))
@ -71,8 +74,9 @@ public class Appointment extends DomainResource {
return OPTIONAL;
if ("information-only".equals(codeString))
return INFORMATIONONLY;
throw new Exception("Unknown Participantrequired code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REQUIRED: return "required";
@ -107,8 +111,8 @@ public class Appointment extends DomainResource {
}
}
public static class ParticipantrequiredEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ParticipantrequiredEnumFactory implements EnumFactory<Participantrequired> {
public Participantrequired fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class Appointment extends DomainResource {
return Participantrequired.OPTIONAL;
if ("information-only".equals(codeString))
return Participantrequired.INFORMATIONONLY;
throw new Exception("Unknown Participantrequired code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(Participantrequired code) throws IllegalArgumentException {
if (code == Participantrequired.REQUIRED)
return "required";
if (code == Participantrequired.OPTIONAL)
@ -131,7 +135,7 @@ public class Appointment extends DomainResource {
}
}
public enum Participationstatus {
public enum Participationstatus implements FhirEnum {
/**
* The participant has accepted the appointment.
*/
@ -160,7 +164,10 @@ public class Appointment extends DomainResource {
* added to help the parsers
*/
NULL;
public static Participationstatus fromCode(String codeString) throws Exception {
public static final ParticipationstatusEnumFactory ENUM_FACTORY = new ParticipationstatusEnumFactory();
public static Participationstatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("accepted".equals(codeString))
@ -175,8 +182,9 @@ public class Appointment extends DomainResource {
return COMPLETED;
if ("needs-action".equals(codeString))
return NEEDSACTION;
throw new Exception("Unknown Participationstatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ACCEPTED: return "accepted";
@ -223,8 +231,8 @@ public class Appointment extends DomainResource {
}
}
public static class ParticipationstatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ParticipationstatusEnumFactory implements EnumFactory<Participationstatus> {
public Participationstatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -240,9 +248,9 @@ public class Appointment extends DomainResource {
return Participationstatus.COMPLETED;
if ("needs-action".equals(codeString))
return Participationstatus.NEEDSACTION;
throw new Exception("Unknown Participationstatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(Participationstatus code) throws IllegalArgumentException {
if (code == Participationstatus.ACCEPTED)
return "accepted";
if (code == Participationstatus.DECLINED)
@ -417,7 +425,7 @@ public class Appointment extends DomainResource {
this.required = null;
else {
if (this.required == null)
this.required = new Enumeration<Participantrequired>();
this.required = new Enumeration<Participantrequired>(Participantrequired.ENUM_FACTORY);
this.required.setValue(value);
}
return this;
@ -463,7 +471,7 @@ public class Appointment extends DomainResource {
*/
public AppointmentParticipantComponent setStatus(Participationstatus value) {
if (this.status == null)
this.status = new Enumeration<Participationstatus>();
this.status = new Enumeration<Participationstatus>(Participationstatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -890,14 +898,14 @@ public class Appointment extends DomainResource {
/**
* @return Date/Time that the appointment is to take place.
*/
public DateAndTime getStart() {
public Date getStart() {
return this.start == null ? null : this.start.getValue();
}
/**
* @param value Date/Time that the appointment is to take place.
*/
public Appointment setStart(DateAndTime value) {
public Appointment setStart(Date value) {
if (this.start == null)
this.start = new InstantType();
this.start.setValue(value);
@ -935,14 +943,14 @@ public class Appointment extends DomainResource {
/**
* @return Date/Time that the appointment is to conclude.
*/
public DateAndTime getEnd() {
public Date getEnd() {
return this.end == null ? null : this.end.getValue();
}
/**
* @param value Date/Time that the appointment is to conclude.
*/
public Appointment setEnd(DateAndTime value) {
public Appointment setEnd(Date value) {
if (this.end == null)
this.end = new InstantType();
this.end.setValue(value);
@ -1237,14 +1245,14 @@ public class Appointment extends DomainResource {
/**
* @return Date when the appointment was recorded.
*/
public DateAndTime getLastModified() {
public Date getLastModified() {
return this.lastModified == null ? null : this.lastModified.getValue();
}
/**
* @param value Date when the appointment was recorded.
*/
public Appointment setLastModified(DateAndTime value) {
public Appointment setLastModified(Date value) {
if (value == null)
this.lastModified = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse")
public class AppointmentResponse extends DomainResource {
public enum Participantstatus {
public enum Participantstatus implements FhirEnum {
/**
* The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse.
*/
@ -74,7 +74,10 @@ public class AppointmentResponse extends DomainResource {
* added to help the parsers
*/
NULL;
public static Participantstatus fromCode(String codeString) throws Exception {
public static final ParticipantstatusEnumFactory ENUM_FACTORY = new ParticipantstatusEnumFactory();
public static Participantstatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("accepted".equals(codeString))
@ -89,8 +92,9 @@ public class AppointmentResponse extends DomainResource {
return COMPLETED;
if ("needs-action".equals(codeString))
return NEEDSACTION;
throw new Exception("Unknown Participantstatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ACCEPTED: return "accepted";
@ -137,8 +141,8 @@ public class AppointmentResponse extends DomainResource {
}
}
public static class ParticipantstatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ParticipantstatusEnumFactory implements EnumFactory<Participantstatus> {
public Participantstatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -154,9 +158,9 @@ public class AppointmentResponse extends DomainResource {
return Participantstatus.COMPLETED;
if ("needs-action".equals(codeString))
return Participantstatus.NEEDSACTION;
throw new Exception("Unknown Participantstatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(Participantstatus code) throws IllegalArgumentException {
if (code == Participantstatus.ACCEPTED)
return "accepted";
if (code == Participantstatus.DECLINED)
@ -453,7 +457,7 @@ public class AppointmentResponse extends DomainResource {
*/
public AppointmentResponse setParticipantStatus(Participantstatus value) {
if (this.participantStatus == null)
this.participantStatus = new Enumeration<Participantstatus>();
this.participantStatus = new Enumeration<Participantstatus>(Participantstatus.ENUM_FACTORY);
this.participantStatus.setValue(value);
return this;
}
@ -538,14 +542,14 @@ public class AppointmentResponse extends DomainResource {
/**
* @return Date/Time that the appointment is to take place.
*/
public DateAndTime getStart() {
public Date getStart() {
return this.start == null ? null : this.start.getValue();
}
/**
* @param value Date/Time that the appointment is to take place.
*/
public AppointmentResponse setStart(DateAndTime value) {
public AppointmentResponse setStart(Date value) {
if (value == null)
this.start = null;
else {
@ -587,14 +591,14 @@ public class AppointmentResponse extends DomainResource {
/**
* @return Date/Time that the appointment is to conclude.
*/
public DateAndTime getEnd() {
public Date getEnd() {
return this.end == null ? null : this.end.getValue();
}
/**
* @param value Date/Time that the appointment is to conclude.
*/
public AppointmentResponse setEnd(DateAndTime value) {
public AppointmentResponse setEnd(Date value) {
if (value == null)
this.end = null;
else {
@ -675,14 +679,14 @@ public class AppointmentResponse extends DomainResource {
/**
* @return Date when the response was recorded or last updated.
*/
public DateAndTime getLastModified() {
public Date getLastModified() {
return this.lastModified == null ? null : this.lastModified.getValue();
}
/**
* @param value Date when the response was recorded or last updated.
*/
public AppointmentResponse setLastModified(DateAndTime value) {
public AppointmentResponse setLastModified(Date value) {
if (value == null)
this.lastModified = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -306,14 +306,14 @@ public class Availability extends DomainResource {
/**
* @return When this availability was created, or last revised.
*/
public DateAndTime getLastModified() {
public Date getLastModified() {
return this.lastModified == null ? null : this.lastModified.getValue();
}
/**
* @param value When this availability was created, or last revised.
*/
public Availability setLastModified(DateAndTime value) {
public Availability setLastModified(Date value) {
if (value == null)
this.lastModified = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -51,6 +51,13 @@ public class Base64BinaryType extends PrimitiveType<byte[]> {
setValue(theBytes);
}
/**
* Constructor
*/
public Base64BinaryType(String theValue) {
setValueAsString(theValue);
}
@Override
protected byte[] parse(String theValue) {
return Base64.decodeBase64(theValue);

View File

@ -20,6 +20,8 @@ package org.hl7.fhir.instance.model;
* #L%
*/
import static org.hl7.fhir.instance.model.TemporalPrecisionEnum.*;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
@ -30,15 +32,11 @@ import java.util.List;
import java.util.TimeZone;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.FastDateFormat;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.parser.DataFormatException;
import static org.hl7.fhir.instance.model.TemporalPrecisionEnum.*;
public abstract class BaseDateTimeType extends PrimitiveType<Date> {
private static final long serialVersionUID = 1L;
@ -64,6 +62,12 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
private static final FastDateFormat ourYearMonthNoDashesFormat = FastDateFormat.getInstance("yyyyMM");
private static final Pattern ourYearMonthPattern = Pattern.compile("[0-9]{4}[0-9]{2}");
private static final Pattern ourYearPattern = Pattern.compile("[0-9]{4}");
private static final FastDateFormat ourYearMonthDayTimeMinsFormat = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm");
private static final FastDateFormat ourYearMonthDayTimeMinsUTCZFormat = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"));
private static final FastDateFormat ourYearMonthDayTimeMinsZoneFormat = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mmZZ");
private static final FastDateFormat ourHumanDateTimeFormat = FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM);
private static final FastDateFormat ourHumanDateFormat = FastDateFormat.getDateInstance(FastDateFormat.MEDIUM);
static {
ArrayList<FastDateFormat> formatters = new ArrayList<FastDateFormat>();
@ -71,11 +75,14 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
formatters.add(ourYearMonthDayFormat);
formatters.add(ourYearMonthDayNoDashesFormat);
formatters.add(ourYearMonthDayTimeFormat);
formatters.add(ourYearMonthDayTimeMilliFormat);
formatters.add(ourYearMonthDayTimeUTCZFormat);
formatters.add(ourYearMonthDayTimeZoneFormat);
formatters.add(ourYearMonthDayTimeMilliFormat);
formatters.add(ourYearMonthDayTimeMilliUTCZFormat);
formatters.add(ourYearMonthDayTimeMilliZoneFormat);
formatters.add(ourYearMonthDayTimeZoneFormat);
formatters.add(ourYearMonthDayTimeMinsFormat);
formatters.add(ourYearMonthDayTimeMinsUTCZFormat);
formatters.add(ourYearMonthDayTimeMinsZoneFormat);
formatters.add(ourYearMonthFormat);
formatters.add(ourYearMonthNoDashesFormat);
ourFormatters = Collections.unmodifiableList(formatters);
@ -96,26 +103,26 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
/**
* Constructor
*
* @throws DataFormatException
* @throws IllegalArgumentException
* If the specified precision is not allowed for this type
*/
public BaseDateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) {
setValue(theDate, thePrecision);
if (isPrecisionAllowed(thePrecision) == false) {
throw new DataFormatException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + thePrecision + " precision): " + theDate);
throw new IllegalArgumentException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + thePrecision + " precision): " + theDate);
}
}
/**
* Constructor
*
* @throws DataFormatException
* @throws IllegalArgumentException
* If the specified precision is not allowed for this type
*/
public BaseDateTimeType(String theString) {
setValueAsString(theString);
if (isPrecisionAllowed(getPrecision()) == false) {
throw new DataFormatException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + getPrecision() + " precision): " + theString);
throw new IllegalArgumentException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + getPrecision() + " precision): " + theString);
}
}
@ -144,6 +151,18 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return ourYearMonthFormat.format(theValue);
case YEAR:
return ourYearFormat.format(theValue);
case MINUTE:
if (myTimeZoneZulu) {
GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
cal.setTime(theValue);
return ourYearMonthDayTimeMinsFormat.format(cal) + "Z";
} else if (myTimeZone != null) {
GregorianCalendar cal = new GregorianCalendar(myTimeZone);
cal.setTime(theValue);
return (ourYearMonthDayTimeMinsZoneFormat.format(cal));
} else {
return ourYearMonthDayTimeMinsFormat.format(theValue);
}
case SECOND:
if (myTimeZoneZulu) {
GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
@ -152,7 +171,7 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
} else if (myTimeZone != null) {
GregorianCalendar cal = new GregorianCalendar(myTimeZone);
cal.setTime(theValue);
return ourYearMonthDayTimeZoneFormat.format(cal);
return (ourYearMonthDayTimeZoneFormat.format(cal));
} else {
return ourYearMonthDayTimeFormat.format(theValue);
}
@ -164,7 +183,7 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
} else if (myTimeZone != null) {
GregorianCalendar cal = new GregorianCalendar(myTimeZone);
cal.setTime(theValue);
return ourYearMonthDayTimeMilliZoneFormat.format(cal);
return (ourYearMonthDayTimeMilliZoneFormat.format(cal));
} else {
return ourYearMonthDayTimeMilliFormat.format(theValue);
}
@ -237,11 +256,12 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
}
@Override
protected Date parse(String theValue) throws DataFormatException {
protected Date parse(String theValue) throws IllegalArgumentException {
try {
if (theValue.length() == 4 && ourYearPattern.matcher(theValue).matches()) {
if (!isPrecisionAllowed(YEAR)) {
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support YEAR precision): " + theValue);
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() +
// " does not support YEAR precision): " + theValue);
}
setPrecision(YEAR);
clearTimeZone();
@ -249,7 +269,8 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
} else if (theValue.length() == 6 && ourYearMonthPattern.matcher(theValue).matches()) {
// Eg. 198401 (allow this just to be lenient)
if (!isPrecisionAllowed(MONTH)) {
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support DAY precision): " + theValue);
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() +
// " does not support DAY precision): " + theValue);
}
setPrecision(MONTH);
clearTimeZone();
@ -257,7 +278,8 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
} else if (theValue.length() == 7 && ourYearDashMonthPattern.matcher(theValue).matches()) {
// E.g. 1984-01 (this is valid according to the spec)
if (!isPrecisionAllowed(MONTH)) {
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support MONTH precision): " + theValue);
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() +
// " does not support MONTH precision): " + theValue);
}
setPrecision(MONTH);
clearTimeZone();
@ -265,7 +287,8 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
} else if (theValue.length() == 8 && ourYearMonthDayPattern.matcher(theValue).matches()) {
// Eg. 19840101 (allow this just to be lenient)
if (!isPrecisionAllowed(DAY)) {
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support DAY precision): " + theValue);
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() +
// " does not support DAY precision): " + theValue);
}
setPrecision(DAY);
clearTimeZone();
@ -273,20 +296,30 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
} else if (theValue.length() == 10 && ourYearDashMonthDashDayPattern.matcher(theValue).matches()) {
// E.g. 1984-01-01 (this is valid according to the spec)
if (!isPrecisionAllowed(DAY)) {
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support DAY precision): " + theValue);
// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() +
// " does not support DAY precision): " + theValue);
}
setPrecision(DAY);
clearTimeZone();
return ((ourYearMonthDayFormat).parse(theValue));
} else if (theValue.length() >= 18) { // date and time with possible time zone
int dotIndex = theValue.indexOf('.', 18);
} else if (theValue.length() >= 16) { // date and time with possible time zone
int firstColonIndex = theValue.indexOf(':');
if (firstColonIndex == -1) {
throw new IllegalArgumentException("Invalid date/time string: " + theValue);
}
boolean hasSeconds = theValue.length() > firstColonIndex+3 ? theValue.charAt(firstColonIndex+3) == ':' : false;
int dotIndex = theValue.length() >= 18 ? theValue.indexOf('.', 18): -1;
boolean hasMillis = dotIndex > -1;
if (!hasMillis && !isPrecisionAllowed(SECOND)) {
// ourLog.debug("Invalid date/time string (data type does not support SECONDS precision): " + theValue);
} else if (hasMillis && !isPrecisionAllowed(MILLI)) {
// ourLog.debug("Invalid date/time string (data type " + getClass().getSimpleName() + " does not support MILLIS precision):" + theValue);
}
// if (!hasMillis && !isPrecisionAllowed(SECOND)) {
// ourLog.debug("Invalid date/time string (data type does not support SECONDS precision): " +
// theValue);
// } else if (hasMillis && !isPrecisionAllowed(MILLI)) {
// ourLog.debug("Invalid date/time string (data type " + getClass().getSimpleName() +
// " does not support MILLIS precision):" + theValue);
// }
Date retVal;
if (hasMillis) {
@ -299,11 +332,11 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
retVal = ourYearMonthDayTimeMilliFormat.parse(theValue);
}
} catch (ParseException p2) {
throw new DataFormatException("Invalid data/time string (" + p2.getMessage() + "): " + theValue);
throw new IllegalArgumentException("Invalid data/time string (" + p2.getMessage() + "): " + theValue);
}
setTimeZone(theValue, hasMillis);
setPrecision(TemporalPrecisionEnum.MILLI);
} else {
} else if (hasSeconds) {
try {
if (hasOffset(theValue)) {
retVal = ourYearMonthDayTimeZoneFormat.parse(theValue);
@ -313,19 +346,34 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
retVal = ourYearMonthDayTimeFormat.parse(theValue);
}
} catch (ParseException p2) {
throw new DataFormatException("Invalid data/time string (" + p2.getMessage() + "): " + theValue);
throw new IllegalArgumentException("Invalid data/time string (" + p2.getMessage() + "): " + theValue);
}
setTimeZone(theValue, hasMillis);
setPrecision(TemporalPrecisionEnum.SECOND);
} else {
try {
if (hasOffset(theValue)) {
retVal = ourYearMonthDayTimeMinsZoneFormat.parse(theValue);
} else if (theValue.endsWith("Z")) {
retVal = ourYearMonthDayTimeMinsUTCZFormat.parse(theValue);
} else {
retVal = ourYearMonthDayTimeMinsFormat.parse(theValue);
}
} catch (ParseException p2) {
throw new IllegalArgumentException("Invalid data/time string (" + p2.getMessage() + "): " + theValue, p2);
}
setTimeZone(theValue, hasMillis);
setPrecision(TemporalPrecisionEnum.MINUTE);
}
return retVal;
} else {
throw new DataFormatException("Invalid date/time string (invalid length): " + theValue);
throw new IllegalArgumentException("Invalid date/time string (invalid length): " + theValue);
}
} catch (ParseException e) {
throw new DataFormatException("Invalid date string (" + e.getMessage() + "): " + theValue);
throw new IllegalArgumentException("Invalid date string (" + e.getMessage() + "): " + theValue);
}
}
@ -338,9 +386,9 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
* <li>{@link Calendar#YEAR}
* </ul>
*
* @throws DataFormatException
* @throws IllegalArgumentException
*/
public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException {
public void setPrecision(TemporalPrecisionEnum thePrecision) throws IllegalArgumentException {
if (thePrecision == null) {
throw new NullPointerException("Precision may not be null");
}
@ -373,9 +421,9 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
}
@Override
public void setValue(Date theValue) {
public BaseDateTimeType setValue(Date theValue) {
clearTimeZone();
super.setValue(theValue);
return (BaseDateTimeType) super.setValue(theValue);
}
/**
@ -385,16 +433,16 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
* The date value
* @param thePrecision
* The precision
* @throws DataFormatException
* @throws IllegalArgumentException
*/
public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException {
public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws IllegalArgumentException {
clearTimeZone();
super.setValue(theValue);
myPrecision = thePrecision;
}
@Override
public void setValueAsString(String theValue) throws DataFormatException {
public void setValueAsString(String theValue) throws IllegalArgumentException {
clearTimeZone();
super.setValueAsString(theValue);
}
@ -406,4 +454,136 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return ourFormatters;
}
public boolean before(DateTimeType theDateTimeType) {
return getValue().before(theDateTimeType.getValue());
}
public boolean after(DateTimeType theDateTimeType) {
return getValue().after(theDateTimeType.getValue());
}
/**
* Returns a human readable version of this date/time using the system local format
*/
public String toHumanDisplay() {
switch (getPrecision()) {
case YEAR:
case MONTH:
case DAY:
return ourHumanDateFormat.format(getValue());
case MILLI:
case SECOND:
default:
return ourHumanDateTimeFormat.format(getValue());
}
}
/**
* Returns a view of this date/time as a Calendar object
*/
public Calendar toCalendar() {
Calendar retVal = Calendar.getInstance();
retVal.setTime(getValue());
retVal.setTimeZone(getTimeZone());
return retVal;
}
/**
* Sets the TimeZone offset in minutes relative to GMT
*/
public void setOffsetMinutes(int theZoneOffsetMinutes) {
int offsetAbs = Math.abs(theZoneOffsetMinutes);
int mins = offsetAbs % 60;
int hours = offsetAbs / 60;
if (theZoneOffsetMinutes < 0) {
setTimeZone(TimeZone.getTimeZone("GMT-" + hours + ":" + mins));
} else {
setTimeZone(TimeZone.getTimeZone("GMT+" + hours + ":" + mins));
}
}
/**
* Returns the time in millis as represented by this Date/Time
*/
public long getTime() {
return getValue().getTime();
}
/**
* Adds the given amount to the field specified by theField
*
* @param theField
* The field, uses constants from {@link Calendar} such as {@link Calendar#YEAR}
* @param theValue
* The number to add (or subtract for a negative number)
*/
public void add(int theField, int theValue) {
switch (theField) {
case Calendar.YEAR:
setValue(DateUtils.addYears(getValue(), theValue), getPrecision());
break;
case Calendar.MONTH:
setValue(DateUtils.addMonths(getValue(), theValue), getPrecision());
break;
case Calendar.DATE:
setValue(DateUtils.addDays(getValue(), theValue), getPrecision());
break;
case Calendar.HOUR:
setValue(DateUtils.addHours(getValue(), theValue), getPrecision());
break;
case Calendar.MINUTE:
setValue(DateUtils.addMinutes(getValue(), theValue), getPrecision());
break;
case Calendar.SECOND:
setValue(DateUtils.addSeconds(getValue(), theValue), getPrecision());
break;
case Calendar.MILLISECOND:
setValue(DateUtils.addMilliseconds(getValue(), theValue), getPrecision());
break;
default:
throw new IllegalArgumentException("Unknown field constant: " + theField);
}
}
protected void setValueAsV3String(String theV3String) {
if (StringUtils.isBlank(theV3String)) {
setValue(null);
} else {
StringBuilder b = new StringBuilder();
String timeZone = null;
for (int i = 0; i < theV3String.length(); i++) {
char nextChar = theV3String.charAt(i);
if (nextChar == '+' || nextChar == '-' || nextChar == 'Z') {
timeZone = (theV3String.substring(i));
break;
}
// assertEquals("2013-02-02T20:13:03-05:00", DateAndTime.parseV3("20130202201303-0500").toString());
if (i == 4 || i == 6) {
b.append('-');
} else if (i == 8) {
b.append('T');
} else if (i == 10 || i == 12) {
b.append(':');
}
b.append(nextChar);
}
if (timeZone != null && b.length() > 10) {
if (timeZone.length() ==5) {
b.append(timeZone.substring(0, 3));
b.append(':');
b.append(timeZone.substring(3));
}else {
b.append(timeZone);
}
}
setValueAsString(b.toString());
}
}
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -263,14 +263,14 @@ public class Basic extends DomainResource {
/**
* @return Identifies when the resource was first created.
*/
public DateAndTime getCreated() {
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value Identifies when the resource was first created.
*/
public Basic setCreated(DateAndTime value) {
public Basic setCreated(Date value) {
if (value == null)
this.created = null;
else {

View File

@ -29,12 +29,14 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
/**

View File

@ -33,8 +33,6 @@ package org.hl7.fhir.instance.model;
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
import ca.uhn.fhir.parser.DataFormatException;
/**
* Primitive type "boolean" in FHIR "true" or "false"
*/
@ -66,12 +64,13 @@ public class BooleanType extends PrimitiveType<Boolean> {
@Override
protected Boolean parse(String theValue) {
if ("true".equals(theValue)) {
String value = theValue.trim();
if ("true".equals(value)) {
return Boolean.TRUE;
} else if ("false".equals(theValue)) {
} else if ("false".equals(value)) {
return Boolean.FALSE;
} else {
throw new DataFormatException("Invalid boolean string: '" + theValue + "'");
throw new IllegalArgumentException("Invalid boolean string: '" + theValue + "'");
}
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle")
public class Bundle extends Resource {
public enum BundleType {
public enum BundleType implements FhirEnum {
/**
* The bundle is a document. The first resource is a Composition.
*/
@ -79,7 +79,10 @@ public class Bundle extends Resource {
* added to help the parsers
*/
NULL;
public static BundleType fromCode(String codeString) throws Exception {
public static final BundleTypeEnumFactory ENUM_FACTORY = new BundleTypeEnumFactory();
public static BundleType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("document".equals(codeString))
@ -96,8 +99,9 @@ public class Bundle extends Resource {
return SEARCHSET;
if ("collection".equals(codeString))
return COLLECTION;
throw new Exception("Unknown BundleType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case DOCUMENT: return "document";
@ -148,8 +152,8 @@ public class Bundle extends Resource {
}
}
public static class BundleTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class BundleTypeEnumFactory implements EnumFactory<BundleType> {
public BundleType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -167,9 +171,9 @@ public class Bundle extends Resource {
return BundleType.SEARCHSET;
if ("collection".equals(codeString))
return BundleType.COLLECTION;
throw new Exception("Unknown BundleType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(BundleType code) throws IllegalArgumentException {
if (code == BundleType.DOCUMENT)
return "document";
if (code == BundleType.MESSAGE)
@ -188,7 +192,7 @@ public class Bundle extends Resource {
}
}
public enum BundleEntryStatus {
public enum BundleEntryStatus implements FhirEnum {
/**
* Transaction: perform a create operation on this resource.
*/
@ -209,7 +213,10 @@ public class Bundle extends Resource {
* added to help the parsers
*/
NULL;
public static BundleEntryStatus fromCode(String codeString) throws Exception {
public static final BundleEntryStatusEnumFactory ENUM_FACTORY = new BundleEntryStatusEnumFactory();
public static BundleEntryStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("create".equals(codeString))
@ -220,8 +227,9 @@ public class Bundle extends Resource {
return MATCH;
if ("include".equals(codeString))
return INCLUDE;
throw new Exception("Unknown BundleEntryStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CREATE: return "create";
@ -260,8 +268,8 @@ public class Bundle extends Resource {
}
}
public static class BundleEntryStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class BundleEntryStatusEnumFactory implements EnumFactory<BundleEntryStatus> {
public BundleEntryStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -273,9 +281,9 @@ public class Bundle extends Resource {
return BundleEntryStatus.MATCH;
if ("include".equals(codeString))
return BundleEntryStatus.INCLUDE;
throw new Exception("Unknown BundleEntryStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(BundleEntryStatus code) throws IllegalArgumentException {
if (code == BundleEntryStatus.CREATE)
return "create";
if (code == BundleEntryStatus.UPDATE)
@ -569,7 +577,7 @@ public class Bundle extends Resource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<BundleEntryStatus>();
this.status = new Enumeration<BundleEntryStatus>(BundleEntryStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -758,9 +766,9 @@ public class Bundle extends Resource {
/**
* The id of the resource that was deleted.
*/
@Child(name="id", type={IdType.class}, order=2, min=1, max=1)
@Child(name="resourceId", type={IdType.class}, order=2, min=1, max=1)
@Description(shortDefinition="Id of resource that was deleted", formalDefinition="The id of the resource that was deleted." )
protected IdType id;
protected IdType resourceId;
/**
* Version id for releted resource.
@ -776,16 +784,16 @@ public class Bundle extends Resource {
@Description(shortDefinition="When the resource was deleted", formalDefinition="The date/time that the resource was deleted." )
protected InstantType instant;
private static final long serialVersionUID = 1013425873L;
private static final long serialVersionUID = -1528107649L;
public BundleEntryDeletedComponent() {
super();
}
public BundleEntryDeletedComponent(CodeType type, IdType id, IdType versionId, InstantType instant) {
public BundleEntryDeletedComponent(CodeType type, IdType resourceId, IdType versionId, InstantType instant) {
super();
this.type = type;
this.id = id;
this.resourceId = resourceId;
this.versionId = versionId;
this.instant = instant;
}
@ -836,47 +844,47 @@ public class Bundle extends Resource {
}
/**
* @return {@link #id} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value
* @return {@link #resourceId} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getResourceId" gives direct access to the value
*/
public IdType getIdElement() {
if (this.id == null)
public IdType getResourceIdElement() {
if (this.resourceId == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create BundleEntryDeletedComponent.id");
throw new Error("Attempt to auto-create BundleEntryDeletedComponent.resourceId");
else if (Configuration.doAutoCreate())
this.id = new IdType();
return this.id;
this.resourceId = new IdType();
return this.resourceId;
}
public boolean hasIdElement() {
return this.id != null && !this.id.isEmpty();
public boolean hasResourceIdElement() {
return this.resourceId != null && !this.resourceId.isEmpty();
}
public boolean hasId() {
return this.id != null && !this.id.isEmpty();
public boolean hasResourceId() {
return this.resourceId != null && !this.resourceId.isEmpty();
}
/**
* @param value {@link #id} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value
* @param value {@link #resourceId} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getResourceId" gives direct access to the value
*/
public BundleEntryDeletedComponent setIdElement(IdType value) {
this.id = value;
public BundleEntryDeletedComponent setResourceIdElement(IdType value) {
this.resourceId = value;
return this;
}
/**
* @return The id of the resource that was deleted.
*/
public String getId() {
return this.id == null ? null : this.id.getValue();
public String getResourceId() {
return this.resourceId == null ? null : this.resourceId.getValue();
}
/**
* @param value The id of the resource that was deleted.
*/
public BundleEntryDeletedComponent setId(String value) {
if (this.id == null)
this.id = new IdType();
this.id.setValue(value);
public BundleEntryDeletedComponent setResourceId(String value) {
if (this.resourceId == null)
this.resourceId = new IdType();
this.resourceId.setValue(value);
return this;
}
@ -956,14 +964,14 @@ public class Bundle extends Resource {
/**
* @return The date/time that the resource was deleted.
*/
public DateAndTime getInstant() {
public Date getInstant() {
return this.instant == null ? null : this.instant.getValue();
}
/**
* @param value The date/time that the resource was deleted.
*/
public BundleEntryDeletedComponent setInstant(DateAndTime value) {
public BundleEntryDeletedComponent setInstant(Date value) {
if (this.instant == null)
this.instant = new InstantType();
this.instant.setValue(value);
@ -973,7 +981,7 @@ public class Bundle extends Resource {
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("type", "code", "The type of resource that was deleted (required to construct the identity).", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("id", "id", "The id of the resource that was deleted.", 0, java.lang.Integer.MAX_VALUE, id));
childrenList.add(new Property("resourceId", "id", "The id of the resource that was deleted.", 0, java.lang.Integer.MAX_VALUE, resourceId));
childrenList.add(new Property("versionId", "id", "Version id for releted resource.", 0, java.lang.Integer.MAX_VALUE, versionId));
childrenList.add(new Property("instant", "instant", "The date/time that the resource was deleted.", 0, java.lang.Integer.MAX_VALUE, instant));
}
@ -982,15 +990,15 @@ public class Bundle extends Resource {
BundleEntryDeletedComponent dst = new BundleEntryDeletedComponent();
copyValues(dst);
dst.type = type == null ? null : type.copy();
dst.id = id == null ? null : id.copy();
dst.resourceId = resourceId == null ? null : resourceId.copy();
dst.versionId = versionId == null ? null : versionId.copy();
dst.instant = instant == null ? null : instant.copy();
return dst;
}
public boolean isEmpty() {
return super.isEmpty() && (type == null || type.isEmpty()) && (id == null || id.isEmpty()) && (versionId == null || versionId.isEmpty())
&& (instant == null || instant.isEmpty());
return super.isEmpty() && (type == null || type.isEmpty()) && (resourceId == null || resourceId.isEmpty())
&& (versionId == null || versionId.isEmpty()) && (instant == null || instant.isEmpty());
}
}
@ -1088,7 +1096,7 @@ public class Bundle extends Resource {
*/
public Bundle setType(BundleType value) {
if (this.type == null)
this.type = new Enumeration<BundleType>();
this.type = new Enumeration<BundleType>(BundleType.ENUM_FACTORY);
this.type.setValue(value);
return this;
}

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan")
public class CarePlan extends DomainResource {
public enum CarePlanStatus {
public enum CarePlanStatus implements FhirEnum {
/**
* The plan is in development or awaiting use but is not yet intended to be acted upon.
*/
@ -62,7 +62,10 @@ public class CarePlan extends DomainResource {
* added to help the parsers
*/
NULL;
public static CarePlanStatus fromCode(String codeString) throws Exception {
public static final CarePlanStatusEnumFactory ENUM_FACTORY = new CarePlanStatusEnumFactory();
public static CarePlanStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
@ -71,8 +74,9 @@ public class CarePlan extends DomainResource {
return ACTIVE;
if ("completed".equals(codeString))
return COMPLETED;
throw new Exception("Unknown CarePlanStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PLANNED: return "planned";
@ -107,8 +111,8 @@ public class CarePlan extends DomainResource {
}
}
public static class CarePlanStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CarePlanStatusEnumFactory implements EnumFactory<CarePlanStatus> {
public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class CarePlan extends DomainResource {
return CarePlanStatus.ACTIVE;
if ("completed".equals(codeString))
return CarePlanStatus.COMPLETED;
throw new Exception("Unknown CarePlanStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CarePlanStatus code) throws IllegalArgumentException {
if (code == CarePlanStatus.PLANNED)
return "planned";
if (code == CarePlanStatus.ACTIVE)
@ -131,7 +135,7 @@ public class CarePlan extends DomainResource {
}
}
public enum CarePlanGoalStatus {
public enum CarePlanGoalStatus implements FhirEnum {
/**
* The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again).
*/
@ -152,7 +156,10 @@ public class CarePlan extends DomainResource {
* added to help the parsers
*/
NULL;
public static CarePlanGoalStatus fromCode(String codeString) throws Exception {
public static final CarePlanGoalStatusEnumFactory ENUM_FACTORY = new CarePlanGoalStatusEnumFactory();
public static CarePlanGoalStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
@ -163,8 +170,9 @@ public class CarePlan extends DomainResource {
return SUSTAINING;
if ("cancelled".equals(codeString))
return CANCELLED;
throw new Exception("Unknown CarePlanGoalStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanGoalStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INPROGRESS: return "in progress";
@ -203,8 +211,8 @@ public class CarePlan extends DomainResource {
}
}
public static class CarePlanGoalStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CarePlanGoalStatusEnumFactory implements EnumFactory<CarePlanGoalStatus> {
public CarePlanGoalStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -216,9 +224,9 @@ public class CarePlan extends DomainResource {
return CarePlanGoalStatus.SUSTAINING;
if ("cancelled".equals(codeString))
return CarePlanGoalStatus.CANCELLED;
throw new Exception("Unknown CarePlanGoalStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanGoalStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CarePlanGoalStatus code) throws IllegalArgumentException {
if (code == CarePlanGoalStatus.INPROGRESS)
return "in progress";
if (code == CarePlanGoalStatus.ACHIEVED)
@ -231,7 +239,7 @@ public class CarePlan extends DomainResource {
}
}
public enum CarePlanActivityStatus {
public enum CarePlanActivityStatus implements FhirEnum {
/**
* Activity is planned but no action has yet been taken.
*/
@ -260,7 +268,10 @@ public class CarePlan extends DomainResource {
* added to help the parsers
*/
NULL;
public static CarePlanActivityStatus fromCode(String codeString) throws Exception {
public static final CarePlanActivityStatusEnumFactory ENUM_FACTORY = new CarePlanActivityStatusEnumFactory();
public static CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("not started".equals(codeString))
@ -275,8 +286,9 @@ public class CarePlan extends DomainResource {
return COMPLETED;
if ("cancelled".equals(codeString))
return CANCELLED;
throw new Exception("Unknown CarePlanActivityStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case NOTSTARTED: return "not started";
@ -323,8 +335,8 @@ public class CarePlan extends DomainResource {
}
}
public static class CarePlanActivityStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CarePlanActivityStatusEnumFactory implements EnumFactory<CarePlanActivityStatus> {
public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -340,9 +352,9 @@ public class CarePlan extends DomainResource {
return CarePlanActivityStatus.COMPLETED;
if ("cancelled".equals(codeString))
return CarePlanActivityStatus.CANCELLED;
throw new Exception("Unknown CarePlanActivityStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CarePlanActivityStatus code) throws IllegalArgumentException {
if (code == CarePlanActivityStatus.NOTSTARTED)
return "not started";
if (code == CarePlanActivityStatus.SCHEDULED)
@ -359,7 +371,7 @@ public class CarePlan extends DomainResource {
}
}
public enum CarePlanActivityCategory {
public enum CarePlanActivityCategory implements FhirEnum {
/**
* Plan for the patient to consume food of a specified nature.
*/
@ -392,7 +404,10 @@ public class CarePlan extends DomainResource {
* added to help the parsers
*/
NULL;
public static CarePlanActivityCategory fromCode(String codeString) throws Exception {
public static final CarePlanActivityCategoryEnumFactory ENUM_FACTORY = new CarePlanActivityCategoryEnumFactory();
public static CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("diet".equals(codeString))
@ -409,8 +424,9 @@ public class CarePlan extends DomainResource {
return SUPPLY;
if ("other".equals(codeString))
return OTHER;
throw new Exception("Unknown CarePlanActivityCategory code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case DIET: return "diet";
@ -461,8 +477,8 @@ public class CarePlan extends DomainResource {
}
}
public static class CarePlanActivityCategoryEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CarePlanActivityCategoryEnumFactory implements EnumFactory<CarePlanActivityCategory> {
public CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -480,9 +496,9 @@ public class CarePlan extends DomainResource {
return CarePlanActivityCategory.SUPPLY;
if ("other".equals(codeString))
return CarePlanActivityCategory.OTHER;
throw new Exception("Unknown CarePlanActivityCategory code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CarePlanActivityCategory code) throws IllegalArgumentException {
if (code == CarePlanActivityCategory.DIET)
return "diet";
if (code == CarePlanActivityCategory.DRUG)
@ -751,7 +767,7 @@ public class CarePlan extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<CarePlanGoalStatus>();
this.status = new Enumeration<CarePlanGoalStatus>(CarePlanGoalStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -1055,7 +1071,7 @@ public class CarePlan extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<CarePlanActivityStatus>();
this.status = new Enumeration<CarePlanActivityStatus>(CarePlanActivityStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -1429,7 +1445,7 @@ public class CarePlan extends DomainResource {
*/
public CarePlanActivitySimpleComponent setCategory(CarePlanActivityCategory value) {
if (this.category == null)
this.category = new Enumeration<CarePlanActivityCategory>();
this.category = new Enumeration<CarePlanActivityCategory>(CarePlanActivityCategory.ENUM_FACTORY);
this.category.setValue(value);
return this;
}
@ -1969,7 +1985,7 @@ public class CarePlan extends DomainResource {
*/
public CarePlan setStatus(CarePlanStatus value) {
if (this.status == null)
this.status = new Enumeration<CarePlanStatus>();
this.status = new Enumeration<CarePlanStatus>(CarePlanStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -2029,14 +2045,14 @@ public class CarePlan extends DomainResource {
/**
* @return Identifies the most recent date on which the plan has been revised.
*/
public DateAndTime getModified() {
public Date getModified() {
return this.modified == null ? null : this.modified.getValue();
}
/**
* @param value Identifies the most recent date on which the plan has been revised.
*/
public CarePlan setModified(DateAndTime value) {
public CarePlan setModified(Date value) {
if (value == null)
this.modified = null;
else {

View File

@ -0,0 +1,856 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
/**
* Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.
*/
@ResourceDef(name="CarePlan2", profile="http://hl7.org/fhir/Profile/CarePlan2")
public class CarePlan2 extends DomainResource {
public enum CarePlan2Status implements FhirEnum {
/**
* The plan is in development or awaiting use but is not yet intended to be acted upon.
*/
PLANNED,
/**
* The plan is intended to be followed and used as part of patient care.
*/
ACTIVE,
/**
* The plan is no longer in use and is not expected to be followed or used in patient care.
*/
COMPLETED,
/**
* added to help the parsers
*/
NULL;
public static final CarePlan2StatusEnumFactory ENUM_FACTORY = new CarePlan2StatusEnumFactory();
public static CarePlan2Status fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
return PLANNED;
if ("active".equals(codeString))
return ACTIVE;
if ("completed".equals(codeString))
return COMPLETED;
throw new IllegalArgumentException("Unknown CarePlan2Status code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PLANNED: return "planned";
case ACTIVE: return "active";
case COMPLETED: return "completed";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case PLANNED: return "";
case ACTIVE: return "";
case COMPLETED: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case PLANNED: return "The plan is in development or awaiting use but is not yet intended to be acted upon.";
case ACTIVE: return "The plan is intended to be followed and used as part of patient care.";
case COMPLETED: return "The plan is no longer in use and is not expected to be followed or used in patient care.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case PLANNED: return "planned";
case ACTIVE: return "active";
case COMPLETED: return "completed";
default: return "?";
}
}
}
public static class CarePlan2StatusEnumFactory implements EnumFactory<CarePlan2Status> {
public CarePlan2Status fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
return CarePlan2Status.PLANNED;
if ("active".equals(codeString))
return CarePlan2Status.ACTIVE;
if ("completed".equals(codeString))
return CarePlan2Status.COMPLETED;
throw new IllegalArgumentException("Unknown CarePlan2Status code '"+codeString+"'");
}
public String toCode(CarePlan2Status code) throws IllegalArgumentException {
if (code == CarePlan2Status.PLANNED)
return "planned";
if (code == CarePlan2Status.ACTIVE)
return "active";
if (code == CarePlan2Status.COMPLETED)
return "completed";
return "?";
}
}
@Block()
public static class CarePlan2ParticipantComponent extends BackboneElement {
/**
* Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.
*/
@Child(name="role", type={CodeableConcept.class}, order=1, min=0, max=1)
@Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc." )
protected CodeableConcept role;
/**
* The specific person or organization who is participating/expected to participate in the care plan.
*/
@Child(name="member", type={Practitioner.class, RelatedPerson.class, Patient.class, Organization.class}, order=2, min=1, max=1)
@Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care plan." )
protected Reference member;
/**
* The actual object that is the target of the reference (The specific person or organization who is participating/expected to participate in the care plan.)
*/
protected Resource memberTarget;
private static final long serialVersionUID = -466811117L;
public CarePlan2ParticipantComponent() {
super();
}
public CarePlan2ParticipantComponent(Reference member) {
super();
this.member = member;
}
/**
* @return {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.)
*/
public CodeableConcept getRole() {
if (this.role == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2ParticipantComponent.role");
else if (Configuration.doAutoCreate())
this.role = new CodeableConcept();
return this.role;
}
public boolean hasRole() {
return this.role != null && !this.role.isEmpty();
}
/**
* @param value {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.)
*/
public CarePlan2ParticipantComponent setRole(CodeableConcept value) {
this.role = value;
return this;
}
/**
* @return {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.)
*/
public Reference getMember() {
if (this.member == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2ParticipantComponent.member");
else if (Configuration.doAutoCreate())
this.member = new Reference();
return this.member;
}
public boolean hasMember() {
return this.member != null && !this.member.isEmpty();
}
/**
* @param value {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.)
*/
public CarePlan2ParticipantComponent setMember(Reference value) {
this.member = value;
return this;
}
/**
* @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.)
*/
public Resource getMemberTarget() {
return this.memberTarget;
}
/**
* @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.)
*/
public CarePlan2ParticipantComponent setMemberTarget(Resource value) {
this.memberTarget = value;
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc.", 0, java.lang.Integer.MAX_VALUE, role));
childrenList.add(new Property("member", "Reference(Practitioner|RelatedPerson|Patient|Organization)", "The specific person or organization who is participating/expected to participate in the care plan.", 0, java.lang.Integer.MAX_VALUE, member));
}
public CarePlan2ParticipantComponent copy() {
CarePlan2ParticipantComponent dst = new CarePlan2ParticipantComponent();
copyValues(dst);
dst.role = role == null ? null : role.copy();
dst.member = member == null ? null : member.copy();
return dst;
}
public boolean isEmpty() {
return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty())
;
}
}
/**
* This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
*/
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
protected List<Identifier> identifier;
/**
* Identifies the patient/subject whose intended care is described by the plan.
*/
@Child(name="patient", type={Patient.class}, order=0, min=0, max=1)
@Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." )
protected Reference patient;
/**
* The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.)
*/
protected Patient patientTarget;
/**
* Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.
*/
@Child(name="status", type={CodeType.class}, order=1, min=1, max=1)
@Description(shortDefinition="planned | active | completed", formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record." )
protected Enumeration<CarePlan2Status> status;
/**
* Indicates when the plan did (or is intended to) come into effect and end.
*/
@Child(name="period", type={Period.class}, order=2, min=0, max=1)
@Description(shortDefinition="Time period plan covers", formalDefinition="Indicates when the plan did (or is intended to) come into effect and end." )
protected Period period;
/**
* Identifies the most recent date on which the plan has been revised.
*/
@Child(name="modified", type={DateTimeType.class}, order=3, min=0, max=1)
@Description(shortDefinition="When last updated", formalDefinition="Identifies the most recent date on which the plan has been revised." )
protected DateTimeType modified;
/**
* Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.
*/
@Child(name="concern", type={Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Health issues this plan addresses", formalDefinition="Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan." )
protected List<Reference> concern;
/**
* The actual objects that are the target of the reference (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.)
*/
protected List<Condition> concernTarget;
/**
* Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
*/
@Child(name="participant", type={}, order=5, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Who's involved in plan?", formalDefinition="Identifies all people and organizations who are expected to be involved in the care envisioned by this plan." )
protected List<CarePlan2ParticipantComponent> participant;
/**
* General notes about the care plan not covered elsewhere.
*/
@Child(name="notes", type={StringType.class}, order=6, min=0, max=1)
@Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." )
protected StringType notes;
/**
* Describes the intended objective(s) of carrying out the Care Plan.
*/
@Child(name="goal", type={Goal.class}, order=7, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="CarePlan Goal", formalDefinition="Describes the intended objective(s) of carrying out the Care Plan." )
protected List<Reference> goal;
/**
* The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the Care Plan.)
*/
protected List<Goal> goalTarget;
/**
* Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
*/
@Child(name="activity", type={CareActivity.class}, order=8, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="CarePlan Activity", formalDefinition="Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc." )
protected List<Reference> activity;
/**
* The actual objects that are the target of the reference (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.)
*/
protected List<CareActivity> activityTarget;
private static final long serialVersionUID = -1325874459L;
public CarePlan2() {
super();
}
public CarePlan2(Enumeration<CarePlan2Status> status) {
super();
this.status = status;
}
/**
* @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
public List<Identifier> getIdentifier() {
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
return this.identifier;
}
public boolean hasIdentifier() {
if (this.identifier == null)
return false;
for (Identifier item : this.identifier)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
// syntactic sugar
public Identifier addIdentifier() { //3
Identifier t = new Identifier();
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return t;
}
/**
* @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Reference getPatient() {
if (this.patient == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2.patient");
else if (Configuration.doAutoCreate())
this.patient = new Reference();
return this.patient;
}
public boolean hasPatient() {
return this.patient != null && !this.patient.isEmpty();
}
/**
* @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.)
*/
public CarePlan2 setPatient(Reference value) {
this.patient = value;
return this;
}
/**
* @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Patient getPatientTarget() {
if (this.patientTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2.patient");
else if (Configuration.doAutoCreate())
this.patientTarget = new Patient();
return this.patientTarget;
}
/**
* @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.)
*/
public CarePlan2 setPatientTarget(Patient value) {
this.patientTarget = value;
return this;
}
/**
* @return {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Enumeration<CarePlan2Status> getStatusElement() {
if (this.status == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2.status");
else if (Configuration.doAutoCreate())
this.status = new Enumeration<CarePlan2Status>();
return this.status;
}
public boolean hasStatusElement() {
return this.status != null && !this.status.isEmpty();
}
public boolean hasStatus() {
return this.status != null && !this.status.isEmpty();
}
/**
* @param value {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public CarePlan2 setStatusElement(Enumeration<CarePlan2Status> value) {
this.status = value;
return this;
}
/**
* @return Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.
*/
public CarePlan2Status getStatus() {
return this.status == null ? null : this.status.getValue();
}
/**
* @param value Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.
*/
public CarePlan2 setStatus(CarePlan2Status value) {
if (this.status == null)
this.status = new Enumeration<CarePlan2Status>(CarePlan2Status.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
/**
* @return {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.)
*/
public Period getPeriod() {
if (this.period == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2.period");
else if (Configuration.doAutoCreate())
this.period = new Period();
return this.period;
}
public boolean hasPeriod() {
return this.period != null && !this.period.isEmpty();
}
/**
* @param value {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.)
*/
public CarePlan2 setPeriod(Period value) {
this.period = value;
return this;
}
/**
* @return {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value
*/
public DateTimeType getModifiedElement() {
if (this.modified == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2.modified");
else if (Configuration.doAutoCreate())
this.modified = new DateTimeType();
return this.modified;
}
public boolean hasModifiedElement() {
return this.modified != null && !this.modified.isEmpty();
}
public boolean hasModified() {
return this.modified != null && !this.modified.isEmpty();
}
/**
* @param value {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value
*/
public CarePlan2 setModifiedElement(DateTimeType value) {
this.modified = value;
return this;
}
/**
* @return Identifies the most recent date on which the plan has been revised.
*/
public Date getModified() {
return this.modified == null ? null : this.modified.getValue();
}
/**
* @param value Identifies the most recent date on which the plan has been revised.
*/
public CarePlan2 setModified(Date value) {
if (value == null)
this.modified = null;
else {
if (this.modified == null)
this.modified = new DateTimeType();
this.modified.setValue(value);
}
return this;
}
/**
* @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.)
*/
public List<Reference> getConcern() {
if (this.concern == null)
this.concern = new ArrayList<Reference>();
return this.concern;
}
public boolean hasConcern() {
if (this.concern == null)
return false;
for (Reference item : this.concern)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.)
*/
// syntactic sugar
public Reference addConcern() { //3
Reference t = new Reference();
if (this.concern == null)
this.concern = new ArrayList<Reference>();
this.concern.add(t);
return t;
}
/**
* @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.)
*/
public List<Condition> getConcernTarget() {
if (this.concernTarget == null)
this.concernTarget = new ArrayList<Condition>();
return this.concernTarget;
}
// syntactic sugar
/**
* @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.)
*/
public Condition addConcernTarget() {
Condition r = new Condition();
if (this.concernTarget == null)
this.concernTarget = new ArrayList<Condition>();
this.concernTarget.add(r);
return r;
}
/**
* @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.)
*/
public List<CarePlan2ParticipantComponent> getParticipant() {
if (this.participant == null)
this.participant = new ArrayList<CarePlan2ParticipantComponent>();
return this.participant;
}
public boolean hasParticipant() {
if (this.participant == null)
return false;
for (CarePlan2ParticipantComponent item : this.participant)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.)
*/
// syntactic sugar
public CarePlan2ParticipantComponent addParticipant() { //3
CarePlan2ParticipantComponent t = new CarePlan2ParticipantComponent();
if (this.participant == null)
this.participant = new ArrayList<CarePlan2ParticipantComponent>();
this.participant.add(t);
return t;
}
/**
* @return {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
*/
public StringType getNotesElement() {
if (this.notes == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlan2.notes");
else if (Configuration.doAutoCreate())
this.notes = new StringType();
return this.notes;
}
public boolean hasNotesElement() {
return this.notes != null && !this.notes.isEmpty();
}
public boolean hasNotes() {
return this.notes != null && !this.notes.isEmpty();
}
/**
* @param value {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
*/
public CarePlan2 setNotesElement(StringType value) {
this.notes = value;
return this;
}
/**
* @return General notes about the care plan not covered elsewhere.
*/
public String getNotes() {
return this.notes == null ? null : this.notes.getValue();
}
/**
* @param value General notes about the care plan not covered elsewhere.
*/
public CarePlan2 setNotes(String value) {
if (Utilities.noString(value))
this.notes = null;
else {
if (this.notes == null)
this.notes = new StringType();
this.notes.setValue(value);
}
return this;
}
/**
* @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.)
*/
public List<Reference> getGoal() {
if (this.goal == null)
this.goal = new ArrayList<Reference>();
return this.goal;
}
public boolean hasGoal() {
if (this.goal == null)
return false;
for (Reference item : this.goal)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.)
*/
// syntactic sugar
public Reference addGoal() { //3
Reference t = new Reference();
if (this.goal == null)
this.goal = new ArrayList<Reference>();
this.goal.add(t);
return t;
}
/**
* @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.)
*/
public List<Goal> getGoalTarget() {
if (this.goalTarget == null)
this.goalTarget = new ArrayList<Goal>();
return this.goalTarget;
}
// syntactic sugar
/**
* @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.)
*/
public Goal addGoalTarget() {
Goal r = new Goal();
if (this.goalTarget == null)
this.goalTarget = new ArrayList<Goal>();
this.goalTarget.add(r);
return r;
}
/**
* @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.)
*/
public List<Reference> getActivity() {
if (this.activity == null)
this.activity = new ArrayList<Reference>();
return this.activity;
}
public boolean hasActivity() {
if (this.activity == null)
return false;
for (Reference item : this.activity)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.)
*/
// syntactic sugar
public Reference addActivity() { //3
Reference t = new Reference();
if (this.activity == null)
this.activity = new ArrayList<Reference>();
this.activity.add(t);
return t;
}
/**
* @return {@link #activity} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.)
*/
public List<CareActivity> getActivityTarget() {
if (this.activityTarget == null)
this.activityTarget = new ArrayList<CareActivity>();
return this.activityTarget;
}
// syntactic sugar
/**
* @return {@link #activity} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.)
*/
public CareActivity addActivityTarget() {
CareActivity r = new CareActivity();
if (this.activityTarget == null)
this.activityTarget = new ArrayList<CareActivity>();
this.activityTarget.add(r);
return r;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient));
childrenList.add(new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.", 0, java.lang.Integer.MAX_VALUE, status));
childrenList.add(new Property("period", "Period", "Indicates when the plan did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period));
childrenList.add(new Property("modified", "dateTime", "Identifies the most recent date on which the plan has been revised.", 0, java.lang.Integer.MAX_VALUE, modified));
childrenList.add(new Property("concern", "Reference(Condition)", "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.", 0, java.lang.Integer.MAX_VALUE, concern));
childrenList.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.", 0, java.lang.Integer.MAX_VALUE, participant));
childrenList.add(new Property("notes", "string", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, notes));
childrenList.add(new Property("goal", "Reference(Goal)", "Describes the intended objective(s) of carrying out the Care Plan.", 0, java.lang.Integer.MAX_VALUE, goal));
childrenList.add(new Property("activity", "Reference(CareActivity)", "Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.", 0, java.lang.Integer.MAX_VALUE, activity));
}
public CarePlan2 copy() {
CarePlan2 dst = new CarePlan2();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
for (Identifier i : identifier)
dst.identifier.add(i.copy());
};
dst.patient = patient == null ? null : patient.copy();
dst.status = status == null ? null : status.copy();
dst.period = period == null ? null : period.copy();
dst.modified = modified == null ? null : modified.copy();
if (concern != null) {
dst.concern = new ArrayList<Reference>();
for (Reference i : concern)
dst.concern.add(i.copy());
};
if (participant != null) {
dst.participant = new ArrayList<CarePlan2ParticipantComponent>();
for (CarePlan2ParticipantComponent i : participant)
dst.participant.add(i.copy());
};
dst.notes = notes == null ? null : notes.copy();
if (goal != null) {
dst.goal = new ArrayList<Reference>();
for (Reference i : goal)
dst.goal.add(i.copy());
};
if (activity != null) {
dst.activity = new ArrayList<Reference>();
for (Reference i : activity)
dst.activity.add(i.copy());
};
return dst;
}
protected CarePlan2 typedCopy() {
return copy();
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty())
&& (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (modified == null || modified.isEmpty())
&& (concern == null || concern.isEmpty()) && (participant == null || participant.isEmpty())
&& (notes == null || notes.isEmpty()) && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty())
;
}
@Override
public ResourceType getResourceType() {
return ResourceType.CarePlan2;
}
@SearchParamDefinition(name="patient", path="CarePlan2.patient", description="Who care plan is for", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="condition", path="CarePlan2.concern", description="Health issues this plan addresses", type="reference" )
public static final String SP_CONDITION = "condition";
@SearchParamDefinition(name="participant", path="CarePlan2.participant.member", description="Who is involved", type="reference" )
public static final String SP_PARTICIPANT = "participant";
@SearchParamDefinition(name="date", path="CarePlan2.period", description="Time period plan covers", type="date" )
public static final String SP_DATE = "date";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse")
public class ClaimResponse extends DomainResource {
public enum RSLink {
public enum RSLink implements FhirEnum {
/**
* The processing completed without errors.
*/
@ -59,15 +59,19 @@ public class ClaimResponse extends DomainResource {
* added to help the parsers
*/
NULL;
public static RSLink fromCode(String codeString) throws Exception {
public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory();
public static RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
return COMPLETE;
if ("error".equals(codeString))
return ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case COMPLETE: return "complete";
@ -98,8 +102,8 @@ public class ClaimResponse extends DomainResource {
}
}
public static class RSLinkEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class RSLinkEnumFactory implements EnumFactory<RSLink> {
public RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -107,9 +111,9 @@ public class ClaimResponse extends DomainResource {
return RSLink.COMPLETE;
if ("error".equals(codeString))
return RSLink.ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(RSLink code) throws IllegalArgumentException {
if (code == RSLink.COMPLETE)
return "complete";
if (code == RSLink.ERROR)
@ -2328,9 +2332,9 @@ public class ClaimResponse extends DomainResource {
/**
* The date when the enclosed suite of services were performed or completed.
*/
@Child(name="date", type={DateType.class}, order=3, min=0, max=1)
@Child(name="created", type={DateTimeType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
protected DateType date;
protected DateTimeType created;
/**
* The Insurer who produced this adjudicated response.
@ -2487,7 +2491,7 @@ public class ClaimResponse extends DomainResource {
@Description(shortDefinition="Processing notes", formalDefinition="Note text." )
protected List<NotesComponent> note;
private static final long serialVersionUID = 2102880382L;
private static final long serialVersionUID = -1199888229L;
public ClaimResponse() {
super();
@ -2616,50 +2620,50 @@ public class ClaimResponse extends DomainResource {
}
/**
* @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateType getDateElement() {
if (this.date == null)
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ClaimResponse.date");
throw new Error("Attempt to auto-create ClaimResponse.created");
else if (Configuration.doAutoCreate())
this.date = new DateType();
return this.date;
this.created = new DateTimeType();
return this.created;
}
public boolean hasDateElement() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasDate() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public ClaimResponse setDateElement(DateType value) {
this.date = value;
public ClaimResponse setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when the enclosed suite of services were performed or completed.
*/
public DateAndTime getDate() {
return this.date == null ? null : this.date.getValue();
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when the enclosed suite of services were performed or completed.
*/
public ClaimResponse setDate(DateAndTime value) {
public ClaimResponse setCreated(Date value) {
if (value == null)
this.date = null;
this.created = null;
else {
if (this.date == null)
this.date = new DateType();
this.date.setValue(value);
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
@ -2839,7 +2843,7 @@ public class ClaimResponse extends DomainResource {
this.outcome = null;
else {
if (this.outcome == null)
this.outcome = new Enumeration<RSLink>();
this.outcome = new Enumeration<RSLink>(RSLink.ENUM_FACTORY);
this.outcome.setValue(value);
}
return this;
@ -3159,14 +3163,14 @@ public class ClaimResponse extends DomainResource {
/**
* @return Estimated payment data.
*/
public DateAndTime getPaymentDate() {
public Date getPaymentDate() {
return this.paymentDate == null ? null : this.paymentDate.getValue();
}
/**
* @param value Estimated payment data.
*/
public ClaimResponse setPaymentDate(DateAndTime value) {
public ClaimResponse setPaymentDate(Date value) {
if (value == null)
this.paymentDate = null;
else {
@ -3309,7 +3313,7 @@ public class ClaimResponse extends DomainResource {
childrenList.add(new Property("request", "Reference(OralHealthClaim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request));
childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date));
childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization));
childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider));
childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization));
@ -3343,7 +3347,7 @@ public class ClaimResponse extends DomainResource {
dst.request = request == null ? null : request.copy();
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.date = date == null ? null : date.copy();
dst.created = created == null ? null : created.copy();
dst.organization = organization == null ? null : organization.copy();
dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
@ -3390,11 +3394,11 @@ public class ClaimResponse extends DomainResource {
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty())
&& (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty())
&& (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty())
&& (requestOrganization == null || requestOrganization.isEmpty()) && (outcome == null || outcome.isEmpty())
&& (disposition == null || disposition.isEmpty()) && (payeeType == null || payeeType.isEmpty())
&& (item == null || item.isEmpty()) && (additem == null || additem.isEmpty()) && (error == null || error.isEmpty())
&& (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty())
&& (created == null || created.isEmpty()) && (organization == null || organization.isEmpty())
&& (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty())
&& (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty())
&& (payeeType == null || payeeType.isEmpty()) && (item == null || item.isEmpty()) && (additem == null || additem.isEmpty())
&& (error == null || error.isEmpty()) && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty())
&& (totalBenefit == null || totalBenefit.isEmpty()) && (paymentAdjustment == null || paymentAdjustment.isEmpty())
&& (paymentAdjustmentReason == null || paymentAdjustmentReason.isEmpty()) && (paymentDate == null || paymentDate.isEmpty())
&& (paymentAmount == null || paymentAmount.isEmpty()) && (paymentRef == null || paymentRef.isEmpty())

File diff suppressed because it is too large Load Diff

View File

@ -28,8 +28,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/
package org.hl7.fhir.instance.model;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.model.primitive.CodeDt;
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
import static org.apache.commons.lang3.StringUtils.defaultString;
@ -40,6 +38,8 @@ import static org.apache.commons.lang3.StringUtils.defaultString;
@DatatypeDef(name = "code")
public class CodeType extends PrimitiveType<String> implements Comparable<CodeType> {
private static final long serialVersionUID = 1L;
/**
* Constructor
*/

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -0,0 +1,917 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
/**
* An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.
*/
@ResourceDef(name="Communication", profile="http://hl7.org/fhir/Profile/Communication")
public class Communication extends DomainResource {
public enum CommunicationStatus implements FhirEnum {
/**
* The communication transmission is ongoing.
*/
INPROGRESS,
/**
* The message transmission is complete, i.e., delivered to the recipient's destination.
*/
COMPLETED,
/**
* The communication transmission has been held by originating system/user request.
*/
SUSPENDED,
/**
* The receiving system has declined to accept the message.
*/
REJECTED,
/**
* There was a failure in transmitting the message out.
*/
FAILED,
/**
* added to help the parsers
*/
NULL;
public static final CommunicationStatusEnumFactory ENUM_FACTORY = new CommunicationStatusEnumFactory();
public static CommunicationStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
return INPROGRESS;
if ("completed".equals(codeString))
return COMPLETED;
if ("suspended".equals(codeString))
return SUSPENDED;
if ("rejected".equals(codeString))
return REJECTED;
if ("failed".equals(codeString))
return FAILED;
throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INPROGRESS: return "in progress";
case COMPLETED: return "completed";
case SUSPENDED: return "suspended";
case REJECTED: return "rejected";
case FAILED: return "failed";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case INPROGRESS: return "";
case COMPLETED: return "";
case SUSPENDED: return "";
case REJECTED: return "";
case FAILED: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case INPROGRESS: return "The communication transmission is ongoing.";
case COMPLETED: return "The message transmission is complete, i.e., delivered to the recipient's destination.";
case SUSPENDED: return "The communication transmission has been held by originating system/user request.";
case REJECTED: return "The receiving system has declined to accept the message.";
case FAILED: return "There was a failure in transmitting the message out.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case INPROGRESS: return "in progress";
case COMPLETED: return "completed";
case SUSPENDED: return "suspended";
case REJECTED: return "rejected";
case FAILED: return "failed";
default: return "?";
}
}
}
public static class CommunicationStatusEnumFactory implements EnumFactory<CommunicationStatus> {
public CommunicationStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
return CommunicationStatus.INPROGRESS;
if ("completed".equals(codeString))
return CommunicationStatus.COMPLETED;
if ("suspended".equals(codeString))
return CommunicationStatus.SUSPENDED;
if ("rejected".equals(codeString))
return CommunicationStatus.REJECTED;
if ("failed".equals(codeString))
return CommunicationStatus.FAILED;
throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'");
}
public String toCode(CommunicationStatus code) throws IllegalArgumentException {
if (code == CommunicationStatus.INPROGRESS)
return "in progress";
if (code == CommunicationStatus.COMPLETED)
return "completed";
if (code == CommunicationStatus.SUSPENDED)
return "suspended";
if (code == CommunicationStatus.REJECTED)
return "rejected";
if (code == CommunicationStatus.FAILED)
return "failed";
return "?";
}
}
@Block()
public static class CommunicationMessagePartComponent extends BackboneElement {
/**
* An individual message part for multi-part messages.
*/
@Child(name="content", type={StringType.class, Attachment.class}, order=1, min=1, max=1)
@Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." )
protected Type content;
private static final long serialVersionUID = -1763459053L;
public CommunicationMessagePartComponent() {
super();
}
public CommunicationMessagePartComponent(Type content) {
super();
this.content = content;
}
/**
* @return {@link #content} (An individual message part for multi-part messages.)
*/
public Type getContent() {
return this.content;
}
/**
* @return {@link #content} (An individual message part for multi-part messages.)
*/
public StringType getContentStringType() throws Exception {
if (!(this.content instanceof StringType))
throw new Exception("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered");
return (StringType) this.content;
}
/**
* @return {@link #content} (An individual message part for multi-part messages.)
*/
public Attachment getContentAttachment() throws Exception {
if (!(this.content instanceof Attachment))
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
return (Attachment) this.content;
}
/**
* @return {@link #content} (An individual message part for multi-part messages.)
*/
public Reference getContentReference() throws Exception {
if (!(this.content instanceof Reference))
throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered");
return (Reference) this.content;
}
public boolean hasContent() {
return this.content != null && !this.content.isEmpty();
}
/**
* @param value {@link #content} (An individual message part for multi-part messages.)
*/
public CommunicationMessagePartComponent setContent(Type value) {
this.content = value;
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "An individual message part for multi-part messages.", 0, java.lang.Integer.MAX_VALUE, content));
}
public CommunicationMessagePartComponent copy() {
CommunicationMessagePartComponent dst = new CommunicationMessagePartComponent();
copyValues(dst);
dst.content = content == null ? null : content.copy();
return dst;
}
public boolean isEmpty() {
return super.isEmpty() && (content == null || content.isEmpty());
}
}
/**
* Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
*/
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Unique identifier", formalDefinition="Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
protected List<Identifier> identifier;
/**
* The type of message such as alert, notification, reminder, instruction, etc.
*/
@Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1)
@Description(shortDefinition="Message category", formalDefinition="The type of message such as alert, notification, reminder, instruction, etc." )
protected CodeableConcept category;
/**
* The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.
*/
@Child(name="sender", type={Patient.class, Practitioner.class, Device.class, RelatedPerson.class, Organization.class}, order=1, min=0, max=1)
@Description(shortDefinition="Message sender", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication." )
protected Reference sender;
/**
* The actual object that is the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.)
*/
protected Resource senderTarget;
/**
* The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.
*/
@Child(name="recipient", type={Patient.class, Device.class, RelatedPerson.class, Practitioner.class}, order=2, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication." )
protected List<Reference> recipient;
/**
* The actual objects that are the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.)
*/
protected List<Resource> recipientTarget;
/**
* Text, attachment(s), or resource(s) to be communicated to the recipient.
*/
@Child(name="messagePart", type={}, order=3, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) to be communicated to the recipient." )
protected List<CommunicationMessagePartComponent> messagePart;
/**
* The communication medium, e.g., email, fax.
*/
@Child(name="medium", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Communication medium", formalDefinition="The communication medium, e.g., email, fax." )
protected List<CodeableConcept> medium;
/**
* The status of the transmission.
*/
@Child(name="status", type={CodeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="in progress | completed | suspended | rejected | failed", formalDefinition="The status of the transmission." )
protected Enumeration<CommunicationStatus> status;
/**
* The encounter within which the communication was sent.
*/
@Child(name="encounter", type={Encounter.class}, order=6, min=0, max=1)
@Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication was sent." )
protected Reference encounter;
/**
* The actual object that is the target of the reference (The encounter within which the communication was sent.)
*/
protected Encounter encounterTarget;
/**
* The time when this communication was sent.
*/
@Child(name="sent", type={DateTimeType.class}, order=7, min=0, max=1)
@Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." )
protected DateTimeType sent;
/**
* The time when this communication arrived at the destination.
*/
@Child(name="received", type={DateTimeType.class}, order=8, min=0, max=1)
@Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." )
protected DateTimeType received;
/**
* The reason or justification for the communication.
*/
@Child(name="indication", type={CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." )
protected List<CodeableConcept> indication;
/**
* The patient who is the focus of this communication.
*/
@Child(name="subject", type={Patient.class}, order=10, min=1, max=1)
@Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication." )
protected Reference subject;
/**
* The actual object that is the target of the reference (The patient who is the focus of this communication.)
*/
protected Patient subjectTarget;
private static final long serialVersionUID = -817648825L;
public Communication() {
super();
}
public Communication(Reference subject) {
super();
this.subject = subject;
}
/**
* @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
public List<Identifier> getIdentifier() {
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
return this.identifier;
}
public boolean hasIdentifier() {
if (this.identifier == null)
return false;
for (Identifier item : this.identifier)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
// syntactic sugar
public Identifier addIdentifier() { //3
Identifier t = new Identifier();
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return t;
}
/**
* @return {@link #category} (The type of message such as alert, notification, reminder, instruction, etc.)
*/
public CodeableConcept getCategory() {
if (this.category == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.category");
else if (Configuration.doAutoCreate())
this.category = new CodeableConcept();
return this.category;
}
public boolean hasCategory() {
return this.category != null && !this.category.isEmpty();
}
/**
* @param value {@link #category} (The type of message such as alert, notification, reminder, instruction, etc.)
*/
public Communication setCategory(CodeableConcept value) {
this.category = value;
return this;
}
/**
* @return {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.)
*/
public Reference getSender() {
if (this.sender == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.sender");
else if (Configuration.doAutoCreate())
this.sender = new Reference();
return this.sender;
}
public boolean hasSender() {
return this.sender != null && !this.sender.isEmpty();
}
/**
* @param value {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.)
*/
public Communication setSender(Reference value) {
this.sender = value;
return this;
}
/**
* @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.)
*/
public Resource getSenderTarget() {
return this.senderTarget;
}
/**
* @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.)
*/
public Communication setSenderTarget(Resource value) {
this.senderTarget = value;
return this;
}
/**
* @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.)
*/
public List<Reference> getRecipient() {
if (this.recipient == null)
this.recipient = new ArrayList<Reference>();
return this.recipient;
}
public boolean hasRecipient() {
if (this.recipient == null)
return false;
for (Reference item : this.recipient)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.)
*/
// syntactic sugar
public Reference addRecipient() { //3
Reference t = new Reference();
if (this.recipient == null)
this.recipient = new ArrayList<Reference>();
this.recipient.add(t);
return t;
}
/**
* @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.)
*/
public List<Resource> getRecipientTarget() {
if (this.recipientTarget == null)
this.recipientTarget = new ArrayList<Resource>();
return this.recipientTarget;
}
/**
* @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.)
*/
public List<CommunicationMessagePartComponent> getMessagePart() {
if (this.messagePart == null)
this.messagePart = new ArrayList<CommunicationMessagePartComponent>();
return this.messagePart;
}
public boolean hasMessagePart() {
if (this.messagePart == null)
return false;
for (CommunicationMessagePartComponent item : this.messagePart)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.)
*/
// syntactic sugar
public CommunicationMessagePartComponent addMessagePart() { //3
CommunicationMessagePartComponent t = new CommunicationMessagePartComponent();
if (this.messagePart == null)
this.messagePart = new ArrayList<CommunicationMessagePartComponent>();
this.messagePart.add(t);
return t;
}
/**
* @return {@link #medium} (The communication medium, e.g., email, fax.)
*/
public List<CodeableConcept> getMedium() {
if (this.medium == null)
this.medium = new ArrayList<CodeableConcept>();
return this.medium;
}
public boolean hasMedium() {
if (this.medium == null)
return false;
for (CodeableConcept item : this.medium)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #medium} (The communication medium, e.g., email, fax.)
*/
// syntactic sugar
public CodeableConcept addMedium() { //3
CodeableConcept t = new CodeableConcept();
if (this.medium == null)
this.medium = new ArrayList<CodeableConcept>();
this.medium.add(t);
return t;
}
/**
* @return {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Enumeration<CommunicationStatus> getStatusElement() {
if (this.status == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.status");
else if (Configuration.doAutoCreate())
this.status = new Enumeration<CommunicationStatus>();
return this.status;
}
public boolean hasStatusElement() {
return this.status != null && !this.status.isEmpty();
}
public boolean hasStatus() {
return this.status != null && !this.status.isEmpty();
}
/**
* @param value {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Communication setStatusElement(Enumeration<CommunicationStatus> value) {
this.status = value;
return this;
}
/**
* @return The status of the transmission.
*/
public CommunicationStatus getStatus() {
return this.status == null ? null : this.status.getValue();
}
/**
* @param value The status of the transmission.
*/
public Communication setStatus(CommunicationStatus value) {
if (value == null)
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<CommunicationStatus>(CommunicationStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
}
/**
* @return {@link #encounter} (The encounter within which the communication was sent.)
*/
public Reference getEncounter() {
if (this.encounter == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.encounter");
else if (Configuration.doAutoCreate())
this.encounter = new Reference();
return this.encounter;
}
public boolean hasEncounter() {
return this.encounter != null && !this.encounter.isEmpty();
}
/**
* @param value {@link #encounter} (The encounter within which the communication was sent.)
*/
public Communication setEncounter(Reference value) {
this.encounter = value;
return this;
}
/**
* @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.)
*/
public Encounter getEncounterTarget() {
if (this.encounterTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.encounter");
else if (Configuration.doAutoCreate())
this.encounterTarget = new Encounter();
return this.encounterTarget;
}
/**
* @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.)
*/
public Communication setEncounterTarget(Encounter value) {
this.encounterTarget = value;
return this;
}
/**
* @return {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value
*/
public DateTimeType getSentElement() {
if (this.sent == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.sent");
else if (Configuration.doAutoCreate())
this.sent = new DateTimeType();
return this.sent;
}
public boolean hasSentElement() {
return this.sent != null && !this.sent.isEmpty();
}
public boolean hasSent() {
return this.sent != null && !this.sent.isEmpty();
}
/**
* @param value {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value
*/
public Communication setSentElement(DateTimeType value) {
this.sent = value;
return this;
}
/**
* @return The time when this communication was sent.
*/
public Date getSent() {
return this.sent == null ? null : this.sent.getValue();
}
/**
* @param value The time when this communication was sent.
*/
public Communication setSent(Date value) {
if (value == null)
this.sent = null;
else {
if (this.sent == null)
this.sent = new DateTimeType();
this.sent.setValue(value);
}
return this;
}
/**
* @return {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value
*/
public DateTimeType getReceivedElement() {
if (this.received == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.received");
else if (Configuration.doAutoCreate())
this.received = new DateTimeType();
return this.received;
}
public boolean hasReceivedElement() {
return this.received != null && !this.received.isEmpty();
}
public boolean hasReceived() {
return this.received != null && !this.received.isEmpty();
}
/**
* @param value {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value
*/
public Communication setReceivedElement(DateTimeType value) {
this.received = value;
return this;
}
/**
* @return The time when this communication arrived at the destination.
*/
public Date getReceived() {
return this.received == null ? null : this.received.getValue();
}
/**
* @param value The time when this communication arrived at the destination.
*/
public Communication setReceived(Date value) {
if (value == null)
this.received = null;
else {
if (this.received == null)
this.received = new DateTimeType();
this.received.setValue(value);
}
return this;
}
/**
* @return {@link #indication} (The reason or justification for the communication.)
*/
public List<CodeableConcept> getIndication() {
if (this.indication == null)
this.indication = new ArrayList<CodeableConcept>();
return this.indication;
}
public boolean hasIndication() {
if (this.indication == null)
return false;
for (CodeableConcept item : this.indication)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #indication} (The reason or justification for the communication.)
*/
// syntactic sugar
public CodeableConcept addIndication() { //3
CodeableConcept t = new CodeableConcept();
if (this.indication == null)
this.indication = new ArrayList<CodeableConcept>();
this.indication.add(t);
return t;
}
/**
* @return {@link #subject} (The patient who is the focus of this communication.)
*/
public Reference getSubject() {
if (this.subject == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.subject");
else if (Configuration.doAutoCreate())
this.subject = new Reference();
return this.subject;
}
public boolean hasSubject() {
return this.subject != null && !this.subject.isEmpty();
}
/**
* @param value {@link #subject} (The patient who is the focus of this communication.)
*/
public Communication setSubject(Reference value) {
this.subject = value;
return this;
}
/**
* @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication.)
*/
public Patient getSubjectTarget() {
if (this.subjectTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Communication.subject");
else if (Configuration.doAutoCreate())
this.subjectTarget = new Patient();
return this.subjectTarget;
}
/**
* @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication.)
*/
public Communication setSubjectTarget(Patient value) {
this.subjectTarget = value;
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("category", "CodeableConcept", "The type of message such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category));
childrenList.add(new Property("sender", "Reference(Patient|Practitioner|Device|RelatedPerson|Organization)", "The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender));
childrenList.add(new Property("recipient", "Reference(Patient|Device|RelatedPerson|Practitioner)", "The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient));
childrenList.add(new Property("messagePart", "", "Text, attachment(s), or resource(s) to be communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, messagePart));
childrenList.add(new Property("medium", "CodeableConcept", "The communication medium, e.g., email, fax.", 0, java.lang.Integer.MAX_VALUE, medium));
childrenList.add(new Property("status", "code", "The status of the transmission.", 0, java.lang.Integer.MAX_VALUE, status));
childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication was sent.", 0, java.lang.Integer.MAX_VALUE, encounter));
childrenList.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, java.lang.Integer.MAX_VALUE, sent));
childrenList.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, java.lang.Integer.MAX_VALUE, received));
childrenList.add(new Property("indication", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, indication));
childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication.", 0, java.lang.Integer.MAX_VALUE, subject));
}
public Communication copy() {
Communication dst = new Communication();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
for (Identifier i : identifier)
dst.identifier.add(i.copy());
};
dst.category = category == null ? null : category.copy();
dst.sender = sender == null ? null : sender.copy();
if (recipient != null) {
dst.recipient = new ArrayList<Reference>();
for (Reference i : recipient)
dst.recipient.add(i.copy());
};
if (messagePart != null) {
dst.messagePart = new ArrayList<CommunicationMessagePartComponent>();
for (CommunicationMessagePartComponent i : messagePart)
dst.messagePart.add(i.copy());
};
if (medium != null) {
dst.medium = new ArrayList<CodeableConcept>();
for (CodeableConcept i : medium)
dst.medium.add(i.copy());
};
dst.status = status == null ? null : status.copy();
dst.encounter = encounter == null ? null : encounter.copy();
dst.sent = sent == null ? null : sent.copy();
dst.received = received == null ? null : received.copy();
if (indication != null) {
dst.indication = new ArrayList<CodeableConcept>();
for (CodeableConcept i : indication)
dst.indication.add(i.copy());
};
dst.subject = subject == null ? null : subject.copy();
return dst;
}
protected Communication typedCopy() {
return copy();
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty())
&& (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (messagePart == null || messagePart.isEmpty())
&& (medium == null || medium.isEmpty()) && (status == null || status.isEmpty()) && (encounter == null || encounter.isEmpty())
&& (sent == null || sent.isEmpty()) && (received == null || received.isEmpty()) && (indication == null || indication.isEmpty())
&& (subject == null || subject.isEmpty());
}
@Override
public ResourceType getResourceType() {
return ResourceType.Communication;
}
@SearchParamDefinition(name="sender", path="Communication.sender", description="Message sender", type="reference" )
public static final String SP_SENDER = "sender";
@SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" )
public static final String SP_SENT = "sent";
@SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" )
public static final String SP_CATEGORY = "category";
@SearchParamDefinition(name="patient", path="Communication.subject", description="Focus of message", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="status", path="Communication.status", description="in progress | completed | suspended | rejected | failed", type="token" )
public static final String SP_STATUS = "status";
@SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference" )
public static final String SP_SUBJECT = "subject";
@SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" )
public static final String SP_RECEIVED = "received";
@SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter leading to message", type="reference" )
public static final String SP_ENCOUNTER = "encounter";
@SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" )
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="medium", path="Communication.medium", description="Communication medium", type="token" )
public static final String SP_MEDIUM = "medium";
@SearchParamDefinition(name="recipient", path="Communication.recipient", description="Message recipient", type="reference" )
public static final String SP_RECIPIENT = "recipient";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest")
public class CommunicationRequest extends DomainResource {
public enum CommunicationRequestStatus {
public enum CommunicationRequestStatus implements FhirEnum {
/**
* The request has been placed.
*/
@ -86,7 +86,10 @@ public class CommunicationRequest extends DomainResource {
* added to help the parsers
*/
NULL;
public static CommunicationRequestStatus fromCode(String codeString) throws Exception {
public static final CommunicationRequestStatusEnumFactory ENUM_FACTORY = new CommunicationRequestStatusEnumFactory();
public static CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("requested".equals(codeString))
@ -107,8 +110,9 @@ public class CommunicationRequest extends DomainResource {
return REJECTED;
if ("failed".equals(codeString))
return FAILED;
throw new Exception("Unknown CommunicationRequestStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REQUESTED: return "requested";
@ -167,8 +171,8 @@ public class CommunicationRequest extends DomainResource {
}
}
public static class CommunicationRequestStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CommunicationRequestStatusEnumFactory implements EnumFactory<CommunicationRequestStatus> {
public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -190,9 +194,9 @@ public class CommunicationRequest extends DomainResource {
return CommunicationRequestStatus.REJECTED;
if ("failed".equals(codeString))
return CommunicationRequestStatus.FAILED;
throw new Exception("Unknown CommunicationRequestStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CommunicationRequestStatus code) throws IllegalArgumentException {
if (code == CommunicationRequestStatus.REQUESTED)
return "requested";
if (code == CommunicationRequestStatus.RECEIVED)
@ -215,7 +219,7 @@ public class CommunicationRequest extends DomainResource {
}
}
public enum CommunicationRequestMode {
public enum CommunicationRequestMode implements FhirEnum {
/**
* planned.
*/
@ -232,7 +236,10 @@ public class CommunicationRequest extends DomainResource {
* added to help the parsers
*/
NULL;
public static CommunicationRequestMode fromCode(String codeString) throws Exception {
public static final CommunicationRequestModeEnumFactory ENUM_FACTORY = new CommunicationRequestModeEnumFactory();
public static CommunicationRequestMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
@ -241,8 +248,9 @@ public class CommunicationRequest extends DomainResource {
return PROPOSED;
if ("ordered".equals(codeString))
return ORDERED;
throw new Exception("Unknown CommunicationRequestMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CommunicationRequestMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PLANNED: return "planned";
@ -277,8 +285,8 @@ public class CommunicationRequest extends DomainResource {
}
}
public static class CommunicationRequestModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CommunicationRequestModeEnumFactory implements EnumFactory<CommunicationRequestMode> {
public CommunicationRequestMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -288,9 +296,9 @@ public class CommunicationRequest extends DomainResource {
return CommunicationRequestMode.PROPOSED;
if ("ordered".equals(codeString))
return CommunicationRequestMode.ORDERED;
throw new Exception("Unknown CommunicationRequestMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CommunicationRequestMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CommunicationRequestMode code) throws IllegalArgumentException {
if (code == CommunicationRequestMode.PLANNED)
return "planned";
if (code == CommunicationRequestMode.PROPOSED)
@ -800,7 +808,7 @@ public class CommunicationRequest extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<CommunicationRequestStatus>();
this.status = new Enumeration<CommunicationRequestStatus>(CommunicationRequestStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -849,7 +857,7 @@ public class CommunicationRequest extends DomainResource {
this.mode = null;
else {
if (this.mode == null)
this.mode = new Enumeration<CommunicationRequestMode>();
this.mode = new Enumeration<CommunicationRequestMode>(CommunicationRequestMode.ENUM_FACTORY);
this.mode.setValue(value);
}
return this;
@ -930,14 +938,14 @@ public class CommunicationRequest extends DomainResource {
/**
* @return The time when this communication is to occur.
*/
public DateAndTime getScheduledTime() {
public Date getScheduledTime() {
return this.scheduledTime == null ? null : this.scheduledTime.getValue();
}
/**
* @param value The time when this communication is to occur.
*/
public CommunicationRequest setScheduledTime(DateAndTime value) {
public CommunicationRequest setScheduledTime(Date value) {
if (value == null)
this.scheduledTime = null;
else {
@ -1009,14 +1017,14 @@ public class CommunicationRequest extends DomainResource {
/**
* @return The time when the request was made.
*/
public DateAndTime getOrderedOn() {
public Date getOrderedOn() {
return this.orderedOn == null ? null : this.orderedOn.getValue();
}
/**
* @param value The time when the request was made.
*/
public CommunicationRequest setOrderedOn(DateAndTime value) {
public CommunicationRequest setOrderedOn(Date value) {
if (value == null)
this.orderedOn = null;
else {
@ -1195,10 +1203,10 @@ public class CommunicationRequest extends DomainResource {
public static final String SP_TIME = "time";
@SearchParamDefinition(name="patient", path="CommunicationRequest.subject", description="Focus of message", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="ordered", path="CommunicationRequest.orderedOn", description="When ordered or proposed", type="date" )
public static final String SP_ORDERED = "ordered";
@SearchParamDefinition(name="priority", path="CommunicationRequest.priority", description="Message urgency", type="token" )
public static final String SP_PRIORITY = "priority";
@SearchParamDefinition(name="ordered", path="CommunicationRequest.orderedOn", description="When ordered or proposed", type="date" )
public static final String SP_ORDERED = "ordered";
@SearchParamDefinition(name="identifier", path="CommunicationRequest.identifier", description="Unique identifier", type="token" )
public static final String SP_IDENTIFIER = "identifier";

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition")
public class Composition extends DomainResource {
public enum CompositionStatus {
public enum CompositionStatus implements FhirEnum {
/**
* This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified.
*/
@ -70,7 +70,10 @@ public class Composition extends DomainResource {
* added to help the parsers
*/
NULL;
public static CompositionStatus fromCode(String codeString) throws Exception {
public static final CompositionStatusEnumFactory ENUM_FACTORY = new CompositionStatusEnumFactory();
public static CompositionStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("preliminary".equals(codeString))
@ -83,8 +86,9 @@ public class Composition extends DomainResource {
return AMENDED;
if ("entered in error".equals(codeString))
return ENTEREDINERROR;
throw new Exception("Unknown CompositionStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PRELIMINARY: return "preliminary";
@ -127,8 +131,8 @@ public class Composition extends DomainResource {
}
}
public static class CompositionStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CompositionStatusEnumFactory implements EnumFactory<CompositionStatus> {
public CompositionStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -142,9 +146,9 @@ public class Composition extends DomainResource {
return CompositionStatus.AMENDED;
if ("entered in error".equals(codeString))
return CompositionStatus.ENTEREDINERROR;
throw new Exception("Unknown CompositionStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CompositionStatus code) throws IllegalArgumentException {
if (code == CompositionStatus.PRELIMINARY)
return "preliminary";
if (code == CompositionStatus.FINAL)
@ -159,7 +163,7 @@ public class Composition extends DomainResource {
}
}
public enum CompositionAttestationMode {
public enum CompositionAttestationMode implements FhirEnum {
/**
* The person authenticated the content in their personal capacity.
*/
@ -180,7 +184,10 @@ public class Composition extends DomainResource {
* added to help the parsers
*/
NULL;
public static CompositionAttestationMode fromCode(String codeString) throws Exception {
public static final CompositionAttestationModeEnumFactory ENUM_FACTORY = new CompositionAttestationModeEnumFactory();
public static CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("personal".equals(codeString))
@ -191,8 +198,9 @@ public class Composition extends DomainResource {
return LEGAL;
if ("official".equals(codeString))
return OFFICIAL;
throw new Exception("Unknown CompositionAttestationMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PERSONAL: return "personal";
@ -231,8 +239,8 @@ public class Composition extends DomainResource {
}
}
public static class CompositionAttestationModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class CompositionAttestationModeEnumFactory implements EnumFactory<CompositionAttestationMode> {
public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -244,9 +252,9 @@ public class Composition extends DomainResource {
return CompositionAttestationMode.LEGAL;
if ("official".equals(codeString))
return CompositionAttestationMode.OFFICIAL;
throw new Exception("Unknown CompositionAttestationMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(CompositionAttestationMode code) throws IllegalArgumentException {
if (code == CompositionAttestationMode.PERSONAL)
return "personal";
if (code == CompositionAttestationMode.PROFESSIONAL)
@ -378,14 +386,14 @@ public class Composition extends DomainResource {
/**
* @return When composition was attested by the party.
*/
public DateAndTime getTime() {
public Date getTime() {
return this.time == null ? null : this.time.getValue();
}
/**
* @param value When composition was attested by the party.
*/
public CompositionAttesterComponent setTime(DateAndTime value) {
public CompositionAttesterComponent setTime(Date value) {
if (value == null)
this.time = null;
else {
@ -1020,14 +1028,14 @@ public class Composition extends DomainResource {
/**
* @return The composition editing time, when the composition was last logically changed by the author.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The composition editing time, when the composition was last logically changed by the author.
*/
public Composition setDate(DateAndTime value) {
public Composition setDate(Date value) {
if (this.date == null)
this.date = new DateTimeType();
this.date.setValue(value);
@ -1171,7 +1179,7 @@ public class Composition extends DomainResource {
*/
public Composition setStatus(CompositionStatus value) {
if (this.status == null)
this.status = new Enumeration<CompositionStatus>();
this.status = new Enumeration<CompositionStatus>(CompositionStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -1536,12 +1544,12 @@ public class Composition extends DomainResource {
public static final String SP_SUBJECT = "subject";
@SearchParamDefinition(name="class", path="Composition.class", description="Categorization of Composition", type="token" )
public static final String SP_CLASS = "class";
@SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" )
public static final String SP_PERIOD = "period";
@SearchParamDefinition(name="type", path="Composition.type", description="Kind of composition (LOINC if possible)", type="token" )
public static final String SP_TYPE = "type";
@SearchParamDefinition(name="date", path="Composition.date", description="Composition editing time", type="date" )
public static final String SP_DATE = "date";
@SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" )
public static final String SP_PERIOD = "period";
@SearchParamDefinition(name="section", path="Composition.section.content", description="The Content of the section", type="reference" )
public static final String SP_SECTION = "section";
@SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference" )

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap")
public class ConceptMap extends DomainResource {
public enum ValuesetStatus {
public enum ValuesetStatus implements FhirEnum {
/**
* This valueset is still under development.
*/
@ -62,7 +62,10 @@ public class ConceptMap extends DomainResource {
* added to help the parsers
*/
NULL;
public static ValuesetStatus fromCode(String codeString) throws Exception {
public static final ValuesetStatusEnumFactory ENUM_FACTORY = new ValuesetStatusEnumFactory();
public static ValuesetStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("draft".equals(codeString))
@ -71,8 +74,9 @@ public class ConceptMap extends DomainResource {
return ACTIVE;
if ("retired".equals(codeString))
return RETIRED;
throw new Exception("Unknown ValuesetStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case DRAFT: return "draft";
@ -107,8 +111,8 @@ public class ConceptMap extends DomainResource {
}
}
public static class ValuesetStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ValuesetStatusEnumFactory implements EnumFactory<ValuesetStatus> {
public ValuesetStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class ConceptMap extends DomainResource {
return ValuesetStatus.ACTIVE;
if ("retired".equals(codeString))
return ValuesetStatus.RETIRED;
throw new Exception("Unknown ValuesetStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ValuesetStatus code) throws IllegalArgumentException {
if (code == ValuesetStatus.DRAFT)
return "draft";
if (code == ValuesetStatus.ACTIVE)
@ -131,15 +135,15 @@ public class ConceptMap extends DomainResource {
}
}
public enum ConceptEquivalence {
/**
* The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical).
*/
EQUAL,
public enum ConceptEquivalence implements FhirEnum {
/**
* The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical).
*/
EQUIVALENT,
/**
* The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical).
*/
EQUAL,
/**
* The target mapping is wider in meaning than the source concept.
*/
@ -157,7 +161,7 @@ public class ConceptMap extends DomainResource {
*/
SPECIALISES,
/**
* The target mapping overlaps with the source concept, but both source and target cover additional meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally.
* The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally.
*/
INEXACT,
/**
@ -172,13 +176,16 @@ public class ConceptMap extends DomainResource {
* added to help the parsers
*/
NULL;
public static ConceptEquivalence fromCode(String codeString) throws Exception {
public static final ConceptEquivalenceEnumFactory ENUM_FACTORY = new ConceptEquivalenceEnumFactory();
public static ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("equal".equals(codeString))
return EQUAL;
if ("equivalent".equals(codeString))
return EQUIVALENT;
if ("equal".equals(codeString))
return EQUAL;
if ("wider".equals(codeString))
return WIDER;
if ("subsumes".equals(codeString))
@ -193,12 +200,13 @@ public class ConceptMap extends DomainResource {
return UNMATCHED;
if ("disjoint".equals(codeString))
return DISJOINT;
throw new Exception("Unknown ConceptEquivalence code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case EQUAL: return "equal";
case EQUIVALENT: return "equivalent";
case EQUAL: return "equal";
case WIDER: return "wider";
case SUBSUMES: return "subsumes";
case NARROWER: return "narrower";
@ -211,8 +219,8 @@ public class ConceptMap extends DomainResource {
}
public String getSystem() {
switch (this) {
case EQUAL: return "";
case EQUIVALENT: return "";
case EQUAL: return "";
case WIDER: return "";
case SUBSUMES: return "";
case NARROWER: return "";
@ -225,13 +233,13 @@ public class ConceptMap extends DomainResource {
}
public String getDefinition() {
switch (this) {
case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical).";
case EQUIVALENT: return "The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical).";
case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical).";
case WIDER: return "The target mapping is wider in meaning than the source concept.";
case SUBSUMES: return "The target mapping subsumes the meaning of the source concept (e.g. the source is-a target).";
case NARROWER: return "The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally.";
case SPECIALISES: return "The target mapping specialises the meaning of the source concept (e.g. the target is-a source).";
case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally.";
case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally.";
case UNMATCHED: return "There is no match for this concept in the destination concept system.";
case DISJOINT: return "This is an explicit assertion that there is no mapping between the source and target concept.";
default: return "?";
@ -239,8 +247,8 @@ public class ConceptMap extends DomainResource {
}
public String getDisplay() {
switch (this) {
case EQUAL: return "equal";
case EQUIVALENT: return "equivalent";
case EQUAL: return "equal";
case WIDER: return "wider";
case SUBSUMES: return "subsumes";
case NARROWER: return "narrower";
@ -253,15 +261,15 @@ public class ConceptMap extends DomainResource {
}
}
public static class ConceptEquivalenceEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ConceptEquivalenceEnumFactory implements EnumFactory<ConceptEquivalence> {
public ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("equal".equals(codeString))
return ConceptEquivalence.EQUAL;
if ("equivalent".equals(codeString))
return ConceptEquivalence.EQUIVALENT;
if ("equal".equals(codeString))
return ConceptEquivalence.EQUAL;
if ("wider".equals(codeString))
return ConceptEquivalence.WIDER;
if ("subsumes".equals(codeString))
@ -276,13 +284,13 @@ public class ConceptMap extends DomainResource {
return ConceptEquivalence.UNMATCHED;
if ("disjoint".equals(codeString))
return ConceptEquivalence.DISJOINT;
throw new Exception("Unknown ConceptEquivalence code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
if (code == ConceptEquivalence.EQUAL)
return "equal";
public String toCode(ConceptEquivalence code) throws IllegalArgumentException {
if (code == ConceptEquivalence.EQUIVALENT)
return "equivalent";
if (code == ConceptEquivalence.EQUAL)
return "equal";
if (code == ConceptEquivalence.WIDER)
return "wider";
if (code == ConceptEquivalence.SUBSUMES)
@ -742,7 +750,7 @@ public class ConceptMap extends DomainResource {
* The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target.
*/
@Child(name="equivalence", type={CodeType.class}, order=3, min=1, max=1)
@Description(shortDefinition="equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target." )
@Description(shortDefinition="equivalent | equal | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target." )
protected Enumeration<ConceptEquivalence> equivalence;
/**
@ -908,7 +916,7 @@ public class ConceptMap extends DomainResource {
*/
public ConceptMapElementMapComponent setEquivalence(ConceptEquivalence value) {
if (this.equivalence == null)
this.equivalence = new Enumeration<ConceptEquivalence>();
this.equivalence = new Enumeration<ConceptEquivalence>(ConceptEquivalence.ENUM_FACTORY);
this.equivalence.setValue(value);
return this;
}
@ -1492,7 +1500,7 @@ public class ConceptMap extends DomainResource {
*/
public ConceptMap setStatus(ValuesetStatus value) {
if (this.status == null)
this.status = new Enumeration<ValuesetStatus>();
this.status = new Enumeration<ValuesetStatus>(ValuesetStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -1577,14 +1585,14 @@ public class ConceptMap extends DomainResource {
/**
* @return The date that the concept map status was last changed.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date that the concept map status was last changed.
*/
public ConceptMap setDate(DateAndTime value) {
public ConceptMap setDate(Date value) {
if (value == null)
this.date = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition")
public class Condition extends DomainResource {
public enum ConditionStatus {
public enum ConditionStatus implements FhirEnum {
/**
* This is a tentative diagnosis - still a candidate that is under consideration.
*/
@ -66,7 +66,10 @@ public class Condition extends DomainResource {
* added to help the parsers
*/
NULL;
public static ConditionStatus fromCode(String codeString) throws Exception {
public static final ConditionStatusEnumFactory ENUM_FACTORY = new ConditionStatusEnumFactory();
public static ConditionStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("provisional".equals(codeString))
@ -77,8 +80,9 @@ public class Condition extends DomainResource {
return CONFIRMED;
if ("refuted".equals(codeString))
return REFUTED;
throw new Exception("Unknown ConditionStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PROVISIONAL: return "provisional";
@ -117,8 +121,8 @@ public class Condition extends DomainResource {
}
}
public static class ConditionStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ConditionStatusEnumFactory implements EnumFactory<ConditionStatus> {
public ConditionStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -130,9 +134,9 @@ public class Condition extends DomainResource {
return ConditionStatus.CONFIRMED;
if ("refuted".equals(codeString))
return ConditionStatus.REFUTED;
throw new Exception("Unknown ConditionStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ConditionStatus code) throws IllegalArgumentException {
if (code == ConditionStatus.PROVISIONAL)
return "provisional";
if (code == ConditionStatus.WORKING)
@ -1055,14 +1059,14 @@ public class Condition extends DomainResource {
/**
* @return Estimated or actual date the condition/problem/diagnosis was first detected/suspected.
*/
public DateAndTime getDateAsserted() {
public Date getDateAsserted() {
return this.dateAsserted == null ? null : this.dateAsserted.getValue();
}
/**
* @param value Estimated or actual date the condition/problem/diagnosis was first detected/suspected.
*/
public Condition setDateAsserted(DateAndTime value) {
public Condition setDateAsserted(Date value) {
if (value == null)
this.dateAsserted = null;
else {
@ -1161,7 +1165,7 @@ public class Condition extends DomainResource {
*/
public Condition setStatus(ConditionStatus value) {
if (this.status == null)
this.status = new Enumeration<ConditionStatus>();
this.status = new Enumeration<ConditionStatus>(ConditionStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}

View File

@ -90,9 +90,9 @@ POSSIBILITY OF SUCH DAMAGE.
public class Configuration {
private static int status = 0;
// 0: auto-create
// 1: error
// 2: return null
// 0: auto-create
// 1: error
// 2: return null
public static boolean errorOnAutoCreate() {
return status == 1;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance")
public class Conformance extends DomainResource {
public enum ConformanceStatementStatus {
public enum ConformanceStatementStatus implements FhirEnum {
/**
* This conformance statement is still under development.
*/
@ -62,7 +62,10 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static ConformanceStatementStatus fromCode(String codeString) throws Exception {
public static final ConformanceStatementStatusEnumFactory ENUM_FACTORY = new ConformanceStatementStatusEnumFactory();
public static ConformanceStatementStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("draft".equals(codeString))
@ -71,8 +74,9 @@ public class Conformance extends DomainResource {
return ACTIVE;
if ("retired".equals(codeString))
return RETIRED;
throw new Exception("Unknown ConformanceStatementStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case DRAFT: return "draft";
@ -107,8 +111,8 @@ public class Conformance extends DomainResource {
}
}
public static class ConformanceStatementStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ConformanceStatementStatusEnumFactory implements EnumFactory<ConformanceStatementStatus> {
public ConformanceStatementStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class Conformance extends DomainResource {
return ConformanceStatementStatus.ACTIVE;
if ("retired".equals(codeString))
return ConformanceStatementStatus.RETIRED;
throw new Exception("Unknown ConformanceStatementStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ConformanceStatementStatus code) throws IllegalArgumentException {
if (code == ConformanceStatementStatus.DRAFT)
return "draft";
if (code == ConformanceStatementStatus.ACTIVE)
@ -131,7 +135,7 @@ public class Conformance extends DomainResource {
}
}
public enum RestfulConformanceMode {
public enum RestfulConformanceMode implements FhirEnum {
/**
* The application acts as a server for this resource.
*/
@ -144,15 +148,19 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static RestfulConformanceMode fromCode(String codeString) throws Exception {
public static final RestfulConformanceModeEnumFactory ENUM_FACTORY = new RestfulConformanceModeEnumFactory();
public static RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("client".equals(codeString))
return CLIENT;
if ("server".equals(codeString))
return SERVER;
throw new Exception("Unknown RestfulConformanceMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CLIENT: return "client";
@ -183,8 +191,8 @@ public class Conformance extends DomainResource {
}
}
public static class RestfulConformanceModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class RestfulConformanceModeEnumFactory implements EnumFactory<RestfulConformanceMode> {
public RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -192,9 +200,9 @@ public class Conformance extends DomainResource {
return RestfulConformanceMode.CLIENT;
if ("server".equals(codeString))
return RestfulConformanceMode.SERVER;
throw new Exception("Unknown RestfulConformanceMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(RestfulConformanceMode code) throws IllegalArgumentException {
if (code == RestfulConformanceMode.CLIENT)
return "client";
if (code == RestfulConformanceMode.SERVER)
@ -203,7 +211,7 @@ public class Conformance extends DomainResource {
}
}
public enum TypeRestfulInteraction {
public enum TypeRestfulInteraction implements FhirEnum {
/**
*
*/
@ -244,7 +252,10 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static TypeRestfulInteraction fromCode(String codeString) throws Exception {
public static final TypeRestfulInteractionEnumFactory ENUM_FACTORY = new TypeRestfulInteractionEnumFactory();
public static TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("read".equals(codeString))
@ -265,8 +276,9 @@ public class Conformance extends DomainResource {
return CREATE;
if ("search-type".equals(codeString))
return SEARCHTYPE;
throw new Exception("Unknown TypeRestfulInteraction code '"+codeString+"'");
throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case READ: return "read";
@ -325,8 +337,8 @@ public class Conformance extends DomainResource {
}
}
public static class TypeRestfulInteractionEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class TypeRestfulInteractionEnumFactory implements EnumFactory<TypeRestfulInteraction> {
public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -348,9 +360,9 @@ public class Conformance extends DomainResource {
return TypeRestfulInteraction.CREATE;
if ("search-type".equals(codeString))
return TypeRestfulInteraction.SEARCHTYPE;
throw new Exception("Unknown TypeRestfulInteraction code '"+codeString+"'");
throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(TypeRestfulInteraction code) throws IllegalArgumentException {
if (code == TypeRestfulInteraction.READ)
return "read";
if (code == TypeRestfulInteraction.VREAD)
@ -373,7 +385,7 @@ public class Conformance extends DomainResource {
}
}
public enum VersioningPolicy {
public enum VersioningPolicy implements FhirEnum {
/**
* VersionId meta-property is not suppoerted (server) or used (client).
*/
@ -390,7 +402,10 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static VersioningPolicy fromCode(String codeString) throws Exception {
public static final VersioningPolicyEnumFactory ENUM_FACTORY = new VersioningPolicyEnumFactory();
public static VersioningPolicy fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("no-version".equals(codeString))
@ -399,8 +414,9 @@ public class Conformance extends DomainResource {
return VERSIONED;
if ("versioned-update".equals(codeString))
return VERSIONEDUPDATE;
throw new Exception("Unknown VersioningPolicy code '"+codeString+"'");
throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case NOVERSION: return "no-version";
@ -435,8 +451,8 @@ public class Conformance extends DomainResource {
}
}
public static class VersioningPolicyEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class VersioningPolicyEnumFactory implements EnumFactory<VersioningPolicy> {
public VersioningPolicy fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -446,9 +462,9 @@ public class Conformance extends DomainResource {
return VersioningPolicy.VERSIONED;
if ("versioned-update".equals(codeString))
return VersioningPolicy.VERSIONEDUPDATE;
throw new Exception("Unknown VersioningPolicy code '"+codeString+"'");
throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(VersioningPolicy code) throws IllegalArgumentException {
if (code == VersioningPolicy.NOVERSION)
return "no-version";
if (code == VersioningPolicy.VERSIONED)
@ -459,7 +475,7 @@ public class Conformance extends DomainResource {
}
}
public enum SearchParamType {
public enum SearchParamType implements FhirEnum {
/**
* Search parameter SHALL be a number (a whole number, or a decimal).
*/
@ -492,7 +508,10 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static SearchParamType fromCode(String codeString) throws Exception {
public static final SearchParamTypeEnumFactory ENUM_FACTORY = new SearchParamTypeEnumFactory();
public static SearchParamType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("number".equals(codeString))
@ -509,8 +528,9 @@ public class Conformance extends DomainResource {
return COMPOSITE;
if ("quantity".equals(codeString))
return QUANTITY;
throw new Exception("Unknown SearchParamType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case NUMBER: return "number";
@ -561,8 +581,8 @@ public class Conformance extends DomainResource {
}
}
public static class SearchParamTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class SearchParamTypeEnumFactory implements EnumFactory<SearchParamType> {
public SearchParamType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -580,9 +600,9 @@ public class Conformance extends DomainResource {
return SearchParamType.COMPOSITE;
if ("quantity".equals(codeString))
return SearchParamType.QUANTITY;
throw new Exception("Unknown SearchParamType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(SearchParamType code) throws IllegalArgumentException {
if (code == SearchParamType.NUMBER)
return "number";
if (code == SearchParamType.DATE)
@ -601,7 +621,7 @@ public class Conformance extends DomainResource {
}
}
public enum SystemRestfulInteraction {
public enum SystemRestfulInteraction implements FhirEnum {
/**
*
*/
@ -618,7 +638,10 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static SystemRestfulInteraction fromCode(String codeString) throws Exception {
public static final SystemRestfulInteractionEnumFactory ENUM_FACTORY = new SystemRestfulInteractionEnumFactory();
public static SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("transaction".equals(codeString))
@ -627,8 +650,9 @@ public class Conformance extends DomainResource {
return SEARCHSYSTEM;
if ("history-system".equals(codeString))
return HISTORYSYSTEM;
throw new Exception("Unknown SystemRestfulInteraction code '"+codeString+"'");
throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case TRANSACTION: return "transaction";
@ -663,8 +687,8 @@ public class Conformance extends DomainResource {
}
}
public static class SystemRestfulInteractionEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class SystemRestfulInteractionEnumFactory implements EnumFactory<SystemRestfulInteraction> {
public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -674,9 +698,9 @@ public class Conformance extends DomainResource {
return SystemRestfulInteraction.SEARCHSYSTEM;
if ("history-system".equals(codeString))
return SystemRestfulInteraction.HISTORYSYSTEM;
throw new Exception("Unknown SystemRestfulInteraction code '"+codeString+"'");
throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(SystemRestfulInteraction code) throws IllegalArgumentException {
if (code == SystemRestfulInteraction.TRANSACTION)
return "transaction";
if (code == SystemRestfulInteraction.SEARCHSYSTEM)
@ -687,7 +711,7 @@ public class Conformance extends DomainResource {
}
}
public enum MessageSignificanceCategory {
public enum MessageSignificanceCategory implements FhirEnum {
/**
* The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment.
*/
@ -704,7 +728,10 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static MessageSignificanceCategory fromCode(String codeString) throws Exception {
public static final MessageSignificanceCategoryEnumFactory ENUM_FACTORY = new MessageSignificanceCategoryEnumFactory();
public static MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("Consequence".equals(codeString))
@ -713,8 +740,9 @@ public class Conformance extends DomainResource {
return CURRENCY;
if ("Notification".equals(codeString))
return NOTIFICATION;
throw new Exception("Unknown MessageSignificanceCategory code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CONSEQUENCE: return "Consequence";
@ -749,8 +777,8 @@ public class Conformance extends DomainResource {
}
}
public static class MessageSignificanceCategoryEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MessageSignificanceCategoryEnumFactory implements EnumFactory<MessageSignificanceCategory> {
public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -760,9 +788,9 @@ public class Conformance extends DomainResource {
return MessageSignificanceCategory.CURRENCY;
if ("Notification".equals(codeString))
return MessageSignificanceCategory.NOTIFICATION;
throw new Exception("Unknown MessageSignificanceCategory code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MessageSignificanceCategory code) throws IllegalArgumentException {
if (code == MessageSignificanceCategory.CONSEQUENCE)
return "Consequence";
if (code == MessageSignificanceCategory.CURRENCY)
@ -773,7 +801,7 @@ public class Conformance extends DomainResource {
}
}
public enum MessageConformanceEventMode {
public enum MessageConformanceEventMode implements FhirEnum {
/**
* The application sends requests and receives responses.
*/
@ -786,15 +814,19 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static MessageConformanceEventMode fromCode(String codeString) throws Exception {
public static final MessageConformanceEventModeEnumFactory ENUM_FACTORY = new MessageConformanceEventModeEnumFactory();
public static MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("sender".equals(codeString))
return SENDER;
if ("receiver".equals(codeString))
return RECEIVER;
throw new Exception("Unknown MessageConformanceEventMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case SENDER: return "sender";
@ -825,8 +857,8 @@ public class Conformance extends DomainResource {
}
}
public static class MessageConformanceEventModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MessageConformanceEventModeEnumFactory implements EnumFactory<MessageConformanceEventMode> {
public MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -834,9 +866,9 @@ public class Conformance extends DomainResource {
return MessageConformanceEventMode.SENDER;
if ("receiver".equals(codeString))
return MessageConformanceEventMode.RECEIVER;
throw new Exception("Unknown MessageConformanceEventMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MessageConformanceEventMode code) throws IllegalArgumentException {
if (code == MessageConformanceEventMode.SENDER)
return "sender";
if (code == MessageConformanceEventMode.RECEIVER)
@ -845,7 +877,7 @@ public class Conformance extends DomainResource {
}
}
public enum DocumentMode {
public enum DocumentMode implements FhirEnum {
/**
* The application produces documents of the specified type.
*/
@ -858,15 +890,19 @@ public class Conformance extends DomainResource {
* added to help the parsers
*/
NULL;
public static DocumentMode fromCode(String codeString) throws Exception {
public static final DocumentModeEnumFactory ENUM_FACTORY = new DocumentModeEnumFactory();
public static DocumentMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("producer".equals(codeString))
return PRODUCER;
if ("consumer".equals(codeString))
return CONSUMER;
throw new Exception("Unknown DocumentMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PRODUCER: return "producer";
@ -897,8 +933,8 @@ public class Conformance extends DomainResource {
}
}
public static class DocumentModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DocumentModeEnumFactory implements EnumFactory<DocumentMode> {
public DocumentMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -906,9 +942,9 @@ public class Conformance extends DomainResource {
return DocumentMode.PRODUCER;
if ("consumer".equals(codeString))
return DocumentMode.CONSUMER;
throw new Exception("Unknown DocumentMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DocumentMode code) throws IllegalArgumentException {
if (code == DocumentMode.PRODUCER)
return "producer";
if (code == DocumentMode.CONSUMER)
@ -1076,14 +1112,14 @@ public class Conformance extends DomainResource {
/**
* @return Date this version of the software released.
*/
public DateAndTime getReleaseDate() {
public Date getReleaseDate() {
return this.releaseDate == null ? null : this.releaseDate.getValue();
}
/**
* @param value Date this version of the software released.
*/
public ConformanceSoftwareComponent setReleaseDate(DateAndTime value) {
public ConformanceSoftwareComponent setReleaseDate(Date value) {
if (value == null)
this.releaseDate = null;
else {
@ -1361,7 +1397,7 @@ public class Conformance extends DomainResource {
*/
public ConformanceRestComponent setMode(RestfulConformanceMode value) {
if (this.mode == null)
this.mode = new Enumeration<RestfulConformanceMode>();
this.mode = new Enumeration<RestfulConformanceMode>(RestfulConformanceMode.ENUM_FACTORY);
this.mode.setValue(value);
return this;
}
@ -2237,7 +2273,7 @@ public class Conformance extends DomainResource {
this.versioning = null;
else {
if (this.versioning == null)
this.versioning = new Enumeration<VersioningPolicy>();
this.versioning = new Enumeration<VersioningPolicy>(VersioningPolicy.ENUM_FACTORY);
this.versioning.setValue(value);
}
return this;
@ -2540,7 +2576,7 @@ public class Conformance extends DomainResource {
*/
public ResourceInteractionComponent setCode(TypeRestfulInteraction value) {
if (this.code == null)
this.code = new Enumeration<TypeRestfulInteraction>();
this.code = new Enumeration<TypeRestfulInteraction>(TypeRestfulInteraction.ENUM_FACTORY);
this.code.setValue(value);
return this;
}
@ -2805,7 +2841,7 @@ public class Conformance extends DomainResource {
*/
public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) {
if (this.type == null)
this.type = new Enumeration<SearchParamType>();
this.type = new Enumeration<SearchParamType>(SearchParamType.ENUM_FACTORY);
this.type.setValue(value);
return this;
}
@ -3072,7 +3108,7 @@ public class Conformance extends DomainResource {
*/
public SystemInteractionComponent setCode(SystemRestfulInteraction value) {
if (this.code == null)
this.code = new Enumeration<SystemRestfulInteraction>();
this.code = new Enumeration<SystemRestfulInteraction>(SystemRestfulInteraction.ENUM_FACTORY);
this.code.setValue(value);
return this;
}
@ -3683,7 +3719,7 @@ public class Conformance extends DomainResource {
this.category = null;
else {
if (this.category == null)
this.category = new Enumeration<MessageSignificanceCategory>();
this.category = new Enumeration<MessageSignificanceCategory>(MessageSignificanceCategory.ENUM_FACTORY);
this.category.setValue(value);
}
return this;
@ -3729,7 +3765,7 @@ public class Conformance extends DomainResource {
*/
public ConformanceMessagingEventComponent setMode(MessageConformanceEventMode value) {
if (this.mode == null)
this.mode = new Enumeration<MessageConformanceEventMode>();
this.mode = new Enumeration<MessageConformanceEventMode>(MessageConformanceEventMode.ENUM_FACTORY);
this.mode.setValue(value);
return this;
}
@ -4065,7 +4101,7 @@ public class Conformance extends DomainResource {
*/
public ConformanceDocumentComponent setMode(DocumentMode value) {
if (this.mode == null)
this.mode = new Enumeration<DocumentMode>();
this.mode = new Enumeration<DocumentMode>(DocumentMode.ENUM_FACTORY);
this.mode.setValue(value);
return this;
}
@ -4645,7 +4681,7 @@ public class Conformance extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<ConformanceStatementStatus>();
this.status = new Enumeration<ConformanceStatementStatus>(ConformanceStatementStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -4731,14 +4767,14 @@ public class Conformance extends DomainResource {
/**
* @return The date (and optionally time) when the conformance statement was published.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date (and optionally time) when the conformance statement was published.
*/
public Conformance setDate(DateAndTime value) {
public Conformance setDate(Date value) {
if (this.date == null)
this.date = new DateTimeType();
this.date.setValue(value);

View File

@ -29,12 +29,12 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
public class Constants {
public final static String VERSION = "0.3.0";
public final static String REVISION = "3637";
public final static String DATE = "Tue Dec 02 21:09:20 EST 2014";
public final static String REVISION = "3775";
public final static String DATE = "Sun Dec 07 21:45:56 EST 2014";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
@DatatypeDef(name="ContactPoint")
public class ContactPoint extends Type {
public enum ContactPointSystem {
public enum ContactPointSystem implements FhirEnum {
/**
* The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required.
*/
@ -64,7 +64,10 @@ public class ContactPoint extends Type {
* added to help the parsers
*/
NULL;
public static ContactPointSystem fromCode(String codeString) throws Exception {
public static final ContactPointSystemEnumFactory ENUM_FACTORY = new ContactPointSystemEnumFactory();
public static ContactPointSystem fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("phone".equals(codeString))
@ -75,8 +78,9 @@ public class ContactPoint extends Type {
return EMAIL;
if ("url".equals(codeString))
return URL;
throw new Exception("Unknown ContactPointSystem code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PHONE: return "phone";
@ -115,8 +119,8 @@ public class ContactPoint extends Type {
}
}
public static class ContactPointSystemEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ContactPointSystemEnumFactory implements EnumFactory<ContactPointSystem> {
public ContactPointSystem fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -128,9 +132,9 @@ public class ContactPoint extends Type {
return ContactPointSystem.EMAIL;
if ("url".equals(codeString))
return ContactPointSystem.URL;
throw new Exception("Unknown ContactPointSystem code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ContactPointSystem code) throws IllegalArgumentException {
if (code == ContactPointSystem.PHONE)
return "phone";
if (code == ContactPointSystem.FAX)
@ -143,7 +147,7 @@ public class ContactPoint extends Type {
}
}
public enum ContactPointUse {
public enum ContactPointUse implements FhirEnum {
/**
* A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available.
*/
@ -168,7 +172,10 @@ public class ContactPoint extends Type {
* added to help the parsers
*/
NULL;
public static ContactPointUse fromCode(String codeString) throws Exception {
public static final ContactPointUseEnumFactory ENUM_FACTORY = new ContactPointUseEnumFactory();
public static ContactPointUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("home".equals(codeString))
@ -181,8 +188,9 @@ public class ContactPoint extends Type {
return OLD;
if ("mobile".equals(codeString))
return MOBILE;
throw new Exception("Unknown ContactPointUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case HOME: return "home";
@ -225,8 +233,8 @@ public class ContactPoint extends Type {
}
}
public static class ContactPointUseEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ContactPointUseEnumFactory implements EnumFactory<ContactPointUse> {
public ContactPointUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -240,9 +248,9 @@ public class ContactPoint extends Type {
return ContactPointUse.OLD;
if ("mobile".equals(codeString))
return ContactPointUse.MOBILE;
throw new Exception("Unknown ContactPointUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ContactPointUse code) throws IllegalArgumentException {
if (code == ContactPointUse.HOME)
return "home";
if (code == ContactPointUse.WORK)
@ -334,7 +342,7 @@ public class ContactPoint extends Type {
this.system = null;
else {
if (this.system == null)
this.system = new Enumeration<ContactPointSystem>();
this.system = new Enumeration<ContactPointSystem>(ContactPointSystem.ENUM_FACTORY);
this.system.setValue(value);
}
return this;
@ -432,7 +440,7 @@ public class ContactPoint extends Type {
this.use = null;
else {
if (this.use == null)
this.use = new Enumeration<ContactPointUse>();
this.use = new Enumeration<ContactPointUse>(ContactPointUse.ENUM_FACTORY);
this.use.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -139,14 +139,14 @@ public class Contraindication extends DomainResource {
/**
* @return Indicates when the mitigating action was documented.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value Indicates when the mitigating action was documented.
*/
public ContraindicationMitigationComponent setDate(DateAndTime value) {
public ContraindicationMitigationComponent setDate(Date value) {
if (value == null)
this.date = null;
else {
@ -551,14 +551,14 @@ public class Contraindication extends DomainResource {
/**
* @return The date or date-time when the contraindication was initially identified.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date or date-time when the contraindication was initially identified.
*/
public Contraindication setDate(DateAndTime value) {
public Contraindication setDate(Date value) {
if (value == null)
this.date = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement")
public class DataElement extends DomainResource {
public enum ResourceObservationDefStatus {
public enum ResourceObservationDefStatus implements FhirEnum {
/**
* This data element is still under development.
*/
@ -62,7 +62,10 @@ public class DataElement extends DomainResource {
* added to help the parsers
*/
NULL;
public static ResourceObservationDefStatus fromCode(String codeString) throws Exception {
public static final ResourceObservationDefStatusEnumFactory ENUM_FACTORY = new ResourceObservationDefStatusEnumFactory();
public static ResourceObservationDefStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("draft".equals(codeString))
@ -71,8 +74,9 @@ public class DataElement extends DomainResource {
return ACTIVE;
if ("retired".equals(codeString))
return RETIRED;
throw new Exception("Unknown ResourceObservationDefStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case DRAFT: return "draft";
@ -107,8 +111,8 @@ public class DataElement extends DomainResource {
}
}
public static class ResourceObservationDefStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ResourceObservationDefStatusEnumFactory implements EnumFactory<ResourceObservationDefStatus> {
public ResourceObservationDefStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class DataElement extends DomainResource {
return ResourceObservationDefStatus.ACTIVE;
if ("retired".equals(codeString))
return ResourceObservationDefStatus.RETIRED;
throw new Exception("Unknown ResourceObservationDefStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ResourceObservationDefStatus code) throws IllegalArgumentException {
if (code == ResourceObservationDefStatus.DRAFT)
return "draft";
if (code == ResourceObservationDefStatus.ACTIVE)
@ -131,7 +135,7 @@ public class DataElement extends DomainResource {
}
}
public enum BindingConformance {
public enum BindingConformance implements FhirEnum {
/**
* Only codes in the specified set are allowed. If the binding is extensible, other codes may be used for concepts not covered by the bound set of codes.
*/
@ -148,7 +152,10 @@ public class DataElement extends DomainResource {
* added to help the parsers
*/
NULL;
public static BindingConformance fromCode(String codeString) throws Exception {
public static final BindingConformanceEnumFactory ENUM_FACTORY = new BindingConformanceEnumFactory();
public static BindingConformance fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("required".equals(codeString))
@ -157,8 +164,9 @@ public class DataElement extends DomainResource {
return PREFERRED;
if ("example".equals(codeString))
return EXAMPLE;
throw new Exception("Unknown BindingConformance code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REQUIRED: return "required";
@ -193,8 +201,8 @@ public class DataElement extends DomainResource {
}
}
public static class BindingConformanceEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class BindingConformanceEnumFactory implements EnumFactory<BindingConformance> {
public BindingConformance fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -204,9 +212,9 @@ public class DataElement extends DomainResource {
return BindingConformance.PREFERRED;
if ("example".equals(codeString))
return BindingConformance.EXAMPLE;
throw new Exception("Unknown BindingConformance code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(BindingConformance code) throws IllegalArgumentException {
if (code == BindingConformance.REQUIRED)
return "required";
if (code == BindingConformance.PREFERRED)
@ -351,7 +359,7 @@ public class DataElement extends DomainResource {
this.conformance = null;
else {
if (this.conformance == null)
this.conformance = new Enumeration<BindingConformance>();
this.conformance = new Enumeration<BindingConformance>(BindingConformance.ENUM_FACTORY);
this.conformance.setValue(value);
}
return this;
@ -485,28 +493,35 @@ public class DataElement extends DomainResource {
@Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="A URI that identifies the specification that this mapping is expressed to." )
protected UriType uri;
/**
* If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.
*/
@Child(name="definitional", type={BooleanType.class}, order=2, min=0, max=1)
@Description(shortDefinition="True if mapping defines element", formalDefinition="If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element." )
protected BooleanType definitional;
/**
* A name for the specification that is being mapped to.
*/
@Child(name="name", type={StringType.class}, order=2, min=0, max=1)
@Child(name="name", type={StringType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." )
protected StringType name;
/**
* Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.
*/
@Child(name="comments", type={StringType.class}, order=3, min=0, max=1)
@Child(name="comments", type={StringType.class}, order=4, min=0, max=1)
@Description(shortDefinition="Versions, Issues, Scope limitations etc", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." )
protected StringType comments;
/**
* Expresses what part of the target specification corresponds to this element.
*/
@Child(name="map", type={StringType.class}, order=4, min=1, max=1)
@Child(name="map", type={StringType.class}, order=5, min=1, max=1)
@Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." )
protected StringType map;
private static final long serialVersionUID = -229299076L;
private static final long serialVersionUID = 797049346L;
public DataElementMappingComponent() {
super();
@ -566,6 +581,55 @@ public class DataElement extends DomainResource {
return this;
}
/**
* @return {@link #definitional} (If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.). This is the underlying object with id, value and extensions. The accessor "getDefinitional" gives direct access to the value
*/
public BooleanType getDefinitionalElement() {
if (this.definitional == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create DataElementMappingComponent.definitional");
else if (Configuration.doAutoCreate())
this.definitional = new BooleanType();
return this.definitional;
}
public boolean hasDefinitionalElement() {
return this.definitional != null && !this.definitional.isEmpty();
}
public boolean hasDefinitional() {
return this.definitional != null && !this.definitional.isEmpty();
}
/**
* @param value {@link #definitional} (If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.). This is the underlying object with id, value and extensions. The accessor "getDefinitional" gives direct access to the value
*/
public DataElementMappingComponent setDefinitionalElement(BooleanType value) {
this.definitional = value;
return this;
}
/**
* @return If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.
*/
public boolean getDefinitional() {
return this.definitional == null ? false : this.definitional.getValue();
}
/**
* @param value If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.
*/
public DataElementMappingComponent setDefinitional(boolean value) {
if (value == false)
this.definitional = null;
else {
if (this.definitional == null)
this.definitional = new BooleanType();
this.definitional.setValue(value);
}
return this;
}
/**
* @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
*/
@ -712,6 +776,7 @@ public class DataElement extends DomainResource {
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("uri", "uri", "A URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri));
childrenList.add(new Property("definitional", "boolean", "If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.", 0, java.lang.Integer.MAX_VALUE, definitional));
childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name));
childrenList.add(new Property("comments", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comments));
childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map));
@ -721,6 +786,7 @@ public class DataElement extends DomainResource {
DataElementMappingComponent dst = new DataElementMappingComponent();
copyValues(dst);
dst.uri = uri == null ? null : uri.copy();
dst.definitional = definitional == null ? null : definitional.copy();
dst.name = name == null ? null : name.copy();
dst.comments = comments == null ? null : comments.copy();
dst.map = map == null ? null : map.copy();
@ -728,8 +794,9 @@ public class DataElement extends DomainResource {
}
public boolean isEmpty() {
return super.isEmpty() && (uri == null || uri.isEmpty()) && (name == null || name.isEmpty())
&& (comments == null || comments.isEmpty()) && (map == null || map.isEmpty());
return super.isEmpty() && (uri == null || uri.isEmpty()) && (definitional == null || definitional.isEmpty())
&& (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()) && (map == null || map.isEmpty())
;
}
}
@ -808,7 +875,7 @@ public class DataElement extends DomainResource {
* Provides a complete explanation of the meaning of the data element for human readability.
*/
@Child(name="definition", type={StringType.class}, order=9, min=0, max=1)
@Description(shortDefinition="Full formal definition in human language", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability." )
@Description(shortDefinition="Definition/description as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability." )
protected StringType definition;
/**
@ -840,10 +907,10 @@ public class DataElement extends DomainResource {
protected CodeType type;
/**
* An example value for this element.
* An sample value for this element demonstrating the type of information that would typically be captured.
*/
@Child(name="example", type={}, order=14, min=0, max=1)
@Description(shortDefinition="Example value: [as defined for type]", formalDefinition="An example value for this element." )
@Description(shortDefinition="Example value: [as defined for type]", formalDefinition="An sample value for this element demonstrating the type of information that would typically be captured." )
protected org.hl7.fhir.instance.model.Type example;
/**
@ -1077,7 +1144,7 @@ public class DataElement extends DomainResource {
*/
public DataElement setStatus(ResourceObservationDefStatus value) {
if (this.status == null)
this.status = new Enumeration<ResourceObservationDefStatus>();
this.status = new Enumeration<ResourceObservationDefStatus>(ResourceObservationDefStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -1113,14 +1180,14 @@ public class DataElement extends DomainResource {
/**
* @return The date that this version of the data element was published.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date that this version of the data element was published.
*/
public DataElement setDate(DateAndTime value) {
public DataElement setDate(Date value) {
if (value == null)
this.date = null;
else {
@ -1540,7 +1607,7 @@ public class DataElement extends DomainResource {
}
/**
* @return {@link #example} (An example value for this element.)
* @return {@link #example} (An sample value for this element demonstrating the type of information that would typically be captured.)
*/
public org.hl7.fhir.instance.model.Type getExample() {
return this.example;
@ -1551,7 +1618,7 @@ public class DataElement extends DomainResource {
}
/**
* @param value {@link #example} (An example value for this element.)
* @param value {@link #example} (An sample value for this element demonstrating the type of information that would typically be captured.)
*/
public DataElement setExample(org.hl7.fhir.instance.model.Type value) {
this.example = value;
@ -1702,7 +1769,7 @@ public class DataElement extends DomainResource {
childrenList.add(new Property("requirements", "string", "Explains why this element is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements));
childrenList.add(new Property("synonym", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, synonym));
childrenList.add(new Property("type", "code", "The FHIR data type that is the type for this element.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("example[x]", "*", "An example value for this element.", 0, java.lang.Integer.MAX_VALUE, example));
childrenList.add(new Property("example[x]", "*", "An sample value for this element demonstrating the type of information that would typically be captured.", 0, java.lang.Integer.MAX_VALUE, example));
childrenList.add(new Property("maxLength", "integer", "Indicates the shortest length that SHALL be supported by conformant instances without truncation.", 0, java.lang.Integer.MAX_VALUE, maxLength));
childrenList.add(new Property("units", "CodeableConcept", "Identifies the units of measure in which the data element should be captured or expressed.", 0, java.lang.Integer.MAX_VALUE, units));
childrenList.add(new Property("binding", "", "Binds to a value set if this element is coded (code, Coding, CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, binding));

View File

@ -178,10 +178,10 @@ public class DateAndTime {
} else {
TimeZone tz;
if (!timezone) {
tz = TimeZone.getTimeZone("GMT + 00 : 00");
} else {
tz = TimeZone.getTimeZone("GMT+00:00");
} else {
tz = TimeZone.getTimeZone("GMT"+(positiveOffset ? "+" : "-")+Utilities.padLeft(java.lang.Integer.toString(tzHour), '0', 2)+":"+Utilities.padLeft(java.lang.Integer.toString(tzMin), '0', 2));
}
}
cal = Calendar.getInstance(tz);
}
@ -206,7 +206,7 @@ public class DateAndTime {
if (fractions > 0) {
cal.set(Calendar.MILLISECOND, (int)((double) fraction / Math.pow(10, fractions) * 1000.0));
}
}
}
}
}
}

View File

@ -29,13 +29,13 @@ POSSIBILITY OF SUCH DAMAGE.
package org.hl7.fhir.instance.model;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import org.apache.commons.lang3.time.DateUtils;
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
import ca.uhn.fhir.parser.DataFormatException;
/**
* Represents a FHIR dateTime datatype. Valid precisions values for this type are:
* <ul>
@ -112,6 +112,17 @@ public class DateTimeType extends BaseDateTimeType {
super(theDate, thePrecision, theTimezone);
}
/**
* Constructor
*/
public DateTimeType(Calendar theCalendar) {
if (theCalendar != null) {
setValue(theCalendar.getTime());
setPrecision(DEFAULT_PRECISION);
setTimeZone(theCalendar.getTimeZone());
}
}
@Override
boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) {
switch (thePrecision) {
@ -127,10 +138,10 @@ public class DateTimeType extends BaseDateTimeType {
}
/**
* Returns a new instance of DateTimeDt with the current system time and SECOND precision and the system local time
* Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time
* zone
*/
public static DateTimeType withCurrentTime() {
public static DateTimeType now() {
return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault());
}
@ -149,4 +160,31 @@ public class DateTimeType extends BaseDateTimeType {
return new DateTimeType(getValueAsString());
}
/**
* Creates a new instance by parsing an HL7 v3 format date time string
*/
public static InstantType parseV3(String theV3String) {
InstantType retVal = new InstantType();
retVal.setValueAsV3String(theV3String);
return retVal;
}
public static DateTimeType today() {
DateTimeType retVal = now();
retVal.setPrecision(TemporalPrecisionEnum.DAY);
return retVal;
}
public boolean getTzSign() {
return getTimeZone().getRawOffset() >= 0;
}
public int getTzHour() {
return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) / 60;
}
public int getTzMin() {
return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) % 60;
}
}

View File

@ -48,6 +48,8 @@ import java.util.Date;
@DatatypeDef(name = "date")
public class DateType extends BaseDateTimeType {
private static final long serialVersionUID = 1L;
/**
* The default precision for this type
*/

View File

@ -43,6 +43,8 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
@DatatypeDef(name = "decimal")
public class DecimalType extends PrimitiveType<BigDecimal> implements Comparable<DecimalType> {
private static final long serialVersionUID = 1L;
/**
* Constructor
*/
@ -61,7 +63,7 @@ public class DecimalType extends PrimitiveType<BigDecimal> implements Comparable
* Constructor
*/
public DecimalType(double theValue) {
// Use the valueOf here because the constructor gives crazy precision
// Use the valueOf here because the constructor gives wacky precision
// changes due to the floating point conversion
setValue(BigDecimal.valueOf(theValue));
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -394,14 +394,14 @@ public class Device extends DomainResource {
/**
* @return Date of expiry of this device (if applicable).
*/
public DateAndTime getExpiry() {
public Date getExpiry() {
return this.expiry == null ? null : this.expiry.getValue();
}
/**
* @param value Date of expiry of this device (if applicable).
*/
public Device setExpiry(DateAndTime value) {
public Device setExpiry(Date value) {
if (value == null)
this.expiry = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent")
public class DeviceComponent extends DomainResource {
public enum MeasurementPrinciple {
public enum MeasurementPrinciple implements FhirEnum {
/**
* Measurement principle isn't in the list.
*/
@ -94,7 +94,10 @@ public class DeviceComponent extends DomainResource {
* added to help the parsers
*/
NULL;
public static MeasurementPrinciple fromCode(String codeString) throws Exception {
public static final MeasurementPrincipleEnumFactory ENUM_FACTORY = new MeasurementPrincipleEnumFactory();
public static MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("other".equals(codeString))
@ -119,8 +122,9 @@ public class DeviceComponent extends DomainResource {
return ACOUSTICAL;
if ("manual".equals(codeString))
return MANUAL;
throw new Exception("Unknown MeasurementPrinciple code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case OTHER: return "other";
@ -187,8 +191,8 @@ public class DeviceComponent extends DomainResource {
}
}
public static class MeasurementPrincipleEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MeasurementPrincipleEnumFactory implements EnumFactory<MeasurementPrinciple> {
public MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -214,9 +218,9 @@ public class DeviceComponent extends DomainResource {
return MeasurementPrinciple.ACOUSTICAL;
if ("manual".equals(codeString))
return MeasurementPrinciple.MANUAL;
throw new Exception("Unknown MeasurementPrinciple code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MeasurementPrinciple code) throws IllegalArgumentException {
if (code == MeasurementPrinciple.OTHER)
return "other";
if (code == MeasurementPrinciple.CHEMICAL)
@ -564,14 +568,14 @@ public class DeviceComponent extends DomainResource {
/**
* @return Describes the timestamp for the most recent system change which includes device configuration or setting change.
*/
public DateAndTime getLastSystemChange() {
public Date getLastSystemChange() {
return this.lastSystemChange == null ? null : this.lastSystemChange.getValue();
}
/**
* @param value Describes the timestamp for the most recent system change which includes device configuration or setting change.
*/
public DeviceComponent setLastSystemChange(DateAndTime value) {
public DeviceComponent setLastSystemChange(Date value) {
if (this.lastSystemChange == null)
this.lastSystemChange = new InstantType();
this.lastSystemChange.setValue(value);
@ -763,7 +767,7 @@ public class DeviceComponent extends DomainResource {
this.measurementPrinciple = null;
else {
if (this.measurementPrinciple == null)
this.measurementPrinciple = new Enumeration<MeasurementPrinciple>();
this.measurementPrinciple = new Enumeration<MeasurementPrinciple>(MeasurementPrinciple.ENUM_FACTORY);
this.measurementPrinciple.setValue(value);
}
return this;

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest")
public class DeviceUseRequest extends DomainResource {
public enum DeviceUseRequestStatus {
public enum DeviceUseRequestStatus implements FhirEnum {
/**
* The request has been placed.
*/
@ -86,7 +86,10 @@ public class DeviceUseRequest extends DomainResource {
* added to help the parsers
*/
NULL;
public static DeviceUseRequestStatus fromCode(String codeString) throws Exception {
public static final DeviceUseRequestStatusEnumFactory ENUM_FACTORY = new DeviceUseRequestStatusEnumFactory();
public static DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("requested".equals(codeString))
@ -107,8 +110,9 @@ public class DeviceUseRequest extends DomainResource {
return REJECTED;
if ("failed".equals(codeString))
return FAILED;
throw new Exception("Unknown DeviceUseRequestStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REQUESTED: return "requested";
@ -167,8 +171,8 @@ public class DeviceUseRequest extends DomainResource {
}
}
public static class DeviceUseRequestStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DeviceUseRequestStatusEnumFactory implements EnumFactory<DeviceUseRequestStatus> {
public DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -190,9 +194,9 @@ public class DeviceUseRequest extends DomainResource {
return DeviceUseRequestStatus.REJECTED;
if ("failed".equals(codeString))
return DeviceUseRequestStatus.FAILED;
throw new Exception("Unknown DeviceUseRequestStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DeviceUseRequestStatus code) throws IllegalArgumentException {
if (code == DeviceUseRequestStatus.REQUESTED)
return "requested";
if (code == DeviceUseRequestStatus.RECEIVED)
@ -215,7 +219,7 @@ public class DeviceUseRequest extends DomainResource {
}
}
public enum DeviceUseRequestMode {
public enum DeviceUseRequestMode implements FhirEnum {
/**
* planned.
*/
@ -232,7 +236,10 @@ public class DeviceUseRequest extends DomainResource {
* added to help the parsers
*/
NULL;
public static DeviceUseRequestMode fromCode(String codeString) throws Exception {
public static final DeviceUseRequestModeEnumFactory ENUM_FACTORY = new DeviceUseRequestModeEnumFactory();
public static DeviceUseRequestMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
@ -241,8 +248,9 @@ public class DeviceUseRequest extends DomainResource {
return PROPOSED;
if ("ordered".equals(codeString))
return ORDERED;
throw new Exception("Unknown DeviceUseRequestMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DeviceUseRequestMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PLANNED: return "planned";
@ -277,8 +285,8 @@ public class DeviceUseRequest extends DomainResource {
}
}
public static class DeviceUseRequestModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DeviceUseRequestModeEnumFactory implements EnumFactory<DeviceUseRequestMode> {
public DeviceUseRequestMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -288,9 +296,9 @@ public class DeviceUseRequest extends DomainResource {
return DeviceUseRequestMode.PROPOSED;
if ("ordered".equals(codeString))
return DeviceUseRequestMode.ORDERED;
throw new Exception("Unknown DeviceUseRequestMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DeviceUseRequestMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DeviceUseRequestMode code) throws IllegalArgumentException {
if (code == DeviceUseRequestMode.PLANNED)
return "planned";
if (code == DeviceUseRequestMode.PROPOSED)
@ -301,7 +309,7 @@ public class DeviceUseRequest extends DomainResource {
}
}
public enum DeviceUseRequestPriority {
public enum DeviceUseRequestPriority implements FhirEnum {
/**
* The request has a normal priority.
*/
@ -322,7 +330,10 @@ public class DeviceUseRequest extends DomainResource {
* added to help the parsers
*/
NULL;
public static DeviceUseRequestPriority fromCode(String codeString) throws Exception {
public static final DeviceUseRequestPriorityEnumFactory ENUM_FACTORY = new DeviceUseRequestPriorityEnumFactory();
public static DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("routine".equals(codeString))
@ -333,8 +344,9 @@ public class DeviceUseRequest extends DomainResource {
return STAT;
if ("asap".equals(codeString))
return ASAP;
throw new Exception("Unknown DeviceUseRequestPriority code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ROUTINE: return "routine";
@ -373,8 +385,8 @@ public class DeviceUseRequest extends DomainResource {
}
}
public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory<DeviceUseRequestPriority> {
public DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -386,9 +398,9 @@ public class DeviceUseRequest extends DomainResource {
return DeviceUseRequestPriority.STAT;
if ("asap".equals(codeString))
return DeviceUseRequestPriority.ASAP;
throw new Exception("Unknown DeviceUseRequestPriority code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DeviceUseRequestPriority code) throws IllegalArgumentException {
if (code == DeviceUseRequestPriority.ROUTINE)
return "routine";
if (code == DeviceUseRequestPriority.URGENT)
@ -599,7 +611,7 @@ public class DeviceUseRequest extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<DeviceUseRequestStatus>();
this.status = new Enumeration<DeviceUseRequestStatus>(DeviceUseRequestStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -648,7 +660,7 @@ public class DeviceUseRequest extends DomainResource {
this.mode = null;
else {
if (this.mode == null)
this.mode = new Enumeration<DeviceUseRequestMode>();
this.mode = new Enumeration<DeviceUseRequestMode>(DeviceUseRequestMode.ENUM_FACTORY);
this.mode.setValue(value);
}
return this;
@ -917,14 +929,14 @@ public class DeviceUseRequest extends DomainResource {
/**
* @return The time when the request was made.
*/
public DateAndTime getOrderedOn() {
public Date getOrderedOn() {
return this.orderedOn == null ? null : this.orderedOn.getValue();
}
/**
* @param value The time when the request was made.
*/
public DeviceUseRequest setOrderedOn(DateAndTime value) {
public DeviceUseRequest setOrderedOn(Date value) {
if (value == null)
this.orderedOn = null;
else {
@ -966,14 +978,14 @@ public class DeviceUseRequest extends DomainResource {
/**
* @return The time at which the request was made/recorded.
*/
public DateAndTime getRecordedOn() {
public Date getRecordedOn() {
return this.recordedOn == null ? null : this.recordedOn.getValue();
}
/**
* @param value The time at which the request was made/recorded.
*/
public DeviceUseRequest setRecordedOn(DateAndTime value) {
public DeviceUseRequest setRecordedOn(Date value) {
if (value == null)
this.recordedOn = null;
else {
@ -1117,7 +1129,7 @@ public class DeviceUseRequest extends DomainResource {
this.priority = null;
else {
if (this.priority == null)
this.priority = new Enumeration<DeviceUseRequestPriority>();
this.priority = new Enumeration<DeviceUseRequestPriority>(DeviceUseRequestPriority.ENUM_FACTORY);
this.priority.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -373,14 +373,14 @@ public class DeviceUseStatement extends DomainResource {
/**
* @return The time at which the statement was made/recorded.
*/
public DateAndTime getRecordedOn() {
public Date getRecordedOn() {
return this.recordedOn == null ? null : this.recordedOn.getValue();
}
/**
* @param value The time at which the statement was made/recorded.
*/
public DeviceUseStatement setRecordedOn(DateAndTime value) {
public DeviceUseStatement setRecordedOn(Date value) {
if (value == null)
this.recordedOn = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder")
public class DiagnosticOrder extends DomainResource {
public enum DiagnosticOrderStatus {
public enum DiagnosticOrderStatus implements FhirEnum {
/**
* The request has been placed.
*/
@ -86,7 +86,10 @@ public class DiagnosticOrder extends DomainResource {
* added to help the parsers
*/
NULL;
public static DiagnosticOrderStatus fromCode(String codeString) throws Exception {
public static final DiagnosticOrderStatusEnumFactory ENUM_FACTORY = new DiagnosticOrderStatusEnumFactory();
public static DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("requested".equals(codeString))
@ -107,8 +110,9 @@ public class DiagnosticOrder extends DomainResource {
return REJECTED;
if ("failed".equals(codeString))
return FAILED;
throw new Exception("Unknown DiagnosticOrderStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REQUESTED: return "requested";
@ -167,8 +171,8 @@ public class DiagnosticOrder extends DomainResource {
}
}
public static class DiagnosticOrderStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DiagnosticOrderStatusEnumFactory implements EnumFactory<DiagnosticOrderStatus> {
public DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -190,9 +194,9 @@ public class DiagnosticOrder extends DomainResource {
return DiagnosticOrderStatus.REJECTED;
if ("failed".equals(codeString))
return DiagnosticOrderStatus.FAILED;
throw new Exception("Unknown DiagnosticOrderStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DiagnosticOrderStatus code) throws IllegalArgumentException {
if (code == DiagnosticOrderStatus.REQUESTED)
return "requested";
if (code == DiagnosticOrderStatus.RECEIVED)
@ -215,7 +219,7 @@ public class DiagnosticOrder extends DomainResource {
}
}
public enum DiagnosticOrderPriority {
public enum DiagnosticOrderPriority implements FhirEnum {
/**
* The order has a normal priority.
*/
@ -236,7 +240,10 @@ public class DiagnosticOrder extends DomainResource {
* added to help the parsers
*/
NULL;
public static DiagnosticOrderPriority fromCode(String codeString) throws Exception {
public static final DiagnosticOrderPriorityEnumFactory ENUM_FACTORY = new DiagnosticOrderPriorityEnumFactory();
public static DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("routine".equals(codeString))
@ -247,8 +254,9 @@ public class DiagnosticOrder extends DomainResource {
return STAT;
if ("asap".equals(codeString))
return ASAP;
throw new Exception("Unknown DiagnosticOrderPriority code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ROUTINE: return "routine";
@ -287,8 +295,8 @@ public class DiagnosticOrder extends DomainResource {
}
}
public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory<DiagnosticOrderPriority> {
public DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -300,9 +308,9 @@ public class DiagnosticOrder extends DomainResource {
return DiagnosticOrderPriority.STAT;
if ("asap".equals(codeString))
return DiagnosticOrderPriority.ASAP;
throw new Exception("Unknown DiagnosticOrderPriority code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DiagnosticOrderPriority code) throws IllegalArgumentException {
if (code == DiagnosticOrderPriority.ROUTINE)
return "routine";
if (code == DiagnosticOrderPriority.URGENT)
@ -402,7 +410,7 @@ public class DiagnosticOrder extends DomainResource {
*/
public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) {
if (this.status == null)
this.status = new Enumeration<DiagnosticOrderStatus>();
this.status = new Enumeration<DiagnosticOrderStatus>(DiagnosticOrderStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -462,14 +470,14 @@ public class DiagnosticOrder extends DomainResource {
/**
* @return The date/time at which the event occurred.
*/
public DateAndTime getDateTime() {
public Date getDateTime() {
return this.dateTime == null ? null : this.dateTime.getValue();
}
/**
* @param value The date/time at which the event occurred.
*/
public DiagnosticOrderEventComponent setDateTime(DateAndTime value) {
public DiagnosticOrderEventComponent setDateTime(Date value) {
if (this.dateTime == null)
this.dateTime = new DateTimeType();
this.dateTime.setValue(value);
@ -735,7 +743,7 @@ public class DiagnosticOrder extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<DiagnosticOrderStatus>();
this.status = new Enumeration<DiagnosticOrderStatus>(DiagnosticOrderStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -1259,7 +1267,7 @@ public class DiagnosticOrder extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<DiagnosticOrderStatus>();
this.status = new Enumeration<DiagnosticOrderStatus>(DiagnosticOrderStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -1308,7 +1316,7 @@ public class DiagnosticOrder extends DomainResource {
this.priority = null;
else {
if (this.priority == null)
this.priority = new Enumeration<DiagnosticOrderPriority>();
this.priority = new Enumeration<DiagnosticOrderPriority>(DiagnosticOrderPriority.ENUM_FACTORY);
this.priority.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport")
public class DiagnosticReport extends DomainResource {
public enum DiagnosticReportStatus {
public enum DiagnosticReportStatus implements FhirEnum {
/**
* The existence of the report is registered, but there is nothing yet available.
*/
@ -82,7 +82,10 @@ public class DiagnosticReport extends DomainResource {
* added to help the parsers
*/
NULL;
public static DiagnosticReportStatus fromCode(String codeString) throws Exception {
public static final DiagnosticReportStatusEnumFactory ENUM_FACTORY = new DiagnosticReportStatusEnumFactory();
public static DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("registered".equals(codeString))
@ -101,8 +104,9 @@ public class DiagnosticReport extends DomainResource {
return CANCELLED;
if ("entered in error".equals(codeString))
return ENTEREDINERROR;
throw new Exception("Unknown DiagnosticReportStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REGISTERED: return "registered";
@ -157,8 +161,8 @@ public class DiagnosticReport extends DomainResource {
}
}
public static class DiagnosticReportStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DiagnosticReportStatusEnumFactory implements EnumFactory<DiagnosticReportStatus> {
public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -178,9 +182,9 @@ public class DiagnosticReport extends DomainResource {
return DiagnosticReportStatus.CANCELLED;
if ("entered in error".equals(codeString))
return DiagnosticReportStatus.ENTEREDINERROR;
throw new Exception("Unknown DiagnosticReportStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DiagnosticReportStatus code) throws IllegalArgumentException {
if (code == DiagnosticReportStatus.REGISTERED)
return "registered";
if (code == DiagnosticReportStatus.PARTIAL)
@ -569,7 +573,7 @@ public class DiagnosticReport extends DomainResource {
*/
public DiagnosticReport setStatus(DiagnosticReportStatus value) {
if (this.status == null)
this.status = new Enumeration<DiagnosticReportStatus>();
this.status = new Enumeration<DiagnosticReportStatus>(DiagnosticReportStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -605,14 +609,14 @@ public class DiagnosticReport extends DomainResource {
/**
* @return The date and/or time that this version of the report was released from the source diagnostic service.
*/
public DateAndTime getIssued() {
public Date getIssued() {
return this.issued == null ? null : this.issued.getValue();
}
/**
* @param value The date and/or time that this version of the report was released from the source diagnostic service.
*/
public DiagnosticReport setIssued(DateAndTime value) {
public DiagnosticReport setIssued(Date value) {
if (this.issued == null)
this.issued = new DateTimeType();
this.issued.setValue(value);
@ -1230,12 +1234,12 @@ public class DiagnosticReport extends DomainResource {
public static final String SP_DATE = "date";
@SearchParamDefinition(name="patient", path="DiagnosticReport.subject", description="The subject of the report if a patient", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="request", path="DiagnosticReport.requestDetail", description="What was requested", type="reference" )
public static final String SP_REQUEST = "request";
@SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference" )
public static final String SP_SPECIMEN = "specimen";
@SearchParamDefinition(name="name", path="DiagnosticReport.name", description="The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)", type="token" )
public static final String SP_NAME = "name";
@SearchParamDefinition(name="request", path="DiagnosticReport.requestDetail", description="What was requested", type="reference" )
public static final String SP_REQUEST = "request";
@SearchParamDefinition(name="service", path="DiagnosticReport.serviceCategory", description="Which diagnostic discipline/department created the report", type="token" )
public static final String SP_SERVICE = "service";
@SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who was the source of the report (organization)", type="reference" )

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest")
public class DocumentManifest extends DomainResource {
public enum DocumentReferenceStatus {
public enum DocumentReferenceStatus implements FhirEnum {
/**
* This is the current reference for this document.
*/
@ -62,7 +62,10 @@ public class DocumentManifest extends DomainResource {
* added to help the parsers
*/
NULL;
public static DocumentReferenceStatus fromCode(String codeString) throws Exception {
public static final DocumentReferenceStatusEnumFactory ENUM_FACTORY = new DocumentReferenceStatusEnumFactory();
public static DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("current".equals(codeString))
@ -71,8 +74,9 @@ public class DocumentManifest extends DomainResource {
return SUPERCEDED;
if ("entered in error".equals(codeString))
return ENTEREDINERROR;
throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CURRENT: return "current";
@ -107,8 +111,8 @@ public class DocumentManifest extends DomainResource {
}
}
public static class DocumentReferenceStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DocumentReferenceStatusEnumFactory implements EnumFactory<DocumentReferenceStatus> {
public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class DocumentManifest extends DomainResource {
return DocumentReferenceStatus.SUPERCEDED;
if ("entered in error".equals(codeString))
return DocumentReferenceStatus.ENTEREDINERROR;
throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException {
if (code == DocumentReferenceStatus.CURRENT)
return "current";
if (code == DocumentReferenceStatus.SUPERCEDED)
@ -485,14 +489,14 @@ public class DocumentManifest extends DomainResource {
/**
* @return When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).
*/
public DateAndTime getCreated() {
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc).
*/
public DocumentManifest setCreated(DateAndTime value) {
public DocumentManifest setCreated(Date value) {
if (value == null)
this.created = null;
else {
@ -592,7 +596,7 @@ public class DocumentManifest extends DomainResource {
*/
public DocumentManifest setStatus(DocumentReferenceStatus value) {
if (this.status == null)
this.status = new Enumeration<DocumentReferenceStatus>();
this.status = new Enumeration<DocumentReferenceStatus>(DocumentReferenceStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference")
public class DocumentReference extends DomainResource {
public enum DocumentReferenceStatus {
public enum DocumentReferenceStatus implements FhirEnum {
/**
* This is the current reference for this document.
*/
@ -62,7 +62,10 @@ public class DocumentReference extends DomainResource {
* added to help the parsers
*/
NULL;
public static DocumentReferenceStatus fromCode(String codeString) throws Exception {
public static final DocumentReferenceStatusEnumFactory ENUM_FACTORY = new DocumentReferenceStatusEnumFactory();
public static DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("current".equals(codeString))
@ -71,8 +74,9 @@ public class DocumentReference extends DomainResource {
return SUPERCEDED;
if ("entered in error".equals(codeString))
return ENTEREDINERROR;
throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CURRENT: return "current";
@ -107,8 +111,8 @@ public class DocumentReference extends DomainResource {
}
}
public static class DocumentReferenceStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DocumentReferenceStatusEnumFactory implements EnumFactory<DocumentReferenceStatus> {
public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class DocumentReference extends DomainResource {
return DocumentReferenceStatus.SUPERCEDED;
if ("entered in error".equals(codeString))
return DocumentReferenceStatus.ENTEREDINERROR;
throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException {
if (code == DocumentReferenceStatus.CURRENT)
return "current";
if (code == DocumentReferenceStatus.SUPERCEDED)
@ -131,7 +135,7 @@ public class DocumentReference extends DomainResource {
}
}
public enum DocumentRelationshipType {
public enum DocumentRelationshipType implements FhirEnum {
/**
* This document logically replaces or supercedes the target document.
*/
@ -152,7 +156,10 @@ public class DocumentReference extends DomainResource {
* added to help the parsers
*/
NULL;
public static DocumentRelationshipType fromCode(String codeString) throws Exception {
public static final DocumentRelationshipTypeEnumFactory ENUM_FACTORY = new DocumentRelationshipTypeEnumFactory();
public static DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("replaces".equals(codeString))
@ -163,8 +170,9 @@ public class DocumentReference extends DomainResource {
return SIGNS;
if ("appends".equals(codeString))
return APPENDS;
throw new Exception("Unknown DocumentRelationshipType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REPLACES: return "replaces";
@ -203,8 +211,8 @@ public class DocumentReference extends DomainResource {
}
}
public static class DocumentRelationshipTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DocumentRelationshipTypeEnumFactory implements EnumFactory<DocumentRelationshipType> {
public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -216,9 +224,9 @@ public class DocumentReference extends DomainResource {
return DocumentRelationshipType.SIGNS;
if ("appends".equals(codeString))
return DocumentRelationshipType.APPENDS;
throw new Exception("Unknown DocumentRelationshipType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DocumentRelationshipType code) throws IllegalArgumentException {
if (code == DocumentRelationshipType.REPLACES)
return "replaces";
if (code == DocumentRelationshipType.TRANSFORMS)
@ -304,7 +312,7 @@ public class DocumentReference extends DomainResource {
*/
public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) {
if (this.code == null)
this.code = new Enumeration<DocumentRelationshipType>();
this.code = new Enumeration<DocumentRelationshipType>(DocumentRelationshipType.ENUM_FACTORY);
this.code.setValue(value);
return this;
}
@ -1361,14 +1369,14 @@ public class DocumentReference extends DomainResource {
/**
* @return When the document was created.
*/
public DateAndTime getCreated() {
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value When the document was created.
*/
public DocumentReference setCreated(DateAndTime value) {
public DocumentReference setCreated(Date value) {
if (value == null)
this.created = null;
else {
@ -1410,14 +1418,14 @@ public class DocumentReference extends DomainResource {
/**
* @return When the document reference was created.
*/
public DateAndTime getIndexed() {
public Date getIndexed() {
return this.indexed == null ? null : this.indexed.getValue();
}
/**
* @param value When the document reference was created.
*/
public DocumentReference setIndexed(DateAndTime value) {
public DocumentReference setIndexed(Date value) {
if (this.indexed == null)
this.indexed = new InstantType();
this.indexed.setValue(value);
@ -1464,7 +1472,7 @@ public class DocumentReference extends DomainResource {
*/
public DocumentReference setStatus(DocumentReferenceStatus value) {
if (this.status == null)
this.status = new Enumeration<DocumentReferenceStatus>();
this.status = new Enumeration<DocumentReferenceStatus>(DocumentReferenceStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
@DatatypeDef(name="ElementDefinition")
public class ElementDefinition extends Type {
public enum PropertyRepresentation {
public enum PropertyRepresentation implements FhirEnum {
/**
* In XML, this property is represented as an attribute not an element.
*/
@ -52,13 +52,17 @@ public class ElementDefinition extends Type {
* added to help the parsers
*/
NULL;
public static PropertyRepresentation fromCode(String codeString) throws Exception {
public static final PropertyRepresentationEnumFactory ENUM_FACTORY = new PropertyRepresentationEnumFactory();
public static PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("xmlAttr".equals(codeString))
return XMLATTR;
throw new Exception("Unknown PropertyRepresentation code '"+codeString+"'");
throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case XMLATTR: return "xmlAttr";
@ -85,23 +89,23 @@ public class ElementDefinition extends Type {
}
}
public static class PropertyRepresentationEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class PropertyRepresentationEnumFactory implements EnumFactory<PropertyRepresentation> {
public PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("xmlAttr".equals(codeString))
return PropertyRepresentation.XMLATTR;
throw new Exception("Unknown PropertyRepresentation code '"+codeString+"'");
throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(PropertyRepresentation code) throws IllegalArgumentException {
if (code == PropertyRepresentation.XMLATTR)
return "xmlAttr";
return "?";
}
}
public enum ResourceSlicingRules {
public enum ResourceSlicingRules implements FhirEnum {
/**
* No additional content is allowed other than that described by the slices in this profile.
*/
@ -118,7 +122,10 @@ public class ElementDefinition extends Type {
* added to help the parsers
*/
NULL;
public static ResourceSlicingRules fromCode(String codeString) throws Exception {
public static final ResourceSlicingRulesEnumFactory ENUM_FACTORY = new ResourceSlicingRulesEnumFactory();
public static ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("closed".equals(codeString))
@ -127,8 +134,9 @@ public class ElementDefinition extends Type {
return OPEN;
if ("openAtEnd".equals(codeString))
return OPENATEND;
throw new Exception("Unknown ResourceSlicingRules code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CLOSED: return "closed";
@ -163,8 +171,8 @@ public class ElementDefinition extends Type {
}
}
public static class ResourceSlicingRulesEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ResourceSlicingRulesEnumFactory implements EnumFactory<ResourceSlicingRules> {
public ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -174,9 +182,9 @@ public class ElementDefinition extends Type {
return ResourceSlicingRules.OPEN;
if ("openAtEnd".equals(codeString))
return ResourceSlicingRules.OPENATEND;
throw new Exception("Unknown ResourceSlicingRules code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ResourceSlicingRules code) throws IllegalArgumentException {
if (code == ResourceSlicingRules.CLOSED)
return "closed";
if (code == ResourceSlicingRules.OPEN)
@ -187,7 +195,7 @@ public class ElementDefinition extends Type {
}
}
public enum ResourceAggregationMode {
public enum ResourceAggregationMode implements FhirEnum {
/**
* The reference is a local reference to a contained resource.
*/
@ -204,7 +212,10 @@ public class ElementDefinition extends Type {
* added to help the parsers
*/
NULL;
public static ResourceAggregationMode fromCode(String codeString) throws Exception {
public static final ResourceAggregationModeEnumFactory ENUM_FACTORY = new ResourceAggregationModeEnumFactory();
public static ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("contained".equals(codeString))
@ -213,8 +224,9 @@ public class ElementDefinition extends Type {
return REFERENCED;
if ("bundled".equals(codeString))
return BUNDLED;
throw new Exception("Unknown ResourceAggregationMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CONTAINED: return "contained";
@ -249,8 +261,8 @@ public class ElementDefinition extends Type {
}
}
public static class ResourceAggregationModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ResourceAggregationModeEnumFactory implements EnumFactory<ResourceAggregationMode> {
public ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -260,9 +272,9 @@ public class ElementDefinition extends Type {
return ResourceAggregationMode.REFERENCED;
if ("bundled".equals(codeString))
return ResourceAggregationMode.BUNDLED;
throw new Exception("Unknown ResourceAggregationMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ResourceAggregationMode code) throws IllegalArgumentException {
if (code == ResourceAggregationMode.CONTAINED)
return "contained";
if (code == ResourceAggregationMode.REFERENCED)
@ -273,7 +285,7 @@ public class ElementDefinition extends Type {
}
}
public enum ConstraintSeverity {
public enum ConstraintSeverity implements FhirEnum {
/**
* If the constraint is violated, the resource is not conformant.
*/
@ -286,15 +298,19 @@ public class ElementDefinition extends Type {
* added to help the parsers
*/
NULL;
public static ConstraintSeverity fromCode(String codeString) throws Exception {
public static final ConstraintSeverityEnumFactory ENUM_FACTORY = new ConstraintSeverityEnumFactory();
public static ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("error".equals(codeString))
return ERROR;
if ("warning".equals(codeString))
return WARNING;
throw new Exception("Unknown ConstraintSeverity code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ERROR: return "error";
@ -325,8 +341,8 @@ public class ElementDefinition extends Type {
}
}
public static class ConstraintSeverityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ConstraintSeverityEnumFactory implements EnumFactory<ConstraintSeverity> {
public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -334,9 +350,9 @@ public class ElementDefinition extends Type {
return ConstraintSeverity.ERROR;
if ("warning".equals(codeString))
return ConstraintSeverity.WARNING;
throw new Exception("Unknown ConstraintSeverity code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ConstraintSeverity code) throws IllegalArgumentException {
if (code == ConstraintSeverity.ERROR)
return "error";
if (code == ConstraintSeverity.WARNING)
@ -345,7 +361,7 @@ public class ElementDefinition extends Type {
}
}
public enum BindingConformance {
public enum BindingConformance implements FhirEnum {
/**
* Only codes in the specified set are allowed. If the binding is extensible, other codes may be used for concepts not covered by the bound set of codes.
*/
@ -362,7 +378,10 @@ public class ElementDefinition extends Type {
* added to help the parsers
*/
NULL;
public static BindingConformance fromCode(String codeString) throws Exception {
public static final BindingConformanceEnumFactory ENUM_FACTORY = new BindingConformanceEnumFactory();
public static BindingConformance fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("required".equals(codeString))
@ -371,8 +390,9 @@ public class ElementDefinition extends Type {
return PREFERRED;
if ("example".equals(codeString))
return EXAMPLE;
throw new Exception("Unknown BindingConformance code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REQUIRED: return "required";
@ -407,8 +427,8 @@ public class ElementDefinition extends Type {
}
}
public static class BindingConformanceEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class BindingConformanceEnumFactory implements EnumFactory<BindingConformance> {
public BindingConformance fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -418,9 +438,9 @@ public class ElementDefinition extends Type {
return BindingConformance.PREFERRED;
if ("example".equals(codeString))
return BindingConformance.EXAMPLE;
throw new Exception("Unknown BindingConformance code '"+codeString+"'");
throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(BindingConformance code) throws IllegalArgumentException {
if (code == BindingConformance.REQUIRED)
return "required";
if (code == BindingConformance.PREFERRED)
@ -663,7 +683,7 @@ public class ElementDefinition extends Type {
*/
public ElementDefinitionSlicingComponent setRules(ResourceSlicingRules value) {
if (this.rules == null)
this.rules = new Enumeration<ResourceSlicingRules>();
this.rules = new Enumeration<ResourceSlicingRules>(ResourceSlicingRules.ENUM_FACTORY);
this.rules.setValue(value);
return this;
}
@ -1089,7 +1109,7 @@ public class ElementDefinition extends Type {
*/
public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) {
if (this.severity == null)
this.severity = new Enumeration<ConstraintSeverity>();
this.severity = new Enumeration<ConstraintSeverity>(ConstraintSeverity.ENUM_FACTORY);
this.severity.setValue(value);
return this;
}
@ -1393,7 +1413,7 @@ public class ElementDefinition extends Type {
this.conformance = null;
else {
if (this.conformance == null)
this.conformance = new Enumeration<BindingConformance>();
this.conformance = new Enumeration<BindingConformance>(BindingConformance.ENUM_FACTORY);
this.conformance.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -41,8 +41,8 @@ import org.hl7.fhir.instance.model.annotations.Description;
/**
* This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.
*/
@ResourceDef(name="Eligibility", profile="http://hl7.org/fhir/Profile/Eligibility")
public class Eligibility extends DomainResource {
@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest")
public class EligibilityRequest extends DomainResource {
/**
* The Response Business Identifier.
@ -68,9 +68,9 @@ public class Eligibility extends DomainResource {
/**
* The date when this resource was created.
*/
@Child(name="date", type={DateType.class}, order=2, min=0, max=1)
@Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." )
protected DateType date;
protected DateTimeType created;
/**
* The Insurer who is target of the request.
@ -108,9 +108,9 @@ public class Eligibility extends DomainResource {
*/
protected Organization organizationTarget;
private static final long serialVersionUID = 459884579L;
private static final long serialVersionUID = 1836339504L;
public Eligibility() {
public EligibilityRequest() {
super();
}
@ -150,7 +150,7 @@ public class Eligibility extends DomainResource {
public Coding getRuleset() {
if (this.ruleset == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.ruleset");
throw new Error("Attempt to auto-create EligibilityRequest.ruleset");
else if (Configuration.doAutoCreate())
this.ruleset = new Coding();
return this.ruleset;
@ -163,7 +163,7 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
*/
public Eligibility setRuleset(Coding value) {
public EligibilityRequest setRuleset(Coding value) {
this.ruleset = value;
return this;
}
@ -174,7 +174,7 @@ public class Eligibility extends DomainResource {
public Coding getOriginalRuleset() {
if (this.originalRuleset == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.originalRuleset");
throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset");
else if (Configuration.doAutoCreate())
this.originalRuleset = new Coding();
return this.originalRuleset;
@ -187,56 +187,56 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
*/
public Eligibility setOriginalRuleset(Coding value) {
public EligibilityRequest setOriginalRuleset(Coding value) {
this.originalRuleset = value;
return this;
}
/**
* @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateType getDateElement() {
if (this.date == null)
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.date");
throw new Error("Attempt to auto-create EligibilityRequest.created");
else if (Configuration.doAutoCreate())
this.date = new DateType();
return this.date;
this.created = new DateTimeType();
return this.created;
}
public boolean hasDateElement() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasDate() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public Eligibility setDateElement(DateType value) {
this.date = value;
public EligibilityRequest setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when this resource was created.
*/
public DateAndTime getDate() {
return this.date == null ? null : this.date.getValue();
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when this resource was created.
*/
public Eligibility setDate(DateAndTime value) {
public EligibilityRequest setCreated(Date value) {
if (value == null)
this.date = null;
this.created = null;
else {
if (this.date == null)
this.date = new DateType();
this.date.setValue(value);
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
@ -247,7 +247,7 @@ public class Eligibility extends DomainResource {
public Reference getTarget() {
if (this.target == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.target");
throw new Error("Attempt to auto-create EligibilityRequest.target");
else if (Configuration.doAutoCreate())
this.target = new Reference();
return this.target;
@ -260,7 +260,7 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #target} (The Insurer who is target of the request.)
*/
public Eligibility setTarget(Reference value) {
public EligibilityRequest setTarget(Reference value) {
this.target = value;
return this;
}
@ -271,7 +271,7 @@ public class Eligibility extends DomainResource {
public Organization getTargetTarget() {
if (this.targetTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.target");
throw new Error("Attempt to auto-create EligibilityRequest.target");
else if (Configuration.doAutoCreate())
this.targetTarget = new Organization();
return this.targetTarget;
@ -280,7 +280,7 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.)
*/
public Eligibility setTargetTarget(Organization value) {
public EligibilityRequest setTargetTarget(Organization value) {
this.targetTarget = value;
return this;
}
@ -291,7 +291,7 @@ public class Eligibility extends DomainResource {
public Reference getProvider() {
if (this.provider == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.provider");
throw new Error("Attempt to auto-create EligibilityRequest.provider");
else if (Configuration.doAutoCreate())
this.provider = new Reference();
return this.provider;
@ -304,7 +304,7 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
*/
public Eligibility setProvider(Reference value) {
public EligibilityRequest setProvider(Reference value) {
this.provider = value;
return this;
}
@ -315,7 +315,7 @@ public class Eligibility extends DomainResource {
public Practitioner getProviderTarget() {
if (this.providerTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.provider");
throw new Error("Attempt to auto-create EligibilityRequest.provider");
else if (Configuration.doAutoCreate())
this.providerTarget = new Practitioner();
return this.providerTarget;
@ -324,7 +324,7 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
*/
public Eligibility setProviderTarget(Practitioner value) {
public EligibilityRequest setProviderTarget(Practitioner value) {
this.providerTarget = value;
return this;
}
@ -335,7 +335,7 @@ public class Eligibility extends DomainResource {
public Reference getOrganization() {
if (this.organization == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.organization");
throw new Error("Attempt to auto-create EligibilityRequest.organization");
else if (Configuration.doAutoCreate())
this.organization = new Reference();
return this.organization;
@ -348,7 +348,7 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.)
*/
public Eligibility setOrganization(Reference value) {
public EligibilityRequest setOrganization(Reference value) {
this.organization = value;
return this;
}
@ -359,7 +359,7 @@ public class Eligibility extends DomainResource {
public Organization getOrganizationTarget() {
if (this.organizationTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Eligibility.organization");
throw new Error("Attempt to auto-create EligibilityRequest.organization");
else if (Configuration.doAutoCreate())
this.organizationTarget = new Organization();
return this.organizationTarget;
@ -368,7 +368,7 @@ public class Eligibility extends DomainResource {
/**
* @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
*/
public Eligibility setOrganizationTarget(Organization value) {
public EligibilityRequest setOrganizationTarget(Organization value) {
this.organizationTarget = value;
return this;
}
@ -378,14 +378,14 @@ public class Eligibility extends DomainResource {
childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date));
childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target));
childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider));
childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization));
}
public Eligibility copy() {
Eligibility dst = new Eligibility();
public EligibilityRequest copy() {
EligibilityRequest dst = new EligibilityRequest();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
@ -394,30 +394,30 @@ public class Eligibility extends DomainResource {
};
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.date = date == null ? null : date.copy();
dst.created = created == null ? null : created.copy();
dst.target = target == null ? null : target.copy();
dst.provider = provider == null ? null : provider.copy();
dst.organization = organization == null ? null : organization.copy();
return dst;
}
protected Eligibility typedCopy() {
protected EligibilityRequest typedCopy() {
return copy();
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty())
&& (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty())
&& (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty())
&& (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty())
;
}
@Override
public ResourceType getResourceType() {
return ResourceType.Eligibility;
return ResourceType.EligibilityRequest;
}
@SearchParamDefinition(name="identifier", path="Eligibility.identifier", description="The business identifier of the Eligibility", type="token" )
@SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" )
public static final String SP_IDENTIFIER = "identifier";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse")
public class EligibilityResponse extends DomainResource {
public enum RSLink {
public enum RSLink implements FhirEnum {
/**
* The processing completed without errors.
*/
@ -58,15 +58,19 @@ public class EligibilityResponse extends DomainResource {
* added to help the parsers
*/
NULL;
public static RSLink fromCode(String codeString) throws Exception {
public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory();
public static RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
return COMPLETE;
if ("error".equals(codeString))
return ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case COMPLETE: return "complete";
@ -97,8 +101,8 @@ public class EligibilityResponse extends DomainResource {
}
}
public static class RSLinkEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class RSLinkEnumFactory implements EnumFactory<RSLink> {
public RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -106,9 +110,9 @@ public class EligibilityResponse extends DomainResource {
return RSLink.COMPLETE;
if ("error".equals(codeString))
return RSLink.ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(RSLink code) throws IllegalArgumentException {
if (code == RSLink.COMPLETE)
return "complete";
if (code == RSLink.ERROR)
@ -127,14 +131,14 @@ public class EligibilityResponse extends DomainResource {
/**
* Original request resource referrence.
*/
@Child(name="request", type={Eligibility.class}, order=0, min=0, max=1)
@Child(name="request", type={EligibilityRequest.class}, order=0, min=0, max=1)
@Description(shortDefinition="Claim reference", formalDefinition="Original request resource referrence." )
protected Reference request;
/**
* The actual object that is the target of the reference (Original request resource referrence.)
*/
protected Eligibility requestTarget;
protected EligibilityRequest requestTarget;
/**
* Transaction status: error, complete.
@ -167,9 +171,9 @@ public class EligibilityResponse extends DomainResource {
/**
* The date when the enclosed suite of services were performed or completed.
*/
@Child(name="date", type={DateType.class}, order=5, min=0, max=1)
@Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
protected DateType date;
protected DateTimeType created;
/**
* The Insurer who produced this adjudicated response.
@ -207,7 +211,7 @@ public class EligibilityResponse extends DomainResource {
*/
protected Organization requestOrganizationTarget;
private static final long serialVersionUID = -281414348L;
private static final long serialVersionUID = 241710852L;
public EligibilityResponse() {
super();
@ -270,19 +274,19 @@ public class EligibilityResponse extends DomainResource {
/**
* @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource referrence.)
*/
public Eligibility getRequestTarget() {
public EligibilityRequest getRequestTarget() {
if (this.requestTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create EligibilityResponse.request");
else if (Configuration.doAutoCreate())
this.requestTarget = new Eligibility();
this.requestTarget = new EligibilityRequest();
return this.requestTarget;
}
/**
* @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource referrence.)
*/
public EligibilityResponse setRequestTarget(Eligibility value) {
public EligibilityResponse setRequestTarget(EligibilityRequest value) {
this.requestTarget = value;
return this;
}
@ -330,7 +334,7 @@ public class EligibilityResponse extends DomainResource {
this.outcome = null;
else {
if (this.outcome == null)
this.outcome = new Enumeration<RSLink>();
this.outcome = new Enumeration<RSLink>(RSLink.ENUM_FACTORY);
this.outcome.setValue(value);
}
return this;
@ -434,50 +438,50 @@ public class EligibilityResponse extends DomainResource {
}
/**
* @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateType getDateElement() {
if (this.date == null)
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create EligibilityResponse.date");
throw new Error("Attempt to auto-create EligibilityResponse.created");
else if (Configuration.doAutoCreate())
this.date = new DateType();
return this.date;
this.created = new DateTimeType();
return this.created;
}
public boolean hasDateElement() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasDate() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public EligibilityResponse setDateElement(DateType value) {
this.date = value;
public EligibilityResponse setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when the enclosed suite of services were performed or completed.
*/
public DateAndTime getDate() {
return this.date == null ? null : this.date.getValue();
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when the enclosed suite of services were performed or completed.
*/
public EligibilityResponse setDate(DateAndTime value) {
public EligibilityResponse setCreated(Date value) {
if (value == null)
this.date = null;
this.created = null;
else {
if (this.date == null)
this.date = new DateType();
this.date.setValue(value);
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
@ -617,12 +621,12 @@ public class EligibilityResponse extends DomainResource {
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("request", "Reference(Eligibility)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request));
childrenList.add(new Property("request", "Reference(EligibilityRequest)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request));
childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome));
childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition));
childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date));
childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization));
childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider));
childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization));
@ -641,7 +645,7 @@ public class EligibilityResponse extends DomainResource {
dst.disposition = disposition == null ? null : disposition.copy();
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.date = date == null ? null : date.copy();
dst.created = created == null ? null : created.copy();
dst.organization = organization == null ? null : organization.copy();
dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
@ -656,8 +660,9 @@ public class EligibilityResponse extends DomainResource {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty())
&& (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty())
&& (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty())
&& (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty())
&& (requestOrganization == null || requestOrganization.isEmpty());
&& (created == null || created.isEmpty()) && (organization == null || organization.isEmpty())
&& (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty())
;
}
@Override

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter")
public class Encounter extends DomainResource {
public enum EncounterState {
public enum EncounterState implements FhirEnum {
/**
* The Encounter has not yet started.
*/
@ -70,7 +70,10 @@ public class Encounter extends DomainResource {
* added to help the parsers
*/
NULL;
public static EncounterState fromCode(String codeString) throws Exception {
public static final EncounterStateEnumFactory ENUM_FACTORY = new EncounterStateEnumFactory();
public static EncounterState fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
@ -83,8 +86,9 @@ public class Encounter extends DomainResource {
return FINISHED;
if ("cancelled".equals(codeString))
return CANCELLED;
throw new Exception("Unknown EncounterState code '"+codeString+"'");
throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PLANNED: return "planned";
@ -127,8 +131,8 @@ public class Encounter extends DomainResource {
}
}
public static class EncounterStateEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class EncounterStateEnumFactory implements EnumFactory<EncounterState> {
public EncounterState fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -142,9 +146,9 @@ public class Encounter extends DomainResource {
return EncounterState.FINISHED;
if ("cancelled".equals(codeString))
return EncounterState.CANCELLED;
throw new Exception("Unknown EncounterState code '"+codeString+"'");
throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(EncounterState code) throws IllegalArgumentException {
if (code == EncounterState.PLANNED)
return "planned";
if (code == EncounterState.INPROGRESS)
@ -159,7 +163,7 @@ public class Encounter extends DomainResource {
}
}
public enum EncounterClass {
public enum EncounterClass implements FhirEnum {
/**
* An encounter during which the patient is hospitalized and stays overnight.
*/
@ -196,7 +200,10 @@ public class Encounter extends DomainResource {
* added to help the parsers
*/
NULL;
public static EncounterClass fromCode(String codeString) throws Exception {
public static final EncounterClassEnumFactory ENUM_FACTORY = new EncounterClassEnumFactory();
public static EncounterClass fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("inpatient".equals(codeString))
@ -215,8 +222,9 @@ public class Encounter extends DomainResource {
return DAYTIME;
if ("virtual".equals(codeString))
return VIRTUAL;
throw new Exception("Unknown EncounterClass code '"+codeString+"'");
throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INPATIENT: return "inpatient";
@ -271,8 +279,8 @@ public class Encounter extends DomainResource {
}
}
public static class EncounterClassEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class EncounterClassEnumFactory implements EnumFactory<EncounterClass> {
public EncounterClass fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -292,9 +300,9 @@ public class Encounter extends DomainResource {
return EncounterClass.DAYTIME;
if ("virtual".equals(codeString))
return EncounterClass.VIRTUAL;
throw new Exception("Unknown EncounterClass code '"+codeString+"'");
throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(EncounterClass code) throws IllegalArgumentException {
if (code == EncounterClass.INPATIENT)
return "inpatient";
if (code == EncounterClass.OUTPATIENT)
@ -1443,7 +1451,7 @@ public class Encounter extends DomainResource {
*/
public Encounter setStatus(EncounterState value) {
if (this.status == null)
this.status = new Enumeration<EncounterState>();
this.status = new Enumeration<EncounterState>(EncounterState.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -1488,7 +1496,7 @@ public class Encounter extends DomainResource {
*/
public Encounter setClass_(EncounterClass value) {
if (this.class_ == null)
this.class_ = new Enumeration<EncounterClass>();
this.class_ = new Enumeration<EncounterClass>(EncounterClass.ENUM_FACTORY);
this.class_.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -41,8 +41,8 @@ import org.hl7.fhir.instance.model.annotations.Description;
/**
* This resource provides the insurance Enrollment details to the insurer regarding a specified coverage.
*/
@ResourceDef(name="Enrollment", profile="http://hl7.org/fhir/Profile/Enrollment")
public class Enrollment extends DomainResource {
@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest")
public class EnrollmentRequest extends DomainResource {
/**
* The Response Business Identifier.
@ -68,9 +68,9 @@ public class Enrollment extends DomainResource {
/**
* The date when this resource was created.
*/
@Child(name="date", type={DateType.class}, order=2, min=0, max=1)
@Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." )
protected DateType date;
protected DateTimeType created;
/**
* The Insurer who is target of the request.
@ -139,13 +139,13 @@ public class Enrollment extends DomainResource {
@Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." )
protected Coding relationship;
private static final long serialVersionUID = -321200192L;
private static final long serialVersionUID = -1656505325L;
public Enrollment() {
public EnrollmentRequest() {
super();
}
public Enrollment(Reference subject, Reference coverage, Coding relationship) {
public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) {
super();
this.subject = subject;
this.coverage = coverage;
@ -188,7 +188,7 @@ public class Enrollment extends DomainResource {
public Coding getRuleset() {
if (this.ruleset == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.ruleset");
throw new Error("Attempt to auto-create EnrollmentRequest.ruleset");
else if (Configuration.doAutoCreate())
this.ruleset = new Coding();
return this.ruleset;
@ -201,7 +201,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
*/
public Enrollment setRuleset(Coding value) {
public EnrollmentRequest setRuleset(Coding value) {
this.ruleset = value;
return this;
}
@ -212,7 +212,7 @@ public class Enrollment extends DomainResource {
public Coding getOriginalRuleset() {
if (this.originalRuleset == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.originalRuleset");
throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset");
else if (Configuration.doAutoCreate())
this.originalRuleset = new Coding();
return this.originalRuleset;
@ -225,56 +225,56 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
*/
public Enrollment setOriginalRuleset(Coding value) {
public EnrollmentRequest setOriginalRuleset(Coding value) {
this.originalRuleset = value;
return this;
}
/**
* @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateType getDateElement() {
if (this.date == null)
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.date");
throw new Error("Attempt to auto-create EnrollmentRequest.created");
else if (Configuration.doAutoCreate())
this.date = new DateType();
return this.date;
this.created = new DateTimeType();
return this.created;
}
public boolean hasDateElement() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasDate() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public Enrollment setDateElement(DateType value) {
this.date = value;
public EnrollmentRequest setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when this resource was created.
*/
public DateAndTime getDate() {
return this.date == null ? null : this.date.getValue();
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when this resource was created.
*/
public Enrollment setDate(DateAndTime value) {
public EnrollmentRequest setCreated(Date value) {
if (value == null)
this.date = null;
this.created = null;
else {
if (this.date == null)
this.date = new DateType();
this.date.setValue(value);
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
@ -285,7 +285,7 @@ public class Enrollment extends DomainResource {
public Reference getTarget() {
if (this.target == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.target");
throw new Error("Attempt to auto-create EnrollmentRequest.target");
else if (Configuration.doAutoCreate())
this.target = new Reference();
return this.target;
@ -298,7 +298,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #target} (The Insurer who is target of the request.)
*/
public Enrollment setTarget(Reference value) {
public EnrollmentRequest setTarget(Reference value) {
this.target = value;
return this;
}
@ -309,7 +309,7 @@ public class Enrollment extends DomainResource {
public Organization getTargetTarget() {
if (this.targetTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.target");
throw new Error("Attempt to auto-create EnrollmentRequest.target");
else if (Configuration.doAutoCreate())
this.targetTarget = new Organization();
return this.targetTarget;
@ -318,7 +318,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.)
*/
public Enrollment setTargetTarget(Organization value) {
public EnrollmentRequest setTargetTarget(Organization value) {
this.targetTarget = value;
return this;
}
@ -329,7 +329,7 @@ public class Enrollment extends DomainResource {
public Reference getProvider() {
if (this.provider == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.provider");
throw new Error("Attempt to auto-create EnrollmentRequest.provider");
else if (Configuration.doAutoCreate())
this.provider = new Reference();
return this.provider;
@ -342,7 +342,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
*/
public Enrollment setProvider(Reference value) {
public EnrollmentRequest setProvider(Reference value) {
this.provider = value;
return this;
}
@ -353,7 +353,7 @@ public class Enrollment extends DomainResource {
public Practitioner getProviderTarget() {
if (this.providerTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.provider");
throw new Error("Attempt to auto-create EnrollmentRequest.provider");
else if (Configuration.doAutoCreate())
this.providerTarget = new Practitioner();
return this.providerTarget;
@ -362,7 +362,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
*/
public Enrollment setProviderTarget(Practitioner value) {
public EnrollmentRequest setProviderTarget(Practitioner value) {
this.providerTarget = value;
return this;
}
@ -373,7 +373,7 @@ public class Enrollment extends DomainResource {
public Reference getOrganization() {
if (this.organization == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.organization");
throw new Error("Attempt to auto-create EnrollmentRequest.organization");
else if (Configuration.doAutoCreate())
this.organization = new Reference();
return this.organization;
@ -386,7 +386,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.)
*/
public Enrollment setOrganization(Reference value) {
public EnrollmentRequest setOrganization(Reference value) {
this.organization = value;
return this;
}
@ -397,7 +397,7 @@ public class Enrollment extends DomainResource {
public Organization getOrganizationTarget() {
if (this.organizationTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.organization");
throw new Error("Attempt to auto-create EnrollmentRequest.organization");
else if (Configuration.doAutoCreate())
this.organizationTarget = new Organization();
return this.organizationTarget;
@ -406,7 +406,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
*/
public Enrollment setOrganizationTarget(Organization value) {
public EnrollmentRequest setOrganizationTarget(Organization value) {
this.organizationTarget = value;
return this;
}
@ -417,7 +417,7 @@ public class Enrollment extends DomainResource {
public Reference getSubject() {
if (this.subject == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.subject");
throw new Error("Attempt to auto-create EnrollmentRequest.subject");
else if (Configuration.doAutoCreate())
this.subject = new Reference();
return this.subject;
@ -430,7 +430,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #subject} (Patient Resource.)
*/
public Enrollment setSubject(Reference value) {
public EnrollmentRequest setSubject(Reference value) {
this.subject = value;
return this;
}
@ -441,7 +441,7 @@ public class Enrollment extends DomainResource {
public Patient getSubjectTarget() {
if (this.subjectTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.subject");
throw new Error("Attempt to auto-create EnrollmentRequest.subject");
else if (Configuration.doAutoCreate())
this.subjectTarget = new Patient();
return this.subjectTarget;
@ -450,7 +450,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.)
*/
public Enrollment setSubjectTarget(Patient value) {
public EnrollmentRequest setSubjectTarget(Patient value) {
this.subjectTarget = value;
return this;
}
@ -461,7 +461,7 @@ public class Enrollment extends DomainResource {
public Reference getCoverage() {
if (this.coverage == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.coverage");
throw new Error("Attempt to auto-create EnrollmentRequest.coverage");
else if (Configuration.doAutoCreate())
this.coverage = new Reference();
return this.coverage;
@ -474,7 +474,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
*/
public Enrollment setCoverage(Reference value) {
public EnrollmentRequest setCoverage(Reference value) {
this.coverage = value;
return this;
}
@ -485,7 +485,7 @@ public class Enrollment extends DomainResource {
public Coverage getCoverageTarget() {
if (this.coverageTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.coverage");
throw new Error("Attempt to auto-create EnrollmentRequest.coverage");
else if (Configuration.doAutoCreate())
this.coverageTarget = new Coverage();
return this.coverageTarget;
@ -494,7 +494,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.)
*/
public Enrollment setCoverageTarget(Coverage value) {
public EnrollmentRequest setCoverageTarget(Coverage value) {
this.coverageTarget = value;
return this;
}
@ -505,7 +505,7 @@ public class Enrollment extends DomainResource {
public Coding getRelationship() {
if (this.relationship == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Enrollment.relationship");
throw new Error("Attempt to auto-create EnrollmentRequest.relationship");
else if (Configuration.doAutoCreate())
this.relationship = new Coding();
return this.relationship;
@ -518,7 +518,7 @@ public class Enrollment extends DomainResource {
/**
* @param value {@link #relationship} (The relationship of the patient to the subscriber.)
*/
public Enrollment setRelationship(Coding value) {
public EnrollmentRequest setRelationship(Coding value) {
this.relationship = value;
return this;
}
@ -528,7 +528,7 @@ public class Enrollment extends DomainResource {
childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date));
childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target));
childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider));
childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization));
@ -537,8 +537,8 @@ public class Enrollment extends DomainResource {
childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship));
}
public Enrollment copy() {
Enrollment dst = new Enrollment();
public EnrollmentRequest copy() {
EnrollmentRequest dst = new EnrollmentRequest();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
@ -547,7 +547,7 @@ public class Enrollment extends DomainResource {
};
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.date = date == null ? null : date.copy();
dst.created = created == null ? null : created.copy();
dst.target = target == null ? null : target.copy();
dst.provider = provider == null ? null : provider.copy();
dst.organization = organization == null ? null : organization.copy();
@ -557,13 +557,13 @@ public class Enrollment extends DomainResource {
return dst;
}
protected Enrollment typedCopy() {
protected EnrollmentRequest typedCopy() {
return copy();
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty())
&& (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty())
&& (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty())
&& (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty())
&& (subject == null || subject.isEmpty()) && (coverage == null || coverage.isEmpty()) && (relationship == null || relationship.isEmpty())
;
@ -571,14 +571,14 @@ public class Enrollment extends DomainResource {
@Override
public ResourceType getResourceType() {
return ResourceType.Enrollment;
return ResourceType.EnrollmentRequest;
}
@SearchParamDefinition(name="patient", path="Enrollment.subject", description="The party to be enrolled", type="reference" )
@SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="subject", path="Enrollment.subject", description="The party to be enrolled", type="reference" )
@SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" )
public static final String SP_SUBJECT = "subject";
@SearchParamDefinition(name="identifier", path="Enrollment.identifier", description="The business identifier of the Enrollment", type="token" )
@SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" )
public static final String SP_IDENTIFIER = "identifier";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse")
public class EnrollmentResponse extends DomainResource {
public enum RSLink {
public enum RSLink implements FhirEnum {
/**
* The processing completed without errors.
*/
@ -58,15 +58,19 @@ public class EnrollmentResponse extends DomainResource {
* added to help the parsers
*/
NULL;
public static RSLink fromCode(String codeString) throws Exception {
public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory();
public static RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
return COMPLETE;
if ("error".equals(codeString))
return ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case COMPLETE: return "complete";
@ -97,8 +101,8 @@ public class EnrollmentResponse extends DomainResource {
}
}
public static class RSLinkEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class RSLinkEnumFactory implements EnumFactory<RSLink> {
public RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -106,9 +110,9 @@ public class EnrollmentResponse extends DomainResource {
return RSLink.COMPLETE;
if ("error".equals(codeString))
return RSLink.ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(RSLink code) throws IllegalArgumentException {
if (code == RSLink.COMPLETE)
return "complete";
if (code == RSLink.ERROR)
@ -127,14 +131,14 @@ public class EnrollmentResponse extends DomainResource {
/**
* Original request resource referrence.
*/
@Child(name="request", type={Enrollment.class}, order=0, min=0, max=1)
@Child(name="request", type={EnrollmentRequest.class}, order=0, min=0, max=1)
@Description(shortDefinition="Claim reference", formalDefinition="Original request resource referrence." )
protected Reference request;
/**
* The actual object that is the target of the reference (Original request resource referrence.)
*/
protected Enrollment requestTarget;
protected EnrollmentRequest requestTarget;
/**
* Transaction status: error, complete.
@ -167,9 +171,9 @@ public class EnrollmentResponse extends DomainResource {
/**
* The date when the enclosed suite of services were performed or completed.
*/
@Child(name="date", type={DateType.class}, order=5, min=0, max=1)
@Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
protected DateType date;
protected DateTimeType created;
/**
* The Insurer who produced this adjudicated response.
@ -207,7 +211,7 @@ public class EnrollmentResponse extends DomainResource {
*/
protected Organization requestOrganizationTarget;
private static final long serialVersionUID = -153876887L;
private static final long serialVersionUID = -318929031L;
public EnrollmentResponse() {
super();
@ -270,19 +274,19 @@ public class EnrollmentResponse extends DomainResource {
/**
* @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource referrence.)
*/
public Enrollment getRequestTarget() {
public EnrollmentRequest getRequestTarget() {
if (this.requestTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create EnrollmentResponse.request");
else if (Configuration.doAutoCreate())
this.requestTarget = new Enrollment();
this.requestTarget = new EnrollmentRequest();
return this.requestTarget;
}
/**
* @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource referrence.)
*/
public EnrollmentResponse setRequestTarget(Enrollment value) {
public EnrollmentResponse setRequestTarget(EnrollmentRequest value) {
this.requestTarget = value;
return this;
}
@ -330,7 +334,7 @@ public class EnrollmentResponse extends DomainResource {
this.outcome = null;
else {
if (this.outcome == null)
this.outcome = new Enumeration<RSLink>();
this.outcome = new Enumeration<RSLink>(RSLink.ENUM_FACTORY);
this.outcome.setValue(value);
}
return this;
@ -434,50 +438,50 @@ public class EnrollmentResponse extends DomainResource {
}
/**
* @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateType getDateElement() {
if (this.date == null)
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create EnrollmentResponse.date");
throw new Error("Attempt to auto-create EnrollmentResponse.created");
else if (Configuration.doAutoCreate())
this.date = new DateType();
return this.date;
this.created = new DateTimeType();
return this.created;
}
public boolean hasDateElement() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasDate() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public EnrollmentResponse setDateElement(DateType value) {
this.date = value;
public EnrollmentResponse setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when the enclosed suite of services were performed or completed.
*/
public DateAndTime getDate() {
return this.date == null ? null : this.date.getValue();
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when the enclosed suite of services were performed or completed.
*/
public EnrollmentResponse setDate(DateAndTime value) {
public EnrollmentResponse setCreated(Date value) {
if (value == null)
this.date = null;
this.created = null;
else {
if (this.date == null)
this.date = new DateType();
this.date.setValue(value);
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
@ -617,12 +621,12 @@ public class EnrollmentResponse extends DomainResource {
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("request", "Reference(Enrollment)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request));
childrenList.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request));
childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome));
childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition));
childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date));
childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization));
childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider));
childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization));
@ -641,7 +645,7 @@ public class EnrollmentResponse extends DomainResource {
dst.disposition = disposition == null ? null : disposition.copy();
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.date = date == null ? null : date.copy();
dst.created = created == null ? null : created.copy();
dst.organization = organization == null ? null : organization.copy();
dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
@ -656,8 +660,9 @@ public class EnrollmentResponse extends DomainResource {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty())
&& (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty())
&& (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty())
&& (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty())
&& (requestOrganization == null || requestOrganization.isEmpty());
&& (created == null || created.isEmpty()) && (organization == null || organization.isEmpty())
&& (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty())
;
}
@Override

View File

@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
/**
* Helper class to help manage generic enumerated types
*/
public interface EnumFactory {
public interface EnumFactory<T extends Enum<?>> {
/**
* Read an enumeration value from the string that represents it on the XML or JSON
@ -41,7 +41,7 @@ public interface EnumFactory {
* @return the enumeration value
* @throws Exception is the value is not known
*/
public Enum<?> fromCode(String codeString) throws Exception;
public T fromCode(String codeString) throws IllegalArgumentException;
/**
* Get the XML/JSON representation for an enumerated value
@ -49,6 +49,6 @@ public interface EnumFactory {
* @return the XML/JSON representation
* @throws Exception if the enumeration is not valid (would usually indicate a code generation bug)
*/
public String toCode(Enum<?> code) throws Exception;
public String toCode(T code) throws IllegalArgumentException;
}

View File

@ -35,72 +35,69 @@ POSSIBILITY OF SUCH DAMAGE.
*/
public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> {
private static final long serialVersionUID = 5502756236610771914L;
private static final long serialVersionUID = 1L;
private EnumFactory<T> myEnumFactory;
/**
* the actual value of the enumeration
* Constructor
*/
private T value;
public Enumeration() {
}
/**
* @param value the value of the enumeration
*/
public Enumeration(T value) {
this.value = value;
}
/**
* @return the value of the enumeration
*/
public T getValue() {
return value;
}
/**
* @param value the value of the enumeration
*/
public void setValue(T value) {
this.value = value;
}
@Override
protected T parse(String theValue) {
return null;
}
@Override
protected String encode(T theValue) {
return null;
}
@Override
public Enumeration<T> copy() {
Enumeration<T> dst = new Enumeration<T>();
dst.value = value;
return dst;
public Enumeration(T theValue) {
setValue(theValue);
}
@Override
public String asStringValue() {
EnumFactory factory = ResourceEnumerations.getEnumFactory(value.getClass());
if (factory != null)
try {
return factory.toCode(value);
} catch (Exception e) {
}
return value.toString();
}
public boolean isEmpty() {
return super.isEmpty() && (value == null || value.toString().equals("NULL"));
/**
* Constructor
*/
public Enumeration(String theValue) {
setValueAsString(theValue);
}
public boolean hasValue() {
return value != null & !value.toString().equals("NULL");
/**
* Constructor
*/
public Enumeration(EnumFactory<T> theEnumFactory, T theValue) {
myEnumFactory = theEnumFactory;
setValue(theValue);
}
/**
* Constructor
*/
public Enumeration(EnumFactory<T> theEnumFactory, String theValue) {
myEnumFactory = theEnumFactory;
setValueAsString(theValue);
}
/**
* Constructor
*/
public Enumeration(EnumFactory<T> theEnumFactory) {
myEnumFactory = theEnumFactory;
}
/**
* Constructor
*/
public Enumeration() {
// nothing
}
@Override
protected T parse(String theValue) {
if (myEnumFactory != null) {
return myEnumFactory.fromCode(theValue);
}
return null;
}
@Override
protected String encode(T theValue) {
return ((FhirEnum)theValue).toCode();
}
@Override
public Enumeration<T> copy() {
return new Enumeration<T>(myEnumFactory, getValue());
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit")
public class ExplanationOfBenefit extends DomainResource {
public enum RSLink {
public enum RSLink implements FhirEnum {
/**
* The processing completed without errors.
*/
@ -58,15 +58,19 @@ public class ExplanationOfBenefit extends DomainResource {
* added to help the parsers
*/
NULL;
public static RSLink fromCode(String codeString) throws Exception {
public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory();
public static RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
return COMPLETE;
if ("error".equals(codeString))
return ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case COMPLETE: return "complete";
@ -97,8 +101,8 @@ public class ExplanationOfBenefit extends DomainResource {
}
}
public static class RSLinkEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class RSLinkEnumFactory implements EnumFactory<RSLink> {
public RSLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -106,9 +110,9 @@ public class ExplanationOfBenefit extends DomainResource {
return RSLink.COMPLETE;
if ("error".equals(codeString))
return RSLink.ERROR;
throw new Exception("Unknown RSLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(RSLink code) throws IllegalArgumentException {
if (code == RSLink.COMPLETE)
return "complete";
if (code == RSLink.ERROR)
@ -167,9 +171,9 @@ public class ExplanationOfBenefit extends DomainResource {
/**
* The date when the enclosed suite of services were performed or completed.
*/
@Child(name="date", type={DateType.class}, order=5, min=0, max=1)
@Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
protected DateType date;
protected DateTimeType created;
/**
* The Insurer who produced this adjudicated response.
@ -207,7 +211,7 @@ public class ExplanationOfBenefit extends DomainResource {
*/
protected Organization requestOrganizationTarget;
private static final long serialVersionUID = -1007936689L;
private static final long serialVersionUID = 1627363360L;
public ExplanationOfBenefit() {
super();
@ -330,7 +334,7 @@ public class ExplanationOfBenefit extends DomainResource {
this.outcome = null;
else {
if (this.outcome == null)
this.outcome = new Enumeration<RSLink>();
this.outcome = new Enumeration<RSLink>(RSLink.ENUM_FACTORY);
this.outcome.setValue(value);
}
return this;
@ -434,50 +438,50 @@ public class ExplanationOfBenefit extends DomainResource {
}
/**
* @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateType getDateElement() {
if (this.date == null)
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ExplanationOfBenefit.date");
throw new Error("Attempt to auto-create ExplanationOfBenefit.created");
else if (Configuration.doAutoCreate())
this.date = new DateType();
return this.date;
this.created = new DateTimeType();
return this.created;
}
public boolean hasDateElement() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasDate() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public ExplanationOfBenefit setDateElement(DateType value) {
this.date = value;
public ExplanationOfBenefit setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when the enclosed suite of services were performed or completed.
*/
public DateAndTime getDate() {
return this.date == null ? null : this.date.getValue();
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when the enclosed suite of services were performed or completed.
*/
public ExplanationOfBenefit setDate(DateAndTime value) {
public ExplanationOfBenefit setCreated(Date value) {
if (value == null)
this.date = null;
this.created = null;
else {
if (this.date == null)
this.date = new DateType();
this.date.setValue(value);
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
@ -622,7 +626,7 @@ public class ExplanationOfBenefit extends DomainResource {
childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition));
childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date));
childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization));
childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider));
childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization));
@ -641,7 +645,7 @@ public class ExplanationOfBenefit extends DomainResource {
dst.disposition = disposition == null ? null : disposition.copy();
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.date = date == null ? null : date.copy();
dst.created = created == null ? null : created.copy();
dst.organization = organization == null ? null : organization.copy();
dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
@ -656,8 +660,9 @@ public class ExplanationOfBenefit extends DomainResource {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty())
&& (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty())
&& (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty())
&& (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty())
&& (requestOrganization == null || requestOrganization.isEmpty());
&& (created == null || created.isEmpty()) && (organization == null || organization.isEmpty())
&& (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty())
;
}
@Override

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="ExtensionDefinition", profile="http://hl7.org/fhir/Profile/ExtensionDefinition")
public class ExtensionDefinition extends DomainResource {
public enum ResourceProfileStatus {
public enum ResourceProfileStatus implements FhirEnum {
/**
* This profile is still under development.
*/
@ -62,7 +62,10 @@ public class ExtensionDefinition extends DomainResource {
* added to help the parsers
*/
NULL;
public static ResourceProfileStatus fromCode(String codeString) throws Exception {
public static final ResourceProfileStatusEnumFactory ENUM_FACTORY = new ResourceProfileStatusEnumFactory();
public static ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("draft".equals(codeString))
@ -71,8 +74,9 @@ public class ExtensionDefinition extends DomainResource {
return ACTIVE;
if ("retired".equals(codeString))
return RETIRED;
throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case DRAFT: return "draft";
@ -107,8 +111,8 @@ public class ExtensionDefinition extends DomainResource {
}
}
public static class ResourceProfileStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ResourceProfileStatusEnumFactory implements EnumFactory<ResourceProfileStatus> {
public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class ExtensionDefinition extends DomainResource {
return ResourceProfileStatus.ACTIVE;
if ("retired".equals(codeString))
return ResourceProfileStatus.RETIRED;
throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ResourceProfileStatus code) throws IllegalArgumentException {
if (code == ResourceProfileStatus.DRAFT)
return "draft";
if (code == ResourceProfileStatus.ACTIVE)
@ -131,7 +135,7 @@ public class ExtensionDefinition extends DomainResource {
}
}
public enum ExtensionContext {
public enum ExtensionContext implements FhirEnum {
/**
* The context is all elements matching a particular resource element path.
*/
@ -152,7 +156,10 @@ public class ExtensionDefinition extends DomainResource {
* added to help the parsers
*/
NULL;
public static ExtensionContext fromCode(String codeString) throws Exception {
public static final ExtensionContextEnumFactory ENUM_FACTORY = new ExtensionContextEnumFactory();
public static ExtensionContext fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("resource".equals(codeString))
@ -163,8 +170,9 @@ public class ExtensionDefinition extends DomainResource {
return MAPPING;
if ("extension".equals(codeString))
return EXTENSION;
throw new Exception("Unknown ExtensionContext code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case RESOURCE: return "resource";
@ -203,8 +211,8 @@ public class ExtensionDefinition extends DomainResource {
}
}
public static class ExtensionContextEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ExtensionContextEnumFactory implements EnumFactory<ExtensionContext> {
public ExtensionContext fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -216,9 +224,9 @@ public class ExtensionDefinition extends DomainResource {
return ExtensionContext.MAPPING;
if ("extension".equals(codeString))
return ExtensionContext.EXTENSION;
throw new Exception("Unknown ExtensionContext code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ExtensionContext code) throws IllegalArgumentException {
if (code == ExtensionContext.RESOURCE)
return "resource";
if (code == ExtensionContext.DATATYPE)
@ -982,7 +990,7 @@ public class ExtensionDefinition extends DomainResource {
*/
public ExtensionDefinition setStatus(ResourceProfileStatus value) {
if (this.status == null)
this.status = new Enumeration<ResourceProfileStatus>();
this.status = new Enumeration<ResourceProfileStatus>(ResourceProfileStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -1067,14 +1075,14 @@ public class ExtensionDefinition extends DomainResource {
/**
* @return The date that this version of the extension was published.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date that this version of the extension was published.
*/
public ExtensionDefinition setDate(DateAndTime value) {
public ExtensionDefinition setDate(Date value) {
if (value == null)
this.date = null;
else {
@ -1204,7 +1212,7 @@ public class ExtensionDefinition extends DomainResource {
*/
public ExtensionDefinition setContextType(ExtensionContext value) {
if (this.contextType == null)
this.contextType = new Enumeration<ExtensionContext>();
this.contextType = new Enumeration<ExtensionContext>(ExtensionContext.ENUM_FACTORY);
this.contextType.setValue(value);
return this;
}

View File

@ -1,175 +0,0 @@
package org.hl7.fhir.instance.model;
import java.net.URISyntaxException;
import java.text.ParseException;
import org.hl7.fhir.instance.model.ContactPoint.ContactPointSystem;
/*
Copyright (c) 2011+, HL7, Inc
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
public class Factory {
public static IdType newId(String value) {
if (value == null)
return null;
IdType res = new IdType();
res.setValue(value);
return res;
}
public static StringType newString_(String value) {
if (value == null)
return null;
StringType res = new StringType();
res.setValue(value);
return res;
}
public static UriType newUri(String value) throws URISyntaxException {
if (value == null)
return null;
UriType res = new UriType();
res.setValue(value);
return res;
}
public static DateTimeType newDateTime(String value) throws ParseException {
if (value == null)
return null;
DateTimeType res = new DateTimeType();
res.setValue(new DateAndTime(value));
return res;
}
public static DateType newDate(String value) throws ParseException {
if (value == null)
return null;
DateType res = new DateType();
res.setValue(new DateAndTime(value));
return res;
}
public static CodeType newCode(String value) {
if (value == null)
return null;
CodeType res = new CodeType();
res.setValue(value);
return res;
}
public static IntegerType newInteger(int value) {
IntegerType res = new IntegerType();
res.setValue(value);
return res;
}
public static IntegerType newInteger(java.lang.Integer value) {
if (value == null)
return null;
IntegerType res = new IntegerType();
res.setValue(value);
return res;
}
public static BooleanType newBoolean(boolean value) {
BooleanType res = new BooleanType();
res.setValue(value);
return res;
}
public static ContactPoint newContactPoint(ContactPointSystem system, String value) {
ContactPoint res = new ContactPoint();
res.setSystem(system);
res.setValue(value);
return res;
}
public static Extension newExtension(String uri, Type value, boolean evenIfNull) throws Exception {
if (!evenIfNull && value == null)
return null;
Extension e = new Extension();
e.setUrl(uri);
e.setValue(value);
return e;
}
public static CodeableConcept newCodeableConcept(String code, String system, String display) throws Exception {
CodeableConcept cc = new CodeableConcept();
Coding c = new Coding();
c.setCode(code);
c.setSystem(system);
c.setDisplay(display);
cc.getCoding().add(c);
return cc;
}
public static Reference makeReference(String url) throws Exception {
Reference rr = new Reference();
rr.setReference(url);
return rr;
}
public static DateTimeType nowDateTime() {
DateTimeType dt = new DateTimeType();
dt.setValue(DateAndTime.now());
return dt;
}
// public static Narrative newNarrative(NarrativeStatus status, String html) throws Exception {
// Narrative n = new Narrative();
// n.setStatus(status);
// n.setDiv(new XhtmlParser().parseFragment("<div>"+Utilities.escapeXml(html)+"</div>"));
// return n;
// }
public InstantType nowInstant() {
InstantType instant = new InstantType();
instant.setValue(DateAndTime.now());
return instant;
}
public static Coding makeCoding(String code) throws Exception {
String[] parts = code.split("\\|");
Coding c = new Coding();
if (parts.length == 2) {
c.setSystem(parts[0]);
c.setCode(parts[1]);
} else if (parts.length == 3) {
c.setSystem(parts[0]);
c.setCode(parts[1]);
c.setDisplay(parts[2]);
} else
throw new Exception("Unable to understand the code '"+code+"'. Use the format system|code(|display)");
return c;
}
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -816,14 +816,14 @@ public class FamilyHistory extends DomainResource {
/**
* @return The date (and possibly time) when the family history was taken.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date (and possibly time) when the family history was taken.
*/
public FamilyHistory setDate(DateAndTime value) {
public FamilyHistory setDate(Date value) {
if (value == null)
this.date = null;
else {

View File

@ -0,0 +1,47 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Interface to be implemented by all built-in FHIR enumerations (i.e. the
* actual FHIR-defined Java Enum will implement this interface)
*/
public interface FhirEnum {
/**
* Get the XML/JSON representation for an enumerated value
* @param code - the enumeration value
* @return the XML/JSON representation
* @throws Exception if the enumeration is not valid (would usually indicate a code generation bug)
*/
public String toCode();
}

View File

@ -0,0 +1,532 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
/**
* Describes the intended objective(s) of carrying out the Care Plan.
*/
@ResourceDef(name="Goal", profile="http://hl7.org/fhir/Profile/Goal")
public class Goal extends DomainResource {
public enum GoalStatus implements FhirEnum {
/**
* The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again).
*/
INPROGRESS,
/**
* The goal has been met and no further action is needed.
*/
ACHIEVED,
/**
* The goal has been met, but ongoing activity is needed to sustain the goal objective.
*/
SUSTAINING,
/**
* The goal is no longer being sought.
*/
CANCELLED,
/**
* added to help the parsers
*/
NULL;
public static final GoalStatusEnumFactory ENUM_FACTORY = new GoalStatusEnumFactory();
public static GoalStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
return INPROGRESS;
if ("achieved".equals(codeString))
return ACHIEVED;
if ("sustaining".equals(codeString))
return SUSTAINING;
if ("cancelled".equals(codeString))
return CANCELLED;
throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INPROGRESS: return "in progress";
case ACHIEVED: return "achieved";
case SUSTAINING: return "sustaining";
case CANCELLED: return "cancelled";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case INPROGRESS: return "";
case ACHIEVED: return "";
case SUSTAINING: return "";
case CANCELLED: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again).";
case ACHIEVED: return "The goal has been met and no further action is needed.";
case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective.";
case CANCELLED: return "The goal is no longer being sought.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case INPROGRESS: return "in progress";
case ACHIEVED: return "achieved";
case SUSTAINING: return "sustaining";
case CANCELLED: return "cancelled";
default: return "?";
}
}
}
public static class GoalStatusEnumFactory implements EnumFactory<GoalStatus> {
public GoalStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
return GoalStatus.INPROGRESS;
if ("achieved".equals(codeString))
return GoalStatus.ACHIEVED;
if ("sustaining".equals(codeString))
return GoalStatus.SUSTAINING;
if ("cancelled".equals(codeString))
return GoalStatus.CANCELLED;
throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'");
}
public String toCode(GoalStatus code) throws IllegalArgumentException {
if (code == GoalStatus.INPROGRESS)
return "in progress";
if (code == GoalStatus.ACHIEVED)
return "achieved";
if (code == GoalStatus.SUSTAINING)
return "sustaining";
if (code == GoalStatus.CANCELLED)
return "cancelled";
return "?";
}
}
/**
* This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
*/
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
protected List<Identifier> identifier;
/**
* Identifies the patient/subject whose intended care is described by the plan.
*/
@Child(name="patient", type={Patient.class}, order=0, min=0, max=1)
@Description(shortDefinition="The patient for whom this goal is intended for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." )
protected Reference patient;
/**
* The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.)
*/
protected Patient patientTarget;
/**
* Human-readable description of a specific desired objective of the care plan.
*/
@Child(name="description", type={StringType.class}, order=1, min=1, max=1)
@Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of the care plan." )
protected StringType description;
/**
* Indicates whether the goal has been reached and is still considered relevant.
*/
@Child(name="status", type={CodeType.class}, order=2, min=0, max=1)
@Description(shortDefinition="in progress | achieved | sustaining | cancelled", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." )
protected Enumeration<GoalStatus> status;
/**
* Any comments related to the goal.
*/
@Child(name="notes", type={StringType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." )
protected StringType notes;
/**
* The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.
*/
@Child(name="concern", type={Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Health issues this goal addresses", formalDefinition="The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address." )
protected List<Reference> concern;
/**
* The actual objects that are the target of the reference (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
protected List<Condition> concernTarget;
private static final long serialVersionUID = -73791119L;
public Goal() {
super();
}
public Goal(StringType description) {
super();
this.description = description;
}
/**
* @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
public List<Identifier> getIdentifier() {
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
return this.identifier;
}
public boolean hasIdentifier() {
if (this.identifier == null)
return false;
for (Identifier item : this.identifier)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
// syntactic sugar
public Identifier addIdentifier() { //3
Identifier t = new Identifier();
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return t;
}
/**
* @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Reference getPatient() {
if (this.patient == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Goal.patient");
else if (Configuration.doAutoCreate())
this.patient = new Reference();
return this.patient;
}
public boolean hasPatient() {
return this.patient != null && !this.patient.isEmpty();
}
/**
* @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Goal setPatient(Reference value) {
this.patient = value;
return this;
}
/**
* @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Patient getPatientTarget() {
if (this.patientTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Goal.patient");
else if (Configuration.doAutoCreate())
this.patientTarget = new Patient();
return this.patientTarget;
}
/**
* @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Goal setPatientTarget(Patient value) {
this.patientTarget = value;
return this;
}
/**
* @return {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
*/
public StringType getDescriptionElement() {
if (this.description == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Goal.description");
else if (Configuration.doAutoCreate())
this.description = new StringType();
return this.description;
}
public boolean hasDescriptionElement() {
return this.description != null && !this.description.isEmpty();
}
public boolean hasDescription() {
return this.description != null && !this.description.isEmpty();
}
/**
* @param value {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
*/
public Goal setDescriptionElement(StringType value) {
this.description = value;
return this;
}
/**
* @return Human-readable description of a specific desired objective of the care plan.
*/
public String getDescription() {
return this.description == null ? null : this.description.getValue();
}
/**
* @param value Human-readable description of a specific desired objective of the care plan.
*/
public Goal setDescription(String value) {
if (this.description == null)
this.description = new StringType();
this.description.setValue(value);
return this;
}
/**
* @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Enumeration<GoalStatus> getStatusElement() {
if (this.status == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Goal.status");
else if (Configuration.doAutoCreate())
this.status = new Enumeration<GoalStatus>();
return this.status;
}
public boolean hasStatusElement() {
return this.status != null && !this.status.isEmpty();
}
public boolean hasStatus() {
return this.status != null && !this.status.isEmpty();
}
/**
* @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Goal setStatusElement(Enumeration<GoalStatus> value) {
this.status = value;
return this;
}
/**
* @return Indicates whether the goal has been reached and is still considered relevant.
*/
public GoalStatus getStatus() {
return this.status == null ? null : this.status.getValue();
}
/**
* @param value Indicates whether the goal has been reached and is still considered relevant.
*/
public Goal setStatus(GoalStatus value) {
if (value == null)
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<GoalStatus>(GoalStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
}
/**
* @return {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
*/
public StringType getNotesElement() {
if (this.notes == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Goal.notes");
else if (Configuration.doAutoCreate())
this.notes = new StringType();
return this.notes;
}
public boolean hasNotesElement() {
return this.notes != null && !this.notes.isEmpty();
}
public boolean hasNotes() {
return this.notes != null && !this.notes.isEmpty();
}
/**
* @param value {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
*/
public Goal setNotesElement(StringType value) {
this.notes = value;
return this;
}
/**
* @return Any comments related to the goal.
*/
public String getNotes() {
return this.notes == null ? null : this.notes.getValue();
}
/**
* @param value Any comments related to the goal.
*/
public Goal setNotes(String value) {
if (Utilities.noString(value))
this.notes = null;
else {
if (this.notes == null)
this.notes = new StringType();
this.notes.setValue(value);
}
return this;
}
/**
* @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
public List<Reference> getConcern() {
if (this.concern == null)
this.concern = new ArrayList<Reference>();
return this.concern;
}
public boolean hasConcern() {
if (this.concern == null)
return false;
for (Reference item : this.concern)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
// syntactic sugar
public Reference addConcern() { //3
Reference t = new Reference();
if (this.concern == null)
this.concern = new ArrayList<Reference>();
this.concern.add(t);
return t;
}
/**
* @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
public List<Condition> getConcernTarget() {
if (this.concernTarget == null)
this.concernTarget = new ArrayList<Condition>();
return this.concernTarget;
}
// syntactic sugar
/**
* @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
public Condition addConcernTarget() {
Condition r = new Condition();
if (this.concernTarget == null)
this.concernTarget = new ArrayList<Condition>();
this.concernTarget.add(r);
return r;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient));
childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of the care plan.", 0, java.lang.Integer.MAX_VALUE, description));
childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status));
childrenList.add(new Property("notes", "string", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, notes));
childrenList.add(new Property("concern", "Reference(Condition)", "The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.", 0, java.lang.Integer.MAX_VALUE, concern));
}
public Goal copy() {
Goal dst = new Goal();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
for (Identifier i : identifier)
dst.identifier.add(i.copy());
};
dst.patient = patient == null ? null : patient.copy();
dst.description = description == null ? null : description.copy();
dst.status = status == null ? null : status.copy();
dst.notes = notes == null ? null : notes.copy();
if (concern != null) {
dst.concern = new ArrayList<Reference>();
for (Reference i : concern)
dst.concern.add(i.copy());
};
return dst;
}
protected Goal typedCopy() {
return copy();
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty())
&& (description == null || description.isEmpty()) && (status == null || status.isEmpty())
&& (notes == null || notes.isEmpty()) && (concern == null || concern.isEmpty());
}
@Override
public ResourceType getResourceType() {
return ResourceType.Goal;
}
@SearchParamDefinition(name="patient", path="Goal.patient", description="The patient for whom this goal is intended for", type="reference" )
public static final String SP_PATIENT = "patient";
}

View File

@ -0,0 +1,681 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
/**
* Describes the intended objective(s) of carrying out the Care Plan.
*/
@ResourceDef(name="GoalRequest", profile="http://hl7.org/fhir/Profile/GoalRequest")
public class GoalRequest extends DomainResource {
public enum GoalRequestStatus implements FhirEnum {
/**
* The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again).
*/
INPROGRESS,
/**
* The goal has been met and no further action is needed.
*/
ACHIEVED,
/**
* The goal has been met, but ongoing activity is needed to sustain the goal objective.
*/
SUSTAINING,
/**
* The goal is no longer being sought.
*/
CANCELLED,
/**
* added to help the parsers
*/
NULL;
public static final GoalRequestStatusEnumFactory ENUM_FACTORY = new GoalRequestStatusEnumFactory();
public static GoalRequestStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
return INPROGRESS;
if ("achieved".equals(codeString))
return ACHIEVED;
if ("sustaining".equals(codeString))
return SUSTAINING;
if ("cancelled".equals(codeString))
return CANCELLED;
throw new IllegalArgumentException("Unknown GoalRequestStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INPROGRESS: return "in progress";
case ACHIEVED: return "achieved";
case SUSTAINING: return "sustaining";
case CANCELLED: return "cancelled";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case INPROGRESS: return "";
case ACHIEVED: return "";
case SUSTAINING: return "";
case CANCELLED: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again).";
case ACHIEVED: return "The goal has been met and no further action is needed.";
case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective.";
case CANCELLED: return "The goal is no longer being sought.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case INPROGRESS: return "in progress";
case ACHIEVED: return "achieved";
case SUSTAINING: return "sustaining";
case CANCELLED: return "cancelled";
default: return "?";
}
}
}
public static class GoalRequestStatusEnumFactory implements EnumFactory<GoalRequestStatus> {
public GoalRequestStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
return GoalRequestStatus.INPROGRESS;
if ("achieved".equals(codeString))
return GoalRequestStatus.ACHIEVED;
if ("sustaining".equals(codeString))
return GoalRequestStatus.SUSTAINING;
if ("cancelled".equals(codeString))
return GoalRequestStatus.CANCELLED;
throw new IllegalArgumentException("Unknown GoalRequestStatus code '"+codeString+"'");
}
public String toCode(GoalRequestStatus code) throws IllegalArgumentException {
if (code == GoalRequestStatus.INPROGRESS)
return "in progress";
if (code == GoalRequestStatus.ACHIEVED)
return "achieved";
if (code == GoalRequestStatus.SUSTAINING)
return "sustaining";
if (code == GoalRequestStatus.CANCELLED)
return "cancelled";
return "?";
}
}
public enum GoalRequestMode implements FhirEnum {
/**
* planned.
*/
PLANNED,
/**
* proposed.
*/
PROPOSED,
/**
* ordered.
*/
ORDERED,
/**
* added to help the parsers
*/
NULL;
public static final GoalRequestModeEnumFactory ENUM_FACTORY = new GoalRequestModeEnumFactory();
public static GoalRequestMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
return PLANNED;
if ("proposed".equals(codeString))
return PROPOSED;
if ("ordered".equals(codeString))
return ORDERED;
throw new IllegalArgumentException("Unknown GoalRequestMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PLANNED: return "planned";
case PROPOSED: return "proposed";
case ORDERED: return "ordered";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case PLANNED: return "";
case PROPOSED: return "";
case ORDERED: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case PLANNED: return "planned.";
case PROPOSED: return "proposed.";
case ORDERED: return "ordered.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case PLANNED: return "planned";
case PROPOSED: return "proposed";
case ORDERED: return "ordered";
default: return "?";
}
}
}
public static class GoalRequestModeEnumFactory implements EnumFactory<GoalRequestMode> {
public GoalRequestMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("planned".equals(codeString))
return GoalRequestMode.PLANNED;
if ("proposed".equals(codeString))
return GoalRequestMode.PROPOSED;
if ("ordered".equals(codeString))
return GoalRequestMode.ORDERED;
throw new IllegalArgumentException("Unknown GoalRequestMode code '"+codeString+"'");
}
public String toCode(GoalRequestMode code) throws IllegalArgumentException {
if (code == GoalRequestMode.PLANNED)
return "planned";
if (code == GoalRequestMode.PROPOSED)
return "proposed";
if (code == GoalRequestMode.ORDERED)
return "ordered";
return "?";
}
}
/**
* This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
*/
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
protected List<Identifier> identifier;
/**
* Identifies the patient/subject whose intended care is described by the plan.
*/
@Child(name="patient", type={Patient.class}, order=0, min=0, max=1)
@Description(shortDefinition="The patient for whom this goal is intended for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." )
protected Reference patient;
/**
* The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.)
*/
protected Patient patientTarget;
/**
* Human-readable description of a specific desired objective of the care plan.
*/
@Child(name="description", type={StringType.class}, order=1, min=1, max=1)
@Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of the care plan." )
protected StringType description;
/**
* Indicates whether the goal has been reached and is still considered relevant.
*/
@Child(name="status", type={CodeType.class}, order=2, min=0, max=1)
@Description(shortDefinition="in progress | achieved | sustaining | cancelled", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." )
protected Enumeration<GoalRequestStatus> status;
/**
* Any comments related to the goal.
*/
@Child(name="notes", type={StringType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." )
protected StringType notes;
/**
* The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.
*/
@Child(name="concern", type={Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Health issues this goal addresses", formalDefinition="The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address." )
protected List<Reference> concern;
/**
* The actual objects that are the target of the reference (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
protected List<Condition> concernTarget;
/**
* The status of the order.
*/
@Child(name="mode", type={CodeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="planned | proposed | ordered", formalDefinition="The status of the order." )
protected Enumeration<GoalRequestMode> mode;
private static final long serialVersionUID = 1698507147L;
public GoalRequest() {
super();
}
public GoalRequest(StringType description) {
super();
this.description = description;
}
/**
* @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
public List<Identifier> getIdentifier() {
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
return this.identifier;
}
public boolean hasIdentifier() {
if (this.identifier == null)
return false;
for (Identifier item : this.identifier)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
*/
// syntactic sugar
public Identifier addIdentifier() { //3
Identifier t = new Identifier();
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return t;
}
/**
* @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Reference getPatient() {
if (this.patient == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create GoalRequest.patient");
else if (Configuration.doAutoCreate())
this.patient = new Reference();
return this.patient;
}
public boolean hasPatient() {
return this.patient != null && !this.patient.isEmpty();
}
/**
* @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.)
*/
public GoalRequest setPatient(Reference value) {
this.patient = value;
return this;
}
/**
* @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.)
*/
public Patient getPatientTarget() {
if (this.patientTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create GoalRequest.patient");
else if (Configuration.doAutoCreate())
this.patientTarget = new Patient();
return this.patientTarget;
}
/**
* @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.)
*/
public GoalRequest setPatientTarget(Patient value) {
this.patientTarget = value;
return this;
}
/**
* @return {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
*/
public StringType getDescriptionElement() {
if (this.description == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create GoalRequest.description");
else if (Configuration.doAutoCreate())
this.description = new StringType();
return this.description;
}
public boolean hasDescriptionElement() {
return this.description != null && !this.description.isEmpty();
}
public boolean hasDescription() {
return this.description != null && !this.description.isEmpty();
}
/**
* @param value {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
*/
public GoalRequest setDescriptionElement(StringType value) {
this.description = value;
return this;
}
/**
* @return Human-readable description of a specific desired objective of the care plan.
*/
public String getDescription() {
return this.description == null ? null : this.description.getValue();
}
/**
* @param value Human-readable description of a specific desired objective of the care plan.
*/
public GoalRequest setDescription(String value) {
if (this.description == null)
this.description = new StringType();
this.description.setValue(value);
return this;
}
/**
* @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Enumeration<GoalRequestStatus> getStatusElement() {
if (this.status == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create GoalRequest.status");
else if (Configuration.doAutoCreate())
this.status = new Enumeration<GoalRequestStatus>();
return this.status;
}
public boolean hasStatusElement() {
return this.status != null && !this.status.isEmpty();
}
public boolean hasStatus() {
return this.status != null && !this.status.isEmpty();
}
/**
* @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public GoalRequest setStatusElement(Enumeration<GoalRequestStatus> value) {
this.status = value;
return this;
}
/**
* @return Indicates whether the goal has been reached and is still considered relevant.
*/
public GoalRequestStatus getStatus() {
return this.status == null ? null : this.status.getValue();
}
/**
* @param value Indicates whether the goal has been reached and is still considered relevant.
*/
public GoalRequest setStatus(GoalRequestStatus value) {
if (value == null)
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<GoalRequestStatus>(GoalRequestStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
}
/**
* @return {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
*/
public StringType getNotesElement() {
if (this.notes == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create GoalRequest.notes");
else if (Configuration.doAutoCreate())
this.notes = new StringType();
return this.notes;
}
public boolean hasNotesElement() {
return this.notes != null && !this.notes.isEmpty();
}
public boolean hasNotes() {
return this.notes != null && !this.notes.isEmpty();
}
/**
* @param value {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
*/
public GoalRequest setNotesElement(StringType value) {
this.notes = value;
return this;
}
/**
* @return Any comments related to the goal.
*/
public String getNotes() {
return this.notes == null ? null : this.notes.getValue();
}
/**
* @param value Any comments related to the goal.
*/
public GoalRequest setNotes(String value) {
if (Utilities.noString(value))
this.notes = null;
else {
if (this.notes == null)
this.notes = new StringType();
this.notes.setValue(value);
}
return this;
}
/**
* @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
public List<Reference> getConcern() {
if (this.concern == null)
this.concern = new ArrayList<Reference>();
return this.concern;
}
public boolean hasConcern() {
if (this.concern == null)
return false;
for (Reference item : this.concern)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
// syntactic sugar
public Reference addConcern() { //3
Reference t = new Reference();
if (this.concern == null)
this.concern = new ArrayList<Reference>();
this.concern.add(t);
return t;
}
/**
* @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
public List<Condition> getConcernTarget() {
if (this.concernTarget == null)
this.concernTarget = new ArrayList<Condition>();
return this.concernTarget;
}
// syntactic sugar
/**
* @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.)
*/
public Condition addConcernTarget() {
Condition r = new Condition();
if (this.concernTarget == null)
this.concernTarget = new ArrayList<Condition>();
this.concernTarget.add(r);
return r;
}
/**
* @return {@link #mode} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
*/
public Enumeration<GoalRequestMode> getModeElement() {
if (this.mode == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create GoalRequest.mode");
else if (Configuration.doAutoCreate())
this.mode = new Enumeration<GoalRequestMode>();
return this.mode;
}
public boolean hasModeElement() {
return this.mode != null && !this.mode.isEmpty();
}
public boolean hasMode() {
return this.mode != null && !this.mode.isEmpty();
}
/**
* @param value {@link #mode} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
*/
public GoalRequest setModeElement(Enumeration<GoalRequestMode> value) {
this.mode = value;
return this;
}
/**
* @return The status of the order.
*/
public GoalRequestMode getMode() {
return this.mode == null ? null : this.mode.getValue();
}
/**
* @param value The status of the order.
*/
public GoalRequest setMode(GoalRequestMode value) {
if (value == null)
this.mode = null;
else {
if (this.mode == null)
this.mode = new Enumeration<GoalRequestMode>(GoalRequestMode.ENUM_FACTORY);
this.mode.setValue(value);
}
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient));
childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of the care plan.", 0, java.lang.Integer.MAX_VALUE, description));
childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status));
childrenList.add(new Property("notes", "string", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, notes));
childrenList.add(new Property("concern", "Reference(Condition)", "The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.", 0, java.lang.Integer.MAX_VALUE, concern));
childrenList.add(new Property("mode", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, mode));
}
public GoalRequest copy() {
GoalRequest dst = new GoalRequest();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
for (Identifier i : identifier)
dst.identifier.add(i.copy());
};
dst.patient = patient == null ? null : patient.copy();
dst.description = description == null ? null : description.copy();
dst.status = status == null ? null : status.copy();
dst.notes = notes == null ? null : notes.copy();
if (concern != null) {
dst.concern = new ArrayList<Reference>();
for (Reference i : concern)
dst.concern.add(i.copy());
};
dst.mode = mode == null ? null : mode.copy();
return dst;
}
protected GoalRequest typedCopy() {
return copy();
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty())
&& (description == null || description.isEmpty()) && (status == null || status.isEmpty())
&& (notes == null || notes.isEmpty()) && (concern == null || concern.isEmpty()) && (mode == null || mode.isEmpty())
;
}
@Override
public ResourceType getResourceType() {
return ResourceType.GoalRequest;
}
@SearchParamDefinition(name="patient", path="GoalRequest.patient", description="The patient for whom this goal is intended for", type="reference" )
public static final String SP_PATIENT = "patient";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group")
public class Group extends DomainResource {
public enum GroupType {
public enum GroupType implements FhirEnum {
/**
* Group contains "person" Patient resources.
*/
@ -74,7 +74,10 @@ public class Group extends DomainResource {
* added to help the parsers
*/
NULL;
public static GroupType fromCode(String codeString) throws Exception {
public static final GroupTypeEnumFactory ENUM_FACTORY = new GroupTypeEnumFactory();
public static GroupType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("person".equals(codeString))
@ -89,8 +92,9 @@ public class Group extends DomainResource {
return MEDICATION;
if ("substance".equals(codeString))
return SUBSTANCE;
throw new Exception("Unknown GroupType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PERSON: return "person";
@ -137,8 +141,8 @@ public class Group extends DomainResource {
}
}
public static class GroupTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class GroupTypeEnumFactory implements EnumFactory<GroupType> {
public GroupType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -154,9 +158,9 @@ public class Group extends DomainResource {
return GroupType.MEDICATION;
if ("substance".equals(codeString))
return GroupType.SUBSTANCE;
throw new Exception("Unknown GroupType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(GroupType code) throws IllegalArgumentException {
if (code == GroupType.PERSON)
return "person";
if (code == GroupType.ANIMAL)
@ -493,7 +497,7 @@ public class Group extends DomainResource {
*/
public Group setType(GroupType value) {
if (this.type == null)
this.type = new Enumeration<GroupType>();
this.type = new Enumeration<GroupType>(GroupType.ENUM_FACTORY);
this.type.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -297,14 +297,14 @@ public class HealthcareService extends DomainResource {
/**
* @return The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.
*/
public DateAndTime getAvailableStartTime() {
public Date getAvailableStartTime() {
return this.availableStartTime == null ? null : this.availableStartTime.getValue();
}
/**
* @param value The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.
*/
public HealthcareServiceAvailableTimeComponent setAvailableStartTime(DateAndTime value) {
public HealthcareServiceAvailableTimeComponent setAvailableStartTime(Date value) {
if (value == null)
this.availableStartTime = null;
else {
@ -346,14 +346,14 @@ public class HealthcareService extends DomainResource {
/**
* @return The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.
*/
public DateAndTime getAvailableEndTime() {
public Date getAvailableEndTime() {
return this.availableEndTime == null ? null : this.availableEndTime.getValue();
}
/**
* @param value The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.
*/
public HealthcareServiceAvailableTimeComponent setAvailableEndTime(DateAndTime value) {
public HealthcareServiceAvailableTimeComponent setAvailableEndTime(Date value) {
if (value == null)
this.availableEndTime = null;
else {
@ -504,14 +504,14 @@ public class HealthcareService extends DomainResource {
/**
* @return Service is not available (seasonally or for a public holiday) from this date.
*/
public DateAndTime getStartDate() {
public Date getStartDate() {
return this.startDate == null ? null : this.startDate.getValue();
}
/**
* @param value Service is not available (seasonally or for a public holiday) from this date.
*/
public HealthcareServiceNotAvailableTimeComponent setStartDate(DateAndTime value) {
public HealthcareServiceNotAvailableTimeComponent setStartDate(Date value) {
if (value == null)
this.startDate = null;
else {
@ -553,14 +553,14 @@ public class HealthcareService extends DomainResource {
/**
* @return Service is not available (seasonally or for a public holiday) until this date.
*/
public DateAndTime getEndDate() {
public Date getEndDate() {
return this.endDate == null ? null : this.endDate.getValue();
}
/**
* @param value Service is not available (seasonally or for a public holiday) until this date.
*/
public HealthcareServiceNotAvailableTimeComponent setEndDate(DateAndTime value) {
public HealthcareServiceNotAvailableTimeComponent setEndDate(Date value) {
if (value == null)
this.endDate = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
@DatatypeDef(name="HumanName")
public class HumanName extends Type {
public enum NameUse {
public enum NameUse implements FhirEnum {
/**
* Known as/conventional/the one you normally use.
*/
@ -76,7 +76,10 @@ public class HumanName extends Type {
* added to help the parsers
*/
NULL;
public static NameUse fromCode(String codeString) throws Exception {
public static final NameUseEnumFactory ENUM_FACTORY = new NameUseEnumFactory();
public static NameUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("usual".equals(codeString))
@ -93,8 +96,9 @@ public class HumanName extends Type {
return OLD;
if ("maiden".equals(codeString))
return MAIDEN;
throw new Exception("Unknown NameUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case USUAL: return "usual";
@ -145,8 +149,8 @@ public class HumanName extends Type {
}
}
public static class NameUseEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class NameUseEnumFactory implements EnumFactory<NameUse> {
public NameUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -164,9 +168,9 @@ public class HumanName extends Type {
return NameUse.OLD;
if ("maiden".equals(codeString))
return NameUse.MAIDEN;
throw new Exception("Unknown NameUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(NameUse code) throws IllegalArgumentException {
if (code == NameUse.USUAL)
return "usual";
if (code == NameUse.OFFICIAL)
@ -283,7 +287,7 @@ public class HumanName extends Type {
this.use = null;
else {
if (this.use == null)
this.use = new Enumeration<NameUse>();
this.use = new Enumeration<NameUse>(NameUse.ENUM_FACTORY);
this.use.setValue(value);
}
return this;

View File

@ -29,62 +29,41 @@ POSSIBILITY OF SUCH DAMAGE.
package org.hl7.fhir.instance.model;
/**
* Primitive type "id" in FHIR: a string from 1 to 36 characters, only containing letters, digits, "-" and "."
* Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "."
*/
public class IdType extends PrimitiveType {
public class IdType extends PrimitiveType<String> {
private static final long serialVersionUID = 8363122970864385593L;
public static final int MAX_LENGTH = 64;
public static final int MAX_LENGTH = 64;
private static final long serialVersionUID = 1L;
/**
* The value of the id
* Constructor
*/
protected String value;
public IdType(String value) {
this.value = value;
}
public IdType() {
}
/**
* @return the id
*/
public String getValue() {
return value;
public IdType() {
super();
}
/**
* @param value the id
* Constructor
*/
public void setValue(String value) {
this.value = value;
public IdType(String theValue) {
setValue(theValue);
}
@Override
protected Type typedCopy() {
return copy();
protected String parse(String theValue) {
return theValue;
}
@Override
public IdType copy() {
IdType dst = new IdType();
dst.value = value;
return dst;
protected String encode(String theValue) {
return theValue;
}
@Override
public String asStringValue() {
return value;
}
public boolean isEmpty() {
return super.isEmpty() && value == null;
}
public boolean hasValue() {
return value != null;
@Override
public IdType copy() {
return new IdType(getValue());
}
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
@DatatypeDef(name="Identifier")
public class Identifier extends Type {
public enum IdentifierUse {
public enum IdentifierUse implements FhirEnum {
/**
* the identifier recommended for display and use in real-world interactions.
*/
@ -64,7 +64,10 @@ public class Identifier extends Type {
* added to help the parsers
*/
NULL;
public static IdentifierUse fromCode(String codeString) throws Exception {
public static final IdentifierUseEnumFactory ENUM_FACTORY = new IdentifierUseEnumFactory();
public static IdentifierUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("usual".equals(codeString))
@ -75,8 +78,9 @@ public class Identifier extends Type {
return TEMP;
if ("secondary".equals(codeString))
return SECONDARY;
throw new Exception("Unknown IdentifierUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case USUAL: return "usual";
@ -115,8 +119,8 @@ public class Identifier extends Type {
}
}
public static class IdentifierUseEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class IdentifierUseEnumFactory implements EnumFactory<IdentifierUse> {
public IdentifierUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -128,9 +132,9 @@ public class Identifier extends Type {
return IdentifierUse.TEMP;
if ("secondary".equals(codeString))
return IdentifierUse.SECONDARY;
throw new Exception("Unknown IdentifierUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(IdentifierUse code) throws IllegalArgumentException {
if (code == IdentifierUse.USUAL)
return "usual";
if (code == IdentifierUse.OFFICIAL)
@ -239,7 +243,7 @@ public class Identifier extends Type {
this.use = null;
else {
if (this.use == null)
this.use = new Enumeration<IdentifierUse>();
this.use = new Enumeration<IdentifierUse>(IdentifierUse.ENUM_FACTORY);
this.use.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -1103,14 +1103,14 @@ Note that this AE Title is provided to retrieve all SOP instances of the series
/**
* @return Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.
*/
public DateAndTime getAuthoringTime() {
public Date getAuthoringTime() {
return this.authoringTime == null ? null : this.authoringTime.getValue();
}
/**
* @param value Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource.
*/
public ImagingObjectSelection setAuthoringTime(DateAndTime value) {
public ImagingObjectSelection setAuthoringTime(Date value) {
if (value == null)
this.authoringTime = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy")
public class ImagingStudy extends DomainResource {
public enum ImagingModality {
public enum ImagingModality implements FhirEnum {
/**
*
*/
@ -194,7 +194,10 @@ public class ImagingStudy extends DomainResource {
* added to help the parsers
*/
NULL;
public static ImagingModality fromCode(String codeString) throws Exception {
public static final ImagingModalityEnumFactory ENUM_FACTORY = new ImagingModalityEnumFactory();
public static ImagingModality fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("AR".equals(codeString))
@ -269,8 +272,9 @@ public class ImagingStudy extends DomainResource {
return VA;
if ("XA".equals(codeString))
return XA;
throw new Exception("Unknown ImagingModality code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case AR: return "AR";
@ -437,8 +441,8 @@ public class ImagingStudy extends DomainResource {
}
}
public static class ImagingModalityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ImagingModalityEnumFactory implements EnumFactory<ImagingModality> {
public ImagingModality fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -514,9 +518,9 @@ public class ImagingStudy extends DomainResource {
return ImagingModality.VA;
if ("XA".equals(codeString))
return ImagingModality.XA;
throw new Exception("Unknown ImagingModality code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ImagingModality code) throws IllegalArgumentException {
if (code == ImagingModality.AR)
return "AR";
if (code == ImagingModality.BMD)
@ -593,7 +597,7 @@ public class ImagingStudy extends DomainResource {
}
}
public enum InstanceAvailability {
public enum InstanceAvailability implements FhirEnum {
/**
* Resources are immediately available,.
*/
@ -614,7 +618,10 @@ public class ImagingStudy extends DomainResource {
* added to help the parsers
*/
NULL;
public static InstanceAvailability fromCode(String codeString) throws Exception {
public static final InstanceAvailabilityEnumFactory ENUM_FACTORY = new InstanceAvailabilityEnumFactory();
public static InstanceAvailability fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("ONLINE".equals(codeString))
@ -625,8 +632,9 @@ public class ImagingStudy extends DomainResource {
return NEARLINE;
if ("UNAVAILABLE".equals(codeString))
return UNAVAILABLE;
throw new Exception("Unknown InstanceAvailability code '"+codeString+"'");
throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ONLINE: return "ONLINE";
@ -665,8 +673,8 @@ public class ImagingStudy extends DomainResource {
}
}
public static class InstanceAvailabilityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class InstanceAvailabilityEnumFactory implements EnumFactory<InstanceAvailability> {
public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -678,9 +686,9 @@ public class ImagingStudy extends DomainResource {
return InstanceAvailability.NEARLINE;
if ("UNAVAILABLE".equals(codeString))
return InstanceAvailability.UNAVAILABLE;
throw new Exception("Unknown InstanceAvailability code '"+codeString+"'");
throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(InstanceAvailability code) throws IllegalArgumentException {
if (code == InstanceAvailability.ONLINE)
return "ONLINE";
if (code == InstanceAvailability.OFFLINE)
@ -693,7 +701,7 @@ public class ImagingStudy extends DomainResource {
}
}
public enum Modality {
public enum Modality implements FhirEnum {
/**
*
*/
@ -910,7 +918,10 @@ public class ImagingStudy extends DomainResource {
* added to help the parsers
*/
NULL;
public static Modality fromCode(String codeString) throws Exception {
public static final ModalityEnumFactory ENUM_FACTORY = new ModalityEnumFactory();
public static Modality fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("AR".equals(codeString))
@ -1019,8 +1030,9 @@ public class ImagingStudy extends DomainResource {
return XA;
if ("XC".equals(codeString))
return XC;
throw new Exception("Unknown Modality code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case AR: return "AR";
@ -1255,8 +1267,8 @@ public class ImagingStudy extends DomainResource {
}
}
public static class ModalityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ModalityEnumFactory implements EnumFactory<Modality> {
public Modality fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -1366,9 +1378,9 @@ public class ImagingStudy extends DomainResource {
return Modality.XA;
if ("XC".equals(codeString))
return Modality.XC;
throw new Exception("Unknown Modality code '"+codeString+"'");
throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(Modality code) throws IllegalArgumentException {
if (code == Modality.AR)
return "AR";
if (code == Modality.AU)
@ -1653,7 +1665,7 @@ public class ImagingStudy extends DomainResource {
*/
public ImagingStudySeriesComponent setModality(Modality value) {
if (this.modality == null)
this.modality = new Enumeration<Modality>();
this.modality = new Enumeration<Modality>(Modality.ENUM_FACTORY);
this.modality.setValue(value);
return this;
}
@ -1840,7 +1852,7 @@ public class ImagingStudy extends DomainResource {
this.availability = null;
else {
if (this.availability == null)
this.availability = new Enumeration<InstanceAvailability>();
this.availability = new Enumeration<InstanceAvailability>(InstanceAvailability.ENUM_FACTORY);
this.availability.setValue(value);
}
return this;
@ -1950,14 +1962,14 @@ public class ImagingStudy extends DomainResource {
/**
* @return The date when the series was started.
*/
public DateAndTime getDateTime() {
public Date getDateTime() {
return this.dateTime == null ? null : this.dateTime.getValue();
}
/**
* @param value The date when the series was started.
*/
public ImagingStudySeriesComponent setDateTime(DateAndTime value) {
public ImagingStudySeriesComponent setDateTime(Date value) {
if (value == null)
this.dateTime = null;
else {
@ -2650,14 +2662,14 @@ public class ImagingStudy extends DomainResource {
/**
* @return Date and Time the study started.
*/
public DateAndTime getStarted() {
public Date getStarted() {
return this.started == null ? null : this.started.getValue();
}
/**
* @param value Date and Time the study started.
*/
public ImagingStudy setStarted(DateAndTime value) {
public ImagingStudy setStarted(Date value) {
if (value == null)
this.started = null;
else {
@ -3003,7 +3015,7 @@ public class ImagingStudy extends DomainResource {
this.availability = null;
else {
if (this.availability == null)
this.availability = new Enumeration<InstanceAvailability>();
this.availability = new Enumeration<InstanceAvailability>(InstanceAvailability.ENUM_FACTORY);
this.availability.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -221,14 +221,14 @@ public class Immunization extends DomainResource {
/**
* @return Date of reaction to the immunization.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value Date of reaction to the immunization.
*/
public ImmunizationReactionComponent setDate(DateAndTime value) {
public ImmunizationReactionComponent setDate(Date value) {
if (value == null)
this.date = null;
else {
@ -1001,14 +1001,14 @@ public class Immunization extends DomainResource {
/**
* @return Date vaccine administered or was to be administered.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value Date vaccine administered or was to be administered.
*/
public Immunization setDate(DateAndTime value) {
public Immunization setDate(Date value) {
if (this.date == null)
this.date = new DateTimeType();
this.date.setValue(value);
@ -1429,14 +1429,14 @@ public class Immunization extends DomainResource {
/**
* @return Date vaccine batch expires.
*/
public DateAndTime getExpirationDate() {
public Date getExpirationDate() {
return this.expirationDate == null ? null : this.expirationDate.getValue();
}
/**
* @param value Date vaccine batch expires.
*/
public Immunization setExpirationDate(DateAndTime value) {
public Immunization setExpirationDate(Date value) {
if (value == null)
this.expirationDate = null;
else {
@ -1684,10 +1684,10 @@ public class Immunization extends DomainResource {
@SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" )
public static final String SP_REACTION = "reaction";
@SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="What dose number within series?", type="number" )
public static final String SP_DOSESEQUENCE = "dose-sequence";
@SearchParamDefinition(name="requester", path="Immunization.requester", description="The practitioner who ordered the vaccination", type="reference" )
public static final String SP_REQUESTER = "requester";
@SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="What dose number within series?", type="number" )
public static final String SP_DOSESEQUENCE = "dose-sequence";
@SearchParamDefinition(name="vaccine-type", path="Immunization.vaccineType", description="Vaccine Product Type Administered", type="token" )
public static final String SP_VACCINETYPE = "vaccine-type";
@SearchParamDefinition(name="location", path="Immunization.location", description="The service delivery location or facility in which the vaccine was / was to be administered", type="reference" )

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -157,14 +157,14 @@ public class ImmunizationRecommendation extends DomainResource {
/**
* @return The date the immunization recommendation was created.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date the immunization recommendation was created.
*/
public ImmunizationRecommendationRecommendationComponent setDate(DateAndTime value) {
public ImmunizationRecommendationRecommendationComponent setDate(Date value) {
if (this.date == null)
this.date = new DateTimeType();
this.date.setValue(value);
@ -543,14 +543,14 @@ public class ImmunizationRecommendation extends DomainResource {
/**
* @return Date recommendation.
*/
public DateAndTime getValue() {
public Date getValue() {
return this.value == null ? null : this.value.getValue();
}
/**
* @param value Date recommendation.
*/
public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(DateAndTime value) {
public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) {
if (this.value == null)
this.value = new DateTimeType();
this.value.setValue(value);

View File

@ -34,8 +34,7 @@ package org.hl7.fhir.instance.model;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import ca.uhn.fhir.parser.DataFormatException;
import java.util.zip.DataFormatException;
/**
* Represents a FHIR instant datatype. Valid precisions values for this type are:
@ -46,6 +45,8 @@ import ca.uhn.fhir.parser.DataFormatException;
*/
public class InstantType extends BaseDateTimeType {
private static final long serialVersionUID = 1L;
/**
* The default precision for this type
*/
@ -195,4 +196,22 @@ public class InstantType extends BaseDateTimeType {
public InstantType copy() {
return new InstantType(getValue());
}
/**
* Returns a new instance of DateTimeType with the current system time and MILLI precision and the system local time
* zone
*/
public static InstantType now() {
return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault());
}
/**
* Creates a new instance by parsing an HL7 v3 format date time string
*/
public static InstantType parseV3(String theV3String) {
InstantType retVal = new InstantType();
retVal.setValueAsV3String(theV3String);
return retVal;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -25,96 +25,81 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
*/
/**
*
*/
package org.hl7.fhir.instance.model;
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**
* Primitive type "integer" in FHIR: A signed 32-bit integer
* @author Grahame
*
*/
public class IntegerType extends PrimitiveType {
@DatatypeDef(name = "integer")
public class IntegerType extends PrimitiveType<Integer> {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -553171308047944356L;
/**
* the actual value of the number
* Constructor
*/
private java.lang.Integer value;
/**
* The exact representation of the number on the wire. i.e. does it have leading zeros.
* This SHOULD not be used, but is provided in case it's absolutely needed
*/
private String original;
public IntegerType(Integer value) {
if (value != null) {
this.value = value;
original = value.toString();
}
}
public IntegerType() {
}
/**
* @return the integer value
*/
public int getValue() {
return value;
public IntegerType() {
// nothing
}
/**
* @param value the integer value
* Constructor
*/
public void setValue(int value) {
this.value = value;
this.original = null;
public IntegerType(int theInteger) {
setValue(theInteger);
}
/**
* @return The exact representation of the number on the wire
* Constructor
*
* @param theIntegerAsString
* A string representation of an integer
* @throws IllegalArgumentException
* If the string is not a valid integer representation
*/
public String getOriginal() {
return original;
}
public IntegerType(String theIntegerAsString) {
setValueAsString(theIntegerAsString);
}
/**
* @param original The exact representation of the number on the wire
*/
public void setOriginal(String original) {
this.original = original;
}
@Override
public IntegerType copy() {
IntegerType dst = new IntegerType();
dst.value = value;
dst.original = original;
return dst;
/**
* Constructor
*
* @param theValue The value
* @throws IllegalArgumentException If the value is too large to fit in a signed integer
*/
public IntegerType(Long theValue) {
if (theValue < java.lang.Integer.MIN_VALUE || theValue > java.lang.Integer.MAX_VALUE) {
throw new IllegalArgumentException
(theValue + " cannot be cast to int without changing its value.");
}
if(theValue!=null) {
setValue((int)theValue.longValue());
}
}
@Override
protected Type typedCopy() {
return copy();
protected Integer parse(String theValue) {
try {
return Integer.parseInt(theValue);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(e);
}
}
public String getStringValue() {
return java.lang.Integer.toString(value);
}
@Override
public String asStringValue() {
return original != null ? original : java.lang.Integer.toString(value);
}
public boolean isEmpty() {
return super.isEmpty() && value == null;
@Override
protected String encode(Integer theValue) {
return Integer.toString(theValue);
}
public boolean hasValue() {
return value != null;
}
@Override
public IntegerType copy() {
return new IntegerType(getValue());
}
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="List_", profile="http://hl7.org/fhir/Profile/List_")
public class List_ extends DomainResource {
public enum ListMode {
public enum ListMode implements FhirEnum {
/**
* This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes.
*/
@ -62,7 +62,10 @@ public class List_ extends DomainResource {
* added to help the parsers
*/
NULL;
public static ListMode fromCode(String codeString) throws Exception {
public static final ListModeEnumFactory ENUM_FACTORY = new ListModeEnumFactory();
public static ListMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("working".equals(codeString))
@ -71,8 +74,9 @@ public class List_ extends DomainResource {
return SNAPSHOT;
if ("changes".equals(codeString))
return CHANGES;
throw new Exception("Unknown ListMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case WORKING: return "working";
@ -107,8 +111,8 @@ public class List_ extends DomainResource {
}
}
public static class ListModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ListModeEnumFactory implements EnumFactory<ListMode> {
public ListMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class List_ extends DomainResource {
return ListMode.SNAPSHOT;
if ("changes".equals(codeString))
return ListMode.CHANGES;
throw new Exception("Unknown ListMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ListMode code) throws IllegalArgumentException {
if (code == ListMode.WORKING)
return "working";
if (code == ListMode.SNAPSHOT)
@ -287,14 +291,14 @@ public class List_ extends DomainResource {
/**
* @return When this item was added to the list.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value When this item was added to the list.
*/
public ListEntryComponent setDate(DateAndTime value) {
public ListEntryComponent setDate(Date value) {
if (value == null)
this.date = null;
else {
@ -620,14 +624,14 @@ public class List_ extends DomainResource {
/**
* @return The date that the list was prepared.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date that the list was prepared.
*/
public List_ setDate(DateAndTime value) {
public List_ setDate(Date value) {
if (value == null)
this.date = null;
else {
@ -727,7 +731,7 @@ public class List_ extends DomainResource {
*/
public List_ setMode(ListMode value) {
if (this.mode == null)
this.mode = new Enumeration<ListMode>();
this.mode = new Enumeration<ListMode>(ListMode.ENUM_FACTORY);
this.mode.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location")
public class Location extends DomainResource {
public enum LocationStatus {
public enum LocationStatus implements FhirEnum {
/**
* The location is operational.
*/
@ -63,7 +63,10 @@ public class Location extends DomainResource {
* added to help the parsers
*/
NULL;
public static LocationStatus fromCode(String codeString) throws Exception {
public static final LocationStatusEnumFactory ENUM_FACTORY = new LocationStatusEnumFactory();
public static LocationStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("active".equals(codeString))
@ -72,8 +75,9 @@ public class Location extends DomainResource {
return SUSPENDED;
if ("inactive".equals(codeString))
return INACTIVE;
throw new Exception("Unknown LocationStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ACTIVE: return "active";
@ -108,8 +112,8 @@ public class Location extends DomainResource {
}
}
public static class LocationStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class LocationStatusEnumFactory implements EnumFactory<LocationStatus> {
public LocationStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -119,9 +123,9 @@ public class Location extends DomainResource {
return LocationStatus.SUSPENDED;
if ("inactive".equals(codeString))
return LocationStatus.INACTIVE;
throw new Exception("Unknown LocationStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(LocationStatus code) throws IllegalArgumentException {
if (code == LocationStatus.ACTIVE)
return "active";
if (code == LocationStatus.SUSPENDED)
@ -132,7 +136,7 @@ public class Location extends DomainResource {
}
}
public enum LocationMode {
public enum LocationMode implements FhirEnum {
/**
* The Location resource represents a specific instance of a Location.
*/
@ -145,15 +149,19 @@ public class Location extends DomainResource {
* added to help the parsers
*/
NULL;
public static LocationMode fromCode(String codeString) throws Exception {
public static final LocationModeEnumFactory ENUM_FACTORY = new LocationModeEnumFactory();
public static LocationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("instance".equals(codeString))
return INSTANCE;
if ("kind".equals(codeString))
return KIND;
throw new Exception("Unknown LocationMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INSTANCE: return "instance";
@ -184,8 +192,8 @@ public class Location extends DomainResource {
}
}
public static class LocationModeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class LocationModeEnumFactory implements EnumFactory<LocationMode> {
public LocationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -193,9 +201,9 @@ public class Location extends DomainResource {
return LocationMode.INSTANCE;
if ("kind".equals(codeString))
return LocationMode.KIND;
throw new Exception("Unknown LocationMode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(LocationMode code) throws IllegalArgumentException {
if (code == LocationMode.INSTANCE)
return "instance";
if (code == LocationMode.KIND)
@ -842,7 +850,7 @@ public class Location extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<LocationStatus>();
this.status = new Enumeration<LocationStatus>(LocationStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -935,7 +943,7 @@ public class Location extends DomainResource {
this.mode = null;
else {
if (this.mode == null)
this.mode = new Enumeration<LocationMode>();
this.mode = new Enumeration<LocationMode>(LocationMode.ENUM_FACTORY);
this.mode.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media")
public class Media extends DomainResource {
public enum MediaType {
public enum MediaType implements FhirEnum {
/**
* The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents.
*/
@ -62,7 +62,10 @@ public class Media extends DomainResource {
* added to help the parsers
*/
NULL;
public static MediaType fromCode(String codeString) throws Exception {
public static final MediaTypeEnumFactory ENUM_FACTORY = new MediaTypeEnumFactory();
public static MediaType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("photo".equals(codeString))
@ -71,8 +74,9 @@ public class Media extends DomainResource {
return VIDEO;
if ("audio".equals(codeString))
return AUDIO;
throw new Exception("Unknown MediaType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PHOTO: return "photo";
@ -107,8 +111,8 @@ public class Media extends DomainResource {
}
}
public static class MediaTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MediaTypeEnumFactory implements EnumFactory<MediaType> {
public MediaType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class Media extends DomainResource {
return MediaType.VIDEO;
if ("audio".equals(codeString))
return MediaType.AUDIO;
throw new Exception("Unknown MediaType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MediaType code) throws IllegalArgumentException {
if (code == MediaType.PHOTO)
return "photo";
if (code == MediaType.VIDEO)
@ -284,7 +288,7 @@ public class Media extends DomainResource {
*/
public Media setType(MediaType value) {
if (this.type == null)
this.type = new Enumeration<MediaType>();
this.type = new Enumeration<MediaType>(MediaType.ENUM_FACTORY);
this.type.setValue(value);
return this;
}
@ -374,14 +378,14 @@ public class Media extends DomainResource {
/**
* @return The date/time when the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the start of the recording.
*/
public DateAndTime getCreated() {
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date/time when the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the start of the recording.
*/
public Media setCreated(DateAndTime value) {
public Media setCreated(Date value) {
if (value == null)
this.created = null;
else {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication")
public class Medication extends DomainResource {
public enum MedicationKind {
public enum MedicationKind implements FhirEnum {
/**
* The medication is a product.
*/
@ -58,15 +58,19 @@ public class Medication extends DomainResource {
* added to help the parsers
*/
NULL;
public static MedicationKind fromCode(String codeString) throws Exception {
public static final MedicationKindEnumFactory ENUM_FACTORY = new MedicationKindEnumFactory();
public static MedicationKind fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("product".equals(codeString))
return PRODUCT;
if ("package".equals(codeString))
return PACKAGE;
throw new Exception("Unknown MedicationKind code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PRODUCT: return "product";
@ -97,8 +101,8 @@ public class Medication extends DomainResource {
}
}
public static class MedicationKindEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MedicationKindEnumFactory implements EnumFactory<MedicationKind> {
public MedicationKind fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -106,9 +110,9 @@ public class Medication extends DomainResource {
return MedicationKind.PRODUCT;
if ("package".equals(codeString))
return MedicationKind.PACKAGE;
throw new Exception("Unknown MedicationKind code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MedicationKind code) throws IllegalArgumentException {
if (code == MedicationKind.PRODUCT)
return "product";
if (code == MedicationKind.PACKAGE)
@ -825,7 +829,7 @@ public class Medication extends DomainResource {
this.kind = null;
else {
if (this.kind == null)
this.kind = new Enumeration<MedicationKind>();
this.kind = new Enumeration<MedicationKind>(MedicationKind.ENUM_FACTORY);
this.kind.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -47,7 +47,7 @@ Related resources tie this event to the authorizing prescription, and the specif
@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration")
public class MedicationAdministration extends DomainResource {
public enum MedicationAdminStatus {
public enum MedicationAdminStatus implements FhirEnum {
/**
* The administration has started but has not yet completed.
*/
@ -72,7 +72,10 @@ public class MedicationAdministration extends DomainResource {
* added to help the parsers
*/
NULL;
public static MedicationAdminStatus fromCode(String codeString) throws Exception {
public static final MedicationAdminStatusEnumFactory ENUM_FACTORY = new MedicationAdminStatusEnumFactory();
public static MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
@ -85,8 +88,9 @@ public class MedicationAdministration extends DomainResource {
return ENTEREDINERROR;
if ("stopped".equals(codeString))
return STOPPED;
throw new Exception("Unknown MedicationAdminStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INPROGRESS: return "in progress";
@ -129,8 +133,8 @@ public class MedicationAdministration extends DomainResource {
}
}
public static class MedicationAdminStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MedicationAdminStatusEnumFactory implements EnumFactory<MedicationAdminStatus> {
public MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -144,9 +148,9 @@ public class MedicationAdministration extends DomainResource {
return MedicationAdminStatus.ENTEREDINERROR;
if ("stopped".equals(codeString))
return MedicationAdminStatus.STOPPED;
throw new Exception("Unknown MedicationAdminStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MedicationAdminStatus code) throws IllegalArgumentException {
if (code == MedicationAdminStatus.INPROGRESS)
return "in progress";
if (code == MedicationAdminStatus.ONHOLD)
@ -683,7 +687,7 @@ Terminologies used often pre-coordinate this term with the route and or form of
*/
public MedicationAdministration setStatus(MedicationAdminStatus value) {
if (this.status == null)
this.status = new Enumeration<MedicationAdminStatus>();
this.status = new Enumeration<MedicationAdminStatus>(MedicationAdminStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense")
public class MedicationDispense extends DomainResource {
public enum MedicationDispenseStatus {
public enum MedicationDispenseStatus implements FhirEnum {
/**
* The dispense has started but has not yet completed.
*/
@ -70,7 +70,10 @@ public class MedicationDispense extends DomainResource {
* added to help the parsers
*/
NULL;
public static MedicationDispenseStatus fromCode(String codeString) throws Exception {
public static final MedicationDispenseStatusEnumFactory ENUM_FACTORY = new MedicationDispenseStatusEnumFactory();
public static MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("in progress".equals(codeString))
@ -83,8 +86,9 @@ public class MedicationDispense extends DomainResource {
return ENTEREDINERROR;
if ("stopped".equals(codeString))
return STOPPED;
throw new Exception("Unknown MedicationDispenseStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case INPROGRESS: return "in progress";
@ -127,8 +131,8 @@ public class MedicationDispense extends DomainResource {
}
}
public static class MedicationDispenseStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MedicationDispenseStatusEnumFactory implements EnumFactory<MedicationDispenseStatus> {
public MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -142,9 +146,9 @@ public class MedicationDispense extends DomainResource {
return MedicationDispenseStatus.ENTEREDINERROR;
if ("stopped".equals(codeString))
return MedicationDispenseStatus.STOPPED;
throw new Exception("Unknown MedicationDispenseStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MedicationDispenseStatus code) throws IllegalArgumentException {
if (code == MedicationDispenseStatus.INPROGRESS)
return "in progress";
if (code == MedicationDispenseStatus.ONHOLD)
@ -319,7 +323,7 @@ public class MedicationDispense extends DomainResource {
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<MedicationDispenseStatus>();
this.status = new Enumeration<MedicationDispenseStatus>(MedicationDispenseStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;
@ -448,14 +452,14 @@ public class MedicationDispense extends DomainResource {
/**
* @return The time when the dispensed product was packaged and reviewed.
*/
public DateAndTime getWhenPrepared() {
public Date getWhenPrepared() {
return this.whenPrepared == null ? null : this.whenPrepared.getValue();
}
/**
* @param value The time when the dispensed product was packaged and reviewed.
*/
public MedicationDispenseDispenseComponent setWhenPrepared(DateAndTime value) {
public MedicationDispenseDispenseComponent setWhenPrepared(Date value) {
if (value == null)
this.whenPrepared = null;
else {
@ -497,14 +501,14 @@ public class MedicationDispense extends DomainResource {
/**
* @return The time the dispensed product was provided to the patient or their representative.
*/
public DateAndTime getWhenHandedOver() {
public Date getWhenHandedOver() {
return this.whenHandedOver == null ? null : this.whenHandedOver.getValue();
}
/**
* @param value The time the dispensed product was provided to the patient or their representative.
*/
public MedicationDispenseDispenseComponent setWhenHandedOver(DateAndTime value) {
public MedicationDispenseDispenseComponent setWhenHandedOver(Date value) {
if (value == null)
this.whenHandedOver = null;
else {
@ -1354,7 +1358,7 @@ Terminologies used often pre-coordinate this term with the route and or form of
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<MedicationDispenseStatus>();
this.status = new Enumeration<MedicationDispenseStatus>(MedicationDispenseStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="MedicationPrescription", profile="http://hl7.org/fhir/Profile/MedicationPrescription")
public class MedicationPrescription extends DomainResource {
public enum MedicationPrescriptionStatus {
public enum MedicationPrescriptionStatus implements FhirEnum {
/**
* The prescription is 'actionable', but not all actions that are implied by it have occurred yet.
*/
@ -74,7 +74,10 @@ public class MedicationPrescription extends DomainResource {
* added to help the parsers
*/
NULL;
public static MedicationPrescriptionStatus fromCode(String codeString) throws Exception {
public static final MedicationPrescriptionStatusEnumFactory ENUM_FACTORY = new MedicationPrescriptionStatusEnumFactory();
public static MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("active".equals(codeString))
@ -89,8 +92,9 @@ public class MedicationPrescription extends DomainResource {
return STOPPED;
if ("superceded".equals(codeString))
return SUPERCEDED;
throw new Exception("Unknown MedicationPrescriptionStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case ACTIVE: return "active";
@ -137,8 +141,8 @@ public class MedicationPrescription extends DomainResource {
}
}
public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory<MedicationPrescriptionStatus> {
public MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -154,9 +158,9 @@ public class MedicationPrescription extends DomainResource {
return MedicationPrescriptionStatus.STOPPED;
if ("superceded".equals(codeString))
return MedicationPrescriptionStatus.SUPERCEDED;
throw new Exception("Unknown MedicationPrescriptionStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(MedicationPrescriptionStatus code) throws IllegalArgumentException {
if (code == MedicationPrescriptionStatus.ACTIVE)
return "active";
if (code == MedicationPrescriptionStatus.ONHOLD)
@ -1112,14 +1116,14 @@ In some situations, this attribute may be used instead of quantity to identify t
/**
* @return The date (and perhaps time) when the prescription was written.
*/
public DateAndTime getDateWritten() {
public Date getDateWritten() {
return this.dateWritten == null ? null : this.dateWritten.getValue();
}
/**
* @param value The date (and perhaps time) when the prescription was written.
*/
public MedicationPrescription setDateWritten(DateAndTime value) {
public MedicationPrescription setDateWritten(Date value) {
if (value == null)
this.dateWritten = null;
else {
@ -1173,7 +1177,7 @@ In some situations, this attribute may be used instead of quantity to identify t
this.status = null;
else {
if (this.status == null)
this.status = new Enumeration<MedicationPrescriptionStatus>();
this.status = new Enumeration<MedicationPrescriptionStatus>(MedicationPrescriptionStatus.ENUM_FACTORY);
this.status.setValue(value);
}
return this;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader")
public class MessageHeader extends DomainResource {
public enum ResponseCode {
public enum ResponseCode implements FhirEnum {
/**
* The message was accepted and processed without error.
*/
@ -62,7 +62,10 @@ public class MessageHeader extends DomainResource {
* added to help the parsers
*/
NULL;
public static ResponseCode fromCode(String codeString) throws Exception {
public static final ResponseCodeEnumFactory ENUM_FACTORY = new ResponseCodeEnumFactory();
public static ResponseCode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("ok".equals(codeString))
@ -71,8 +74,9 @@ public class MessageHeader extends DomainResource {
return TRANSIENTERROR;
if ("fatal-error".equals(codeString))
return FATALERROR;
throw new Exception("Unknown ResponseCode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case OK: return "ok";
@ -107,8 +111,8 @@ public class MessageHeader extends DomainResource {
}
}
public static class ResponseCodeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ResponseCodeEnumFactory implements EnumFactory<ResponseCode> {
public ResponseCode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class MessageHeader extends DomainResource {
return ResponseCode.TRANSIENTERROR;
if ("fatal-error".equals(codeString))
return ResponseCode.FATALERROR;
throw new Exception("Unknown ResponseCode code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ResponseCode code) throws IllegalArgumentException {
if (code == ResponseCode.OK)
return "ok";
if (code == ResponseCode.TRANSIENTERROR)
@ -256,7 +260,7 @@ public class MessageHeader extends DomainResource {
*/
public MessageHeaderResponseComponent setCode(ResponseCode value) {
if (this.code == null)
this.code = new Enumeration<ResponseCode>();
this.code = new Enumeration<ResponseCode>(ResponseCode.ENUM_FACTORY);
this.code.setValue(value);
return this;
}
@ -1019,14 +1023,14 @@ public class MessageHeader extends DomainResource {
/**
* @return The time that the message was sent.
*/
public DateAndTime getTimestamp() {
public Date getTimestamp() {
return this.timestamp == null ? null : this.timestamp.getValue();
}
/**
* @param value The time that the message was sent.
*/
public MessageHeader setTimestamp(DateAndTime value) {
public MessageHeader setTimestamp(Date value) {
if (this.timestamp == null)
this.timestamp = new InstantType();
this.timestamp.setValue(value);

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**

View File

@ -29,12 +29,13 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
@ -44,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem")
public class NamingSystem extends DomainResource {
public enum NamingsystemType {
public enum NamingsystemType implements FhirEnum {
/**
* The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc.
*/
@ -61,7 +62,10 @@ public class NamingSystem extends DomainResource {
* added to help the parsers
*/
NULL;
public static NamingsystemType fromCode(String codeString) throws Exception {
public static final NamingsystemTypeEnumFactory ENUM_FACTORY = new NamingsystemTypeEnumFactory();
public static NamingsystemType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("codesystem".equals(codeString))
@ -70,8 +74,9 @@ public class NamingSystem extends DomainResource {
return IDENTIFIER;
if ("root".equals(codeString))
return ROOT;
throw new Exception("Unknown NamingsystemType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case CODESYSTEM: return "codesystem";
@ -106,8 +111,8 @@ public class NamingSystem extends DomainResource {
}
}
public static class NamingsystemTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class NamingsystemTypeEnumFactory implements EnumFactory<NamingsystemType> {
public NamingsystemType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -117,9 +122,9 @@ public class NamingSystem extends DomainResource {
return NamingsystemType.IDENTIFIER;
if ("root".equals(codeString))
return NamingsystemType.ROOT;
throw new Exception("Unknown NamingsystemType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(NamingsystemType code) throws IllegalArgumentException {
if (code == NamingsystemType.CODESYSTEM)
return "codesystem";
if (code == NamingsystemType.IDENTIFIER)
@ -130,7 +135,7 @@ public class NamingSystem extends DomainResource {
}
}
public enum NamingsystemStatus {
public enum NamingsystemStatus implements FhirEnum {
/**
* System has been submitted but not yet approved.
*/
@ -147,7 +152,10 @@ public class NamingSystem extends DomainResource {
* added to help the parsers
*/
NULL;
public static NamingsystemStatus fromCode(String codeString) throws Exception {
public static final NamingsystemStatusEnumFactory ENUM_FACTORY = new NamingsystemStatusEnumFactory();
public static NamingsystemStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("proposed".equals(codeString))
@ -156,8 +164,9 @@ public class NamingSystem extends DomainResource {
return ACTIVE;
if ("retired".equals(codeString))
return RETIRED;
throw new Exception("Unknown NamingsystemStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case PROPOSED: return "proposed";
@ -192,8 +201,8 @@ public class NamingSystem extends DomainResource {
}
}
public static class NamingsystemStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class NamingsystemStatusEnumFactory implements EnumFactory<NamingsystemStatus> {
public NamingsystemStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -203,9 +212,9 @@ public class NamingSystem extends DomainResource {
return NamingsystemStatus.ACTIVE;
if ("retired".equals(codeString))
return NamingsystemStatus.RETIRED;
throw new Exception("Unknown NamingsystemStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(NamingsystemStatus code) throws IllegalArgumentException {
if (code == NamingsystemStatus.PROPOSED)
return "proposed";
if (code == NamingsystemStatus.ACTIVE)
@ -216,7 +225,7 @@ public class NamingSystem extends DomainResource {
}
}
public enum NamingsystemIdentifierType {
public enum NamingsystemIdentifierType implements FhirEnum {
/**
* An ISO object identifier. E.g. 1.2.3.4.5.
*/
@ -237,7 +246,10 @@ public class NamingSystem extends DomainResource {
* added to help the parsers
*/
NULL;
public static NamingsystemIdentifierType fromCode(String codeString) throws Exception {
public static final NamingsystemIdentifierTypeEnumFactory ENUM_FACTORY = new NamingsystemIdentifierTypeEnumFactory();
public static NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("oid".equals(codeString))
@ -248,8 +260,9 @@ public class NamingSystem extends DomainResource {
return URI;
if ("other".equals(codeString))
return OTHER;
throw new Exception("Unknown NamingsystemIdentifierType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case OID: return "oid";
@ -288,8 +301,8 @@ public class NamingSystem extends DomainResource {
}
}
public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory<NamingsystemIdentifierType> {
public NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -301,9 +314,9 @@ public class NamingSystem extends DomainResource {
return NamingsystemIdentifierType.URI;
if ("other".equals(codeString))
return NamingsystemIdentifierType.OTHER;
throw new Exception("Unknown NamingsystemIdentifierType code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(NamingsystemIdentifierType code) throws IllegalArgumentException {
if (code == NamingsystemIdentifierType.OID)
return "oid";
if (code == NamingsystemIdentifierType.UUID)
@ -398,7 +411,7 @@ public class NamingSystem extends DomainResource {
*/
public NamingSystemUniqueIdComponent setType(NamingsystemIdentifierType value) {
if (this.type == null)
this.type = new Enumeration<NamingsystemIdentifierType>();
this.type = new Enumeration<NamingsystemIdentifierType>(NamingsystemIdentifierType.ENUM_FACTORY);
this.type.setValue(value);
return this;
}
@ -782,7 +795,7 @@ public class NamingSystem extends DomainResource {
*/
public NamingSystem setType(NamingsystemType value) {
if (this.type == null)
this.type = new Enumeration<NamingsystemType>();
this.type = new Enumeration<NamingsystemType>(NamingsystemType.ENUM_FACTORY);
this.type.setValue(value);
return this;
}
@ -872,7 +885,7 @@ public class NamingSystem extends DomainResource {
*/
public NamingSystem setStatus(NamingsystemStatus value) {
if (this.status == null)
this.status = new Enumeration<NamingsystemStatus>();
this.status = new Enumeration<NamingsystemStatus>(NamingsystemStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
@ -44,7 +44,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
@DatatypeDef(name="Narrative")
public class Narrative extends Element {
public enum NarrativeStatus {
public enum NarrativeStatus implements FhirEnum {
/**
* The contents of the narrative are entirely generated from the structured data in the resource.
*/
@ -65,7 +65,10 @@ public class Narrative extends Element {
* added to help the parsers
*/
NULL;
public static NarrativeStatus fromCode(String codeString) throws Exception {
public static final NarrativeStatusEnumFactory ENUM_FACTORY = new NarrativeStatusEnumFactory();
public static NarrativeStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("generated".equals(codeString))
@ -76,8 +79,9 @@ public class Narrative extends Element {
return ADDITIONAL;
if ("empty".equals(codeString))
return EMPTY;
throw new Exception("Unknown NarrativeStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case GENERATED: return "generated";
@ -116,8 +120,8 @@ public class Narrative extends Element {
}
}
public static class NarrativeStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class NarrativeStatusEnumFactory implements EnumFactory<NarrativeStatus> {
public NarrativeStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -129,9 +133,9 @@ public class Narrative extends Element {
return NarrativeStatus.ADDITIONAL;
if ("empty".equals(codeString))
return NarrativeStatus.EMPTY;
throw new Exception("Unknown NarrativeStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(NarrativeStatus code) throws IllegalArgumentException {
if (code == NarrativeStatus.GENERATED)
return "generated";
if (code == NarrativeStatus.EXTENSIONS)
@ -210,7 +214,7 @@ public class Narrative extends Element {
*/
public Narrative setStatus(NarrativeStatus value) {
if (this.status == null)
this.status = new Enumeration<NarrativeStatus>();
this.status = new Enumeration<NarrativeStatus>(NarrativeStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation")
public class Observation extends DomainResource {
public enum DataAbsentReason {
public enum DataAbsentReason implements FhirEnum {
/**
* The value is not known
*/
@ -82,7 +82,10 @@ public class Observation extends DomainResource {
* added to help the parsers
*/
NULL;
public static DataAbsentReason fromCode(String codeString) throws Exception {
public static final DataAbsentReasonEnumFactory ENUM_FACTORY = new DataAbsentReasonEnumFactory();
public static DataAbsentReason fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("unknown".equals(codeString))
@ -101,8 +104,9 @@ public class Observation extends DomainResource {
return ASTEXT;
if ("error".equals(codeString))
return ERROR;
throw new Exception("Unknown DataAbsentReason code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case UNKNOWN: return "unknown";
@ -157,8 +161,8 @@ public class Observation extends DomainResource {
}
}
public static class DataAbsentReasonEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class DataAbsentReasonEnumFactory implements EnumFactory<DataAbsentReason> {
public DataAbsentReason fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -178,9 +182,9 @@ public class Observation extends DomainResource {
return DataAbsentReason.ASTEXT;
if ("error".equals(codeString))
return DataAbsentReason.ERROR;
throw new Exception("Unknown DataAbsentReason code '"+codeString+"'");
throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(DataAbsentReason code) throws IllegalArgumentException {
if (code == DataAbsentReason.UNKNOWN)
return "unknown";
if (code == DataAbsentReason.ASKED)
@ -201,7 +205,7 @@ public class Observation extends DomainResource {
}
}
public enum ObservationStatus {
public enum ObservationStatus implements FhirEnum {
/**
* The existence of the observation is registered, but there is no result yet available.
*/
@ -230,7 +234,10 @@ public class Observation extends DomainResource {
* added to help the parsers
*/
NULL;
public static ObservationStatus fromCode(String codeString) throws Exception {
public static final ObservationStatusEnumFactory ENUM_FACTORY = new ObservationStatusEnumFactory();
public static ObservationStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("registered".equals(codeString))
@ -245,8 +252,9 @@ public class Observation extends DomainResource {
return CANCELLED;
if ("entered in error".equals(codeString))
return ENTEREDINERROR;
throw new Exception("Unknown ObservationStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case REGISTERED: return "registered";
@ -293,8 +301,8 @@ public class Observation extends DomainResource {
}
}
public static class ObservationStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ObservationStatusEnumFactory implements EnumFactory<ObservationStatus> {
public ObservationStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -310,9 +318,9 @@ public class Observation extends DomainResource {
return ObservationStatus.CANCELLED;
if ("entered in error".equals(codeString))
return ObservationStatus.ENTEREDINERROR;
throw new Exception("Unknown ObservationStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ObservationStatus code) throws IllegalArgumentException {
if (code == ObservationStatus.REGISTERED)
return "registered";
if (code == ObservationStatus.PRELIMINARY)
@ -329,7 +337,7 @@ public class Observation extends DomainResource {
}
}
public enum ObservationReliability {
public enum ObservationReliability implements FhirEnum {
/**
* The result has no reliability concerns.
*/
@ -362,7 +370,10 @@ public class Observation extends DomainResource {
* added to help the parsers
*/
NULL;
public static ObservationReliability fromCode(String codeString) throws Exception {
public static final ObservationReliabilityEnumFactory ENUM_FACTORY = new ObservationReliabilityEnumFactory();
public static ObservationReliability fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("ok".equals(codeString))
@ -379,8 +390,9 @@ public class Observation extends DomainResource {
return ERROR;
if ("unknown".equals(codeString))
return UNKNOWN;
throw new Exception("Unknown ObservationReliability code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case OK: return "ok";
@ -431,8 +443,8 @@ public class Observation extends DomainResource {
}
}
public static class ObservationReliabilityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ObservationReliabilityEnumFactory implements EnumFactory<ObservationReliability> {
public ObservationReliability fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -450,9 +462,9 @@ public class Observation extends DomainResource {
return ObservationReliability.ERROR;
if ("unknown".equals(codeString))
return ObservationReliability.UNKNOWN;
throw new Exception("Unknown ObservationReliability code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ObservationReliability code) throws IllegalArgumentException {
if (code == ObservationReliability.OK)
return "ok";
if (code == ObservationReliability.ONGOING)
@ -471,7 +483,7 @@ public class Observation extends DomainResource {
}
}
public enum ObservationRelationshiptypes {
public enum ObservationRelationshiptypes implements FhirEnum {
/**
* The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure).
*/
@ -504,7 +516,10 @@ public class Observation extends DomainResource {
* added to help the parsers
*/
NULL;
public static ObservationRelationshiptypes fromCode(String codeString) throws Exception {
public static final ObservationRelationshiptypesEnumFactory ENUM_FACTORY = new ObservationRelationshiptypesEnumFactory();
public static ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("has-component".equals(codeString))
@ -521,8 +536,9 @@ public class Observation extends DomainResource {
return QUALIFIEDBY;
if ("interfered-by".equals(codeString))
return INTERFEREDBY;
throw new Exception("Unknown ObservationRelationshiptypes code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case HASCOMPONENT: return "has-component";
@ -573,8 +589,8 @@ public class Observation extends DomainResource {
}
}
public static class ObservationRelationshiptypesEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ObservationRelationshiptypesEnumFactory implements EnumFactory<ObservationRelationshiptypes> {
public ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -592,9 +608,9 @@ public class Observation extends DomainResource {
return ObservationRelationshiptypes.QUALIFIEDBY;
if ("interfered-by".equals(codeString))
return ObservationRelationshiptypes.INTERFEREDBY;
throw new Exception("Unknown ObservationRelationshiptypes code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ObservationRelationshiptypes code) throws IllegalArgumentException {
if (code == ObservationRelationshiptypes.HASCOMPONENT)
return "has-component";
if (code == ObservationRelationshiptypes.HASMEMBER)
@ -904,7 +920,7 @@ public class Observation extends DomainResource {
this.type = null;
else {
if (this.type == null)
this.type = new Enumeration<ObservationRelationshiptypes>();
this.type = new Enumeration<ObservationRelationshiptypes>(ObservationRelationshiptypes.ENUM_FACTORY);
this.type.setValue(value);
}
return this;
@ -1300,7 +1316,7 @@ public class Observation extends DomainResource {
this.dataAbsentReason = null;
else {
if (this.dataAbsentReason == null)
this.dataAbsentReason = new Enumeration<DataAbsentReason>();
this.dataAbsentReason = new Enumeration<DataAbsentReason>(DataAbsentReason.ENUM_FACTORY);
this.dataAbsentReason.setValue(value);
}
return this;
@ -1447,14 +1463,14 @@ public class Observation extends DomainResource {
/**
* @return The date and time this observation was made available.
*/
public DateAndTime getIssued() {
public Date getIssued() {
return this.issued == null ? null : this.issued.getValue();
}
/**
* @param value The date and time this observation was made available.
*/
public Observation setIssued(DateAndTime value) {
public Observation setIssued(Date value) {
if (value == null)
this.issued = null;
else {
@ -1505,7 +1521,7 @@ public class Observation extends DomainResource {
*/
public Observation setStatus(ObservationStatus value) {
if (this.status == null)
this.status = new Enumeration<ObservationStatus>();
this.status = new Enumeration<ObservationStatus>(ObservationStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -1553,7 +1569,7 @@ public class Observation extends DomainResource {
this.reliability = null;
else {
if (this.reliability == null)
this.reliability = new Enumeration<ObservationReliability>();
this.reliability = new Enumeration<ObservationReliability>(ObservationReliability.ENUM_FACTORY);
this.reliability.setValue(value);
}
return this;

View File

@ -25,38 +25,45 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
*/
package org.hl7.fhir.instance.model;
import java.net.URI;
/**
* Primitive type "oid" in FHIR: an OID represented as urn:oid:0.1.2.3.4...
*/
public class OidType extends UriType {
private static final long serialVersionUID = -6684415951360862202L;
private static final long serialVersionUID = 2L;
public OidType(String value) {
this.value = value;
}
public OidType() {
}
@Override
protected Type typedCopy() {
return copy();
/**
* Constructor
*/
public OidType() {
super();
}
/**
* Constructor
*/
public OidType(String theValue) {
super(theValue);
}
/**
* Constructor
*/
public OidType(URI theValue) {
super(theValue);
}
/**
* Constructor
*/
@Override
public OidType copy() {
OidType dst = new OidType();
dst.value = value;
return dst;
}
public boolean hasValue() {
return value != null;
public OidType copy() {
return new OidType(getValue());
}
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition")
public class OperationDefinition extends DomainResource {
public enum ResourceProfileStatus {
public enum ResourceProfileStatus implements FhirEnum {
/**
* This profile is still under development.
*/
@ -62,7 +62,10 @@ public class OperationDefinition extends DomainResource {
* added to help the parsers
*/
NULL;
public static ResourceProfileStatus fromCode(String codeString) throws Exception {
public static final ResourceProfileStatusEnumFactory ENUM_FACTORY = new ResourceProfileStatusEnumFactory();
public static ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("draft".equals(codeString))
@ -71,8 +74,9 @@ public class OperationDefinition extends DomainResource {
return ACTIVE;
if ("retired".equals(codeString))
return RETIRED;
throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case DRAFT: return "draft";
@ -107,8 +111,8 @@ public class OperationDefinition extends DomainResource {
}
}
public static class ResourceProfileStatusEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class ResourceProfileStatusEnumFactory implements EnumFactory<ResourceProfileStatus> {
public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -118,9 +122,9 @@ public class OperationDefinition extends DomainResource {
return ResourceProfileStatus.ACTIVE;
if ("retired".equals(codeString))
return ResourceProfileStatus.RETIRED;
throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'");
throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(ResourceProfileStatus code) throws IllegalArgumentException {
if (code == ResourceProfileStatus.DRAFT)
return "draft";
if (code == ResourceProfileStatus.ACTIVE)
@ -131,7 +135,7 @@ public class OperationDefinition extends DomainResource {
}
}
public enum OperationKind {
public enum OperationKind implements FhirEnum {
/**
* This operation is invoked as an operation.
*/
@ -144,15 +148,19 @@ public class OperationDefinition extends DomainResource {
* added to help the parsers
*/
NULL;
public static OperationKind fromCode(String codeString) throws Exception {
public static final OperationKindEnumFactory ENUM_FACTORY = new OperationKindEnumFactory();
public static OperationKind fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("operation".equals(codeString))
return OPERATION;
if ("query".equals(codeString))
return QUERY;
throw new Exception("Unknown OperationKind code '"+codeString+"'");
throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case OPERATION: return "operation";
@ -183,8 +191,8 @@ public class OperationDefinition extends DomainResource {
}
}
public static class OperationKindEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class OperationKindEnumFactory implements EnumFactory<OperationKind> {
public OperationKind fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -192,9 +200,9 @@ public class OperationDefinition extends DomainResource {
return OperationKind.OPERATION;
if ("query".equals(codeString))
return OperationKind.QUERY;
throw new Exception("Unknown OperationKind code '"+codeString+"'");
throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(OperationKind code) throws IllegalArgumentException {
if (code == OperationKind.OPERATION)
return "operation";
if (code == OperationKind.QUERY)
@ -203,7 +211,7 @@ public class OperationDefinition extends DomainResource {
}
}
public enum OperationParameterUse {
public enum OperationParameterUse implements FhirEnum {
/**
* This is an input parameter.
*/
@ -216,15 +224,19 @@ public class OperationDefinition extends DomainResource {
* added to help the parsers
*/
NULL;
public static OperationParameterUse fromCode(String codeString) throws Exception {
public static final OperationParameterUseEnumFactory ENUM_FACTORY = new OperationParameterUseEnumFactory();
public static OperationParameterUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("in".equals(codeString))
return IN;
if ("out".equals(codeString))
return OUT;
throw new Exception("Unknown OperationParameterUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case IN: return "in";
@ -255,8 +267,8 @@ public class OperationDefinition extends DomainResource {
}
}
public static class OperationParameterUseEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class OperationParameterUseEnumFactory implements EnumFactory<OperationParameterUse> {
public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -264,9 +276,9 @@ public class OperationDefinition extends DomainResource {
return OperationParameterUse.IN;
if ("out".equals(codeString))
return OperationParameterUse.OUT;
throw new Exception("Unknown OperationParameterUse code '"+codeString+"'");
throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(OperationParameterUse code) throws IllegalArgumentException {
if (code == OperationParameterUse.IN)
return "in";
if (code == OperationParameterUse.OUT)
@ -315,9 +327,9 @@ public class OperationDefinition extends DomainResource {
/**
* The type for this parameter.
*/
@Child(name="type", type={Coding.class}, order=6, min=1, max=1)
@Child(name="type", type={CodeType.class}, order=6, min=0, max=1)
@Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." )
protected Coding type;
protected CodeType type;
/**
* A profile the specifies the rules that this parameter must conform to.
@ -331,19 +343,25 @@ public class OperationDefinition extends DomainResource {
*/
protected Profile profileTarget;
private static final long serialVersionUID = 55565452L;
/**
* The parts of a Tuple Parameter.
*/
@Child(name="part", type={}, order=8, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Parts of a Tuple Parameter", formalDefinition="The parts of a Tuple Parameter." )
protected List<OperationDefinitionParameterPartComponent> part;
private static final long serialVersionUID = 176609099L;
public OperationDefinitionParameterComponent() {
super();
}
public OperationDefinitionParameterComponent(CodeType name, Enumeration<OperationParameterUse> use, IntegerType min, StringType max, Coding type) {
public OperationDefinitionParameterComponent(CodeType name, Enumeration<OperationParameterUse> use, IntegerType min, StringType max) {
super();
this.name = name;
this.use = use;
this.min = min;
this.max = max;
this.type = type;
}
/**
@ -431,7 +449,7 @@ public class OperationDefinition extends DomainResource {
*/
public OperationDefinitionParameterComponent setUse(OperationParameterUse value) {
if (this.use == null)
this.use = new Enumeration<OperationParameterUse>();
this.use = new Enumeration<OperationParameterUse>(OperationParameterUse.ENUM_FACTORY);
this.use.setValue(value);
return this;
}
@ -576,29 +594,54 @@ public class OperationDefinition extends DomainResource {
}
/**
* @return {@link #type} (The type for this parameter.)
* @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
*/
public Coding getType() {
public CodeType getTypeElement() {
if (this.type == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.type");
else if (Configuration.doAutoCreate())
this.type = new Coding();
this.type = new CodeType();
return this.type;
}
public boolean hasTypeElement() {
return this.type != null && !this.type.isEmpty();
}
public boolean hasType() {
return this.type != null && !this.type.isEmpty();
}
/**
* @param value {@link #type} (The type for this parameter.)
* @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
*/
public OperationDefinitionParameterComponent setType(Coding value) {
public OperationDefinitionParameterComponent setTypeElement(CodeType value) {
this.type = value;
return this;
}
/**
* @return The type for this parameter.
*/
public String getType() {
return this.type == null ? null : this.type.getValue();
}
/**
* @param value The type for this parameter.
*/
public OperationDefinitionParameterComponent setType(String value) {
if (Utilities.noString(value))
this.type = null;
else {
if (this.type == null)
this.type = new CodeType();
this.type.setValue(value);
}
return this;
}
/**
* @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.)
*/
@ -643,6 +686,36 @@ public class OperationDefinition extends DomainResource {
return this;
}
/**
* @return {@link #part} (The parts of a Tuple Parameter.)
*/
public List<OperationDefinitionParameterPartComponent> getPart() {
if (this.part == null)
this.part = new ArrayList<OperationDefinitionParameterPartComponent>();
return this.part;
}
public boolean hasPart() {
if (this.part == null)
return false;
for (OperationDefinitionParameterPartComponent item : this.part)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #part} (The parts of a Tuple Parameter.)
*/
// syntactic sugar
public OperationDefinitionParameterPartComponent addPart() { //3
OperationDefinitionParameterPartComponent t = new OperationDefinitionParameterPartComponent();
if (this.part == null)
this.part = new ArrayList<OperationDefinitionParameterPartComponent>();
this.part.add(t);
return t;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name));
@ -650,8 +723,9 @@ public class OperationDefinition extends DomainResource {
childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min));
childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max));
childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation));
childrenList.add(new Property("type", "Coding", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("profile", "Reference(Profile)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile));
childrenList.add(new Property("part", "", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part));
}
public OperationDefinitionParameterComponent copy() {
@ -664,13 +738,385 @@ public class OperationDefinition extends DomainResource {
dst.documentation = documentation == null ? null : documentation.copy();
dst.type = type == null ? null : type.copy();
dst.profile = profile == null ? null : profile.copy();
if (part != null) {
dst.part = new ArrayList<OperationDefinitionParameterPartComponent>();
for (OperationDefinitionParameterPartComponent i : part)
dst.part.add(i.copy());
};
return dst;
}
public boolean isEmpty() {
return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty())
&& (min == null || min.isEmpty()) && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty())
&& (type == null || type.isEmpty()) && (profile == null || profile.isEmpty());
&& (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) && (part == null || part.isEmpty())
;
}
}
@Block()
public static class OperationDefinitionParameterPartComponent extends BackboneElement {
/**
* The name of used to identify the parameter.
*/
@Child(name="name", type={CodeType.class}, order=1, min=1, max=1)
@Description(shortDefinition="Name of the parameter", formalDefinition="The name of used to identify the parameter." )
protected CodeType name;
/**
* The minimum number of times this parameter SHALL appear in the request or response.
*/
@Child(name="min", type={IntegerType.class}, order=2, min=1, max=1)
@Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." )
protected IntegerType min;
/**
* The maximum number of times this element is permitted to appear in the request or response.
*/
@Child(name="max", type={StringType.class}, order=3, min=1, max=1)
@Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." )
protected StringType max;
/**
* Describes the meaning or use of this parameter.
*/
@Child(name="documentation", type={StringType.class}, order=4, min=0, max=1)
@Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." )
protected StringType documentation;
/**
* The type for this parameter.
*/
@Child(name="type", type={CodeType.class}, order=5, min=1, max=1)
@Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." )
protected CodeType type;
/**
* A profile the specifies the rules that this parameter must conform to.
*/
@Child(name="profile", type={Profile.class}, order=6, min=0, max=1)
@Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." )
protected Reference profile;
/**
* The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.)
*/
protected Profile profileTarget;
private static final long serialVersionUID = -2143629468L;
public OperationDefinitionParameterPartComponent() {
super();
}
public OperationDefinitionParameterPartComponent(CodeType name, IntegerType min, StringType max, CodeType type) {
super();
this.name = name;
this.min = min;
this.max = max;
this.type = type;
}
/**
* @return {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
*/
public CodeType getNameElement() {
if (this.name == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.name");
else if (Configuration.doAutoCreate())
this.name = new CodeType();
return this.name;
}
public boolean hasNameElement() {
return this.name != null && !this.name.isEmpty();
}
public boolean hasName() {
return this.name != null && !this.name.isEmpty();
}
/**
* @param value {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
*/
public OperationDefinitionParameterPartComponent setNameElement(CodeType value) {
this.name = value;
return this;
}
/**
* @return The name of used to identify the parameter.
*/
public String getName() {
return this.name == null ? null : this.name.getValue();
}
/**
* @param value The name of used to identify the parameter.
*/
public OperationDefinitionParameterPartComponent setName(String value) {
if (this.name == null)
this.name = new CodeType();
this.name.setValue(value);
return this;
}
/**
* @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
*/
public IntegerType getMinElement() {
if (this.min == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.min");
else if (Configuration.doAutoCreate())
this.min = new IntegerType();
return this.min;
}
public boolean hasMinElement() {
return this.min != null && !this.min.isEmpty();
}
public boolean hasMin() {
return this.min != null && !this.min.isEmpty();
}
/**
* @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
*/
public OperationDefinitionParameterPartComponent setMinElement(IntegerType value) {
this.min = value;
return this;
}
/**
* @return The minimum number of times this parameter SHALL appear in the request or response.
*/
public int getMin() {
return this.min == null ? null : this.min.getValue();
}
/**
* @param value The minimum number of times this parameter SHALL appear in the request or response.
*/
public OperationDefinitionParameterPartComponent setMin(int value) {
if (this.min == null)
this.min = new IntegerType();
this.min.setValue(value);
return this;
}
/**
* @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
*/
public StringType getMaxElement() {
if (this.max == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.max");
else if (Configuration.doAutoCreate())
this.max = new StringType();
return this.max;
}
public boolean hasMaxElement() {
return this.max != null && !this.max.isEmpty();
}
public boolean hasMax() {
return this.max != null && !this.max.isEmpty();
}
/**
* @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
*/
public OperationDefinitionParameterPartComponent setMaxElement(StringType value) {
this.max = value;
return this;
}
/**
* @return The maximum number of times this element is permitted to appear in the request or response.
*/
public String getMax() {
return this.max == null ? null : this.max.getValue();
}
/**
* @param value The maximum number of times this element is permitted to appear in the request or response.
*/
public OperationDefinitionParameterPartComponent setMax(String value) {
if (this.max == null)
this.max = new StringType();
this.max.setValue(value);
return this;
}
/**
* @return {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
*/
public StringType getDocumentationElement() {
if (this.documentation == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.documentation");
else if (Configuration.doAutoCreate())
this.documentation = new StringType();
return this.documentation;
}
public boolean hasDocumentationElement() {
return this.documentation != null && !this.documentation.isEmpty();
}
public boolean hasDocumentation() {
return this.documentation != null && !this.documentation.isEmpty();
}
/**
* @param value {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
*/
public OperationDefinitionParameterPartComponent setDocumentationElement(StringType value) {
this.documentation = value;
return this;
}
/**
* @return Describes the meaning or use of this parameter.
*/
public String getDocumentation() {
return this.documentation == null ? null : this.documentation.getValue();
}
/**
* @param value Describes the meaning or use of this parameter.
*/
public OperationDefinitionParameterPartComponent setDocumentation(String value) {
if (Utilities.noString(value))
this.documentation = null;
else {
if (this.documentation == null)
this.documentation = new StringType();
this.documentation.setValue(value);
}
return this;
}
/**
* @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
*/
public CodeType getTypeElement() {
if (this.type == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.type");
else if (Configuration.doAutoCreate())
this.type = new CodeType();
return this.type;
}
public boolean hasTypeElement() {
return this.type != null && !this.type.isEmpty();
}
public boolean hasType() {
return this.type != null && !this.type.isEmpty();
}
/**
* @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
*/
public OperationDefinitionParameterPartComponent setTypeElement(CodeType value) {
this.type = value;
return this;
}
/**
* @return The type for this parameter.
*/
public String getType() {
return this.type == null ? null : this.type.getValue();
}
/**
* @param value The type for this parameter.
*/
public OperationDefinitionParameterPartComponent setType(String value) {
if (this.type == null)
this.type = new CodeType();
this.type.setValue(value);
return this;
}
/**
* @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.)
*/
public Reference getProfile() {
if (this.profile == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile");
else if (Configuration.doAutoCreate())
this.profile = new Reference();
return this.profile;
}
public boolean hasProfile() {
return this.profile != null && !this.profile.isEmpty();
}
/**
* @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.)
*/
public OperationDefinitionParameterPartComponent setProfile(Reference value) {
this.profile = value;
return this;
}
/**
* @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.)
*/
public Profile getProfileTarget() {
if (this.profileTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile");
else if (Configuration.doAutoCreate())
this.profileTarget = new Profile();
return this.profileTarget;
}
/**
* @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.)
*/
public OperationDefinitionParameterPartComponent setProfileTarget(Profile value) {
this.profileTarget = value;
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name));
childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min));
childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max));
childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation));
childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("profile", "Reference(Profile)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile));
}
public OperationDefinitionParameterPartComponent copy() {
OperationDefinitionParameterPartComponent dst = new OperationDefinitionParameterPartComponent();
copyValues(dst);
dst.name = name == null ? null : name.copy();
dst.min = min == null ? null : min.copy();
dst.max = max == null ? null : max.copy();
dst.documentation = documentation == null ? null : documentation.copy();
dst.type = type == null ? null : type.copy();
dst.profile = profile == null ? null : profile.copy();
return dst;
}
public boolean isEmpty() {
return super.isEmpty() && (name == null || name.isEmpty()) && (min == null || min.isEmpty())
&& (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) && (type == null || type.isEmpty())
&& (profile == null || profile.isEmpty());
}
}
@ -800,10 +1246,10 @@ public class OperationDefinition extends DomainResource {
protected BooleanType instance;
/**
* Parameters for the operation/query.
* The parameters for the operation/query.
*/
@Child(name="parameter", type={}, order=16, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Parameters for the operation/query", formalDefinition="Parameters for the operation/query." )
@Description(shortDefinition="Parameters for the operation/query", formalDefinition="The parameters for the operation/query." )
protected List<OperationDefinitionParameterComponent> parameter;
private static final long serialVersionUID = 300577956L;
@ -1163,7 +1609,7 @@ public class OperationDefinition extends DomainResource {
*/
public OperationDefinition setStatus(ResourceProfileStatus value) {
if (this.status == null)
this.status = new Enumeration<ResourceProfileStatus>();
this.status = new Enumeration<ResourceProfileStatus>(ResourceProfileStatus.ENUM_FACTORY);
this.status.setValue(value);
return this;
}
@ -1248,14 +1694,14 @@ public class OperationDefinition extends DomainResource {
/**
* @return The date that this version of the profile was published.
*/
public DateAndTime getDate() {
public Date getDate() {
return this.date == null ? null : this.date.getValue();
}
/**
* @param value The date that this version of the profile was published.
*/
public OperationDefinition setDate(DateAndTime value) {
public OperationDefinition setDate(Date value) {
if (value == null)
this.date = null;
else {
@ -1306,7 +1752,7 @@ public class OperationDefinition extends DomainResource {
*/
public OperationDefinition setKind(OperationKind value) {
if (this.kind == null)
this.kind = new Enumeration<OperationKind>();
this.kind = new Enumeration<OperationKind>(OperationKind.ENUM_FACTORY);
this.kind.setValue(value);
return this;
}
@ -1594,7 +2040,7 @@ public class OperationDefinition extends DomainResource {
}
/**
* @return {@link #parameter} (Parameters for the operation/query.)
* @return {@link #parameter} (The parameters for the operation/query.)
*/
public List<OperationDefinitionParameterComponent> getParameter() {
if (this.parameter == null)
@ -1612,7 +2058,7 @@ public class OperationDefinition extends DomainResource {
}
/**
* @return {@link #parameter} (Parameters for the operation/query.)
* @return {@link #parameter} (The parameters for the operation/query.)
*/
// syntactic sugar
public OperationDefinitionParameterComponent addParameter() { //3
@ -1642,7 +2088,7 @@ public class OperationDefinition extends DomainResource {
childrenList.add(new Property("system", "boolean", "Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, system));
childrenList.add(new Property("type", "code", "Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("instance", "boolean", "Indicates whether this operation can be invoked on a particular instance of one of the given types.", 0, java.lang.Integer.MAX_VALUE, instance));
childrenList.add(new Property("parameter", "", "Parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter));
childrenList.add(new Property("parameter", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter));
}
public OperationDefinition copy() {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome")
public class OperationOutcome extends DomainResource {
public enum IssueSeverity {
public enum IssueSeverity implements FhirEnum {
/**
* The issue caused the action to fail, and no further checking could be performed.
*/
@ -66,7 +66,10 @@ public class OperationOutcome extends DomainResource {
* added to help the parsers
*/
NULL;
public static IssueSeverity fromCode(String codeString) throws Exception {
public static final IssueSeverityEnumFactory ENUM_FACTORY = new IssueSeverityEnumFactory();
public static IssueSeverity fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("fatal".equals(codeString))
@ -77,8 +80,9 @@ public class OperationOutcome extends DomainResource {
return WARNING;
if ("information".equals(codeString))
return INFORMATION;
throw new Exception("Unknown IssueSeverity code '"+codeString+"'");
throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case FATAL: return "fatal";
@ -117,8 +121,8 @@ public class OperationOutcome extends DomainResource {
}
}
public static class IssueSeverityEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class IssueSeverityEnumFactory implements EnumFactory<IssueSeverity> {
public IssueSeverity fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -130,9 +134,9 @@ public class OperationOutcome extends DomainResource {
return IssueSeverity.WARNING;
if ("information".equals(codeString))
return IssueSeverity.INFORMATION;
throw new Exception("Unknown IssueSeverity code '"+codeString+"'");
throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(IssueSeverity code) throws IllegalArgumentException {
if (code == IssueSeverity.FATAL)
return "fatal";
if (code == IssueSeverity.ERROR)
@ -226,7 +230,7 @@ public class OperationOutcome extends DomainResource {
*/
public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) {
if (this.severity == null)
this.severity = new Enumeration<IssueSeverity>();
this.severity = new Enumeration<IssueSeverity>(IssueSeverity.ENUM_FACTORY);
this.severity.setValue(value);
return this;
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0
// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
import java.util.*;
@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="OralHealthClaim", profile="http://hl7.org/fhir/Profile/OralHealthClaim")
public class OralHealthClaim extends DomainResource {
public enum UseLink {
public enum UseLink implements FhirEnum {
/**
* The treatment is complete and this represents a Claim for the services.
*/
@ -67,7 +67,10 @@ public class OralHealthClaim extends DomainResource {
* added to help the parsers
*/
NULL;
public static UseLink fromCode(String codeString) throws Exception {
public static final UseLinkEnumFactory ENUM_FACTORY = new UseLinkEnumFactory();
public static UseLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
@ -78,8 +81,9 @@ public class OralHealthClaim extends DomainResource {
return EXPLORATORY;
if ("other".equals(codeString))
return OTHER;
throw new Exception("Unknown UseLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'");
}
@Override
public String toCode() {
switch (this) {
case COMPLETE: return "complete";
@ -118,8 +122,8 @@ public class OralHealthClaim extends DomainResource {
}
}
public static class UseLinkEnumFactory implements EnumFactory {
public Enum<?> fromCode(String codeString) throws Exception {
public static class UseLinkEnumFactory implements EnumFactory<UseLink> {
public UseLink fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
@ -131,9 +135,9 @@ public class OralHealthClaim extends DomainResource {
return UseLink.EXPLORATORY;
if ("other".equals(codeString))
return UseLink.OTHER;
throw new Exception("Unknown UseLink code '"+codeString+"'");
throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'");
}
public String toCode(Enum<?> code) throws Exception {
public String toCode(UseLink code) throws IllegalArgumentException {
if (code == UseLink.COMPLETE)
return "complete";
if (code == UseLink.PROPOSED)
@ -1061,14 +1065,14 @@ public class OralHealthClaim extends DomainResource {
/**
* @return The date of the extraction either known from records or patient reported estimate.
*/
public DateAndTime getExtractiondate() {
public Date getExtractiondate() {
return this.extractiondate == null ? null : this.extractiondate.getValue();
}
/**
* @param value The date of the extraction either known from records or patient reported estimate.
*/
public MissingTeethComponent setExtractiondate(DateAndTime value) {
public MissingTeethComponent setExtractiondate(Date value) {
if (value == null)
this.extractiondate = null;
else {
@ -1190,14 +1194,14 @@ public class OralHealthClaim extends DomainResource {
/**
* @return The intended start date for service.
*/
public DateAndTime getStart() {
public Date getStart() {
return this.start == null ? null : this.start.getValue();
}
/**
* @param value The intended start date for service.
*/
public OrthodonticPlanComponent setStart(DateAndTime value) {
public OrthodonticPlanComponent setStart(Date value) {
if (value == null)
this.start = null;
else {
@ -1463,98 +1467,105 @@ public class OralHealthClaim extends DomainResource {
*/
protected Practitioner providerTarget;
/**
* Diagnosis applicable for this service or product line.
*/
@Child(name="diagnosisLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." )
protected List<IntegerType> diagnosisLinkId;
/**
* If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.
*/
@Child(name="service", type={Coding.class}, order=4, min=1, max=1)
@Child(name="service", type={Coding.class}, order=5, min=1, max=1)
@Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." )
protected Coding service;
/**
* The date when the enclosed suite of services were performed or completed.
*/
@Child(name="serviceDate", type={DateType.class}, order=5, min=0, max=1)
@Child(name="serviceDate", type={DateType.class}, order=6, min=0, max=1)
@Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." )
protected DateType serviceDate;
/**
* The number of repetitions of a service or product.
*/
@Child(name="quantity", type={Quantity.class}, order=6, min=0, max=1)
@Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1)
@Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." )
protected Quantity quantity;
/**
* If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.
*/
@Child(name="unitPrice", type={Money.class}, order=7, min=0, max=1)
@Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1)
@Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." )
protected Money unitPrice;
/**
* A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
*/
@Child(name="factor", type={DecimalType.class}, order=8, min=0, max=1)
@Child(name="factor", type={DecimalType.class}, order=9, min=0, max=1)
@Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
protected DecimalType factor;
/**
* An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
*/
@Child(name="points", type={DecimalType.class}, order=9, min=0, max=1)
@Child(name="points", type={DecimalType.class}, order=10, min=0, max=1)
@Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." )
protected DecimalType points;
/**
* The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.
*/
@Child(name="net", type={Money.class}, order=10, min=0, max=1)
@Child(name="net", type={Money.class}, order=11, min=0, max=1)
@Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." )
protected Money net;
/**
* List of Unique Device Identifiers associated with this line item.
*/
@Child(name="udi", type={Coding.class}, order=11, min=0, max=1)
@Child(name="udi", type={Coding.class}, order=12, min=0, max=1)
@Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." )
protected Coding udi;
/**
* Physical service site on the patient (limb, tooth, etc).
*/
@Child(name="bodySite", type={Coding.class}, order=12, min=0, max=1)
@Child(name="bodySite", type={Coding.class}, order=13, min=0, max=1)
@Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." )
protected Coding bodySite;
/**
* A region or surface of the site, eg. limb region or tooth surface(s).
*/
@Child(name="subsite", type={Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED)
@Child(name="subsite", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." )
protected List<Coding> subsite;
/**
* Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.
*/
@Child(name="modifier", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED)
@Child(name="modifier", type={Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." )
protected List<Coding> modifier;
/**
* Second tier of goods and services.
*/
@Child(name="detail", type={}, order=15, min=0, max=Child.MAX_UNLIMITED)
@Child(name="detail", type={}, order=16, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." )
protected List<DetailComponent> detail;
/**
* The materials and placement date of prior fixed prosthesis.
*/
@Child(name="prosthesis", type={}, order=16, min=0, max=1)
@Child(name="prosthesis", type={}, order=17, min=0, max=1)
@Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." )
protected ProsthesisComponent prosthesis;
private static final long serialVersionUID = -1561435930L;
private static final long serialVersionUID = 1518140870L;
public ItemsComponent() {
super();
@ -1680,6 +1691,60 @@ public class OralHealthClaim extends DomainResource {
return this;
}
/**
* @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
*/
public List<IntegerType> getDiagnosisLinkId() {
if (this.diagnosisLinkId == null)
this.diagnosisLinkId = new ArrayList<IntegerType>();
return this.diagnosisLinkId;
}
public boolean hasDiagnosisLinkId() {
if (this.diagnosisLinkId == null)
return false;
for (IntegerType item : this.diagnosisLinkId)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
*/
// syntactic sugar
public IntegerType addDiagnosisLinkIdElement() {//2
IntegerType t = new IntegerType();
if (this.diagnosisLinkId == null)
this.diagnosisLinkId = new ArrayList<IntegerType>();
this.diagnosisLinkId.add(t);
return t;
}
/**
* @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
*/
public ItemsComponent addDiagnosisLinkId(int value) { //1
IntegerType t = new IntegerType();
t.setValue(value);
if (this.diagnosisLinkId == null)
this.diagnosisLinkId = new ArrayList<IntegerType>();
this.diagnosisLinkId.add(t);
return this;
}
/**
* @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
*/
public boolean hasDiagnosisLinkId(int value) {
if (this.diagnosisLinkId == null)
return false;
for (IntegerType v : this.diagnosisLinkId)
if (v.equals(value)) // integer
return true;
return false;
}
/**
* @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.)
*/
@ -1735,14 +1800,14 @@ public class OralHealthClaim extends DomainResource {
/**
* @return The date when the enclosed suite of services were performed or completed.
*/
public DateAndTime getServiceDate() {
public Date getServiceDate() {
return this.serviceDate == null ? null : this.serviceDate.getValue();
}
/**
* @param value The date when the enclosed suite of services were performed or completed.
*/
public ItemsComponent setServiceDate(DateAndTime value) {
public ItemsComponent setServiceDate(Date value) {
if (value == null)
this.serviceDate = null;
else {
@ -2090,6 +2155,7 @@ public class OralHealthClaim extends DomainResource {
childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence));
childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider));
childrenList.add(new Property("diagnosisLinkId", "integer", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId));
childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service));
childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate));
childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity));
@ -2111,6 +2177,11 @@ public class OralHealthClaim extends DomainResource {
dst.sequence = sequence == null ? null : sequence.copy();
dst.type = type == null ? null : type.copy();
dst.provider = provider == null ? null : provider.copy();
if (diagnosisLinkId != null) {
dst.diagnosisLinkId = new ArrayList<IntegerType>();
for (IntegerType i : diagnosisLinkId)
dst.diagnosisLinkId.add(i.copy());
};
dst.service = service == null ? null : service.copy();
dst.serviceDate = serviceDate == null ? null : serviceDate.copy();
dst.quantity = quantity == null ? null : quantity.copy();
@ -2141,7 +2212,8 @@ public class OralHealthClaim extends DomainResource {
public boolean isEmpty() {
return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty())
&& (provider == null || provider.isEmpty()) && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty())
&& (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty())
&& (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty())
&& (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty())
&& (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty())
&& (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subsite == null || subsite.isEmpty())
@ -3107,14 +3179,14 @@ public class OralHealthClaim extends DomainResource {
/**
* @return Date of the initial placement.
*/
public DateAndTime getPriorDate() {
public Date getPriorDate() {
return this.priorDate == null ? null : this.priorDate.getValue();
}
/**
* @param value Date of the initial placement.
*/
public ProsthesisComponent setPriorDate(DateAndTime value) {
public ProsthesisComponent setPriorDate(Date value) {
if (value == null)
this.priorDate = null;
else {
@ -3196,9 +3268,9 @@ public class OralHealthClaim extends DomainResource {
/**
* The date when the enclosed suite of services were performed or completed.
*/
@Child(name="date", type={DateType.class}, order=2, min=0, max=1)
@Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
protected DateType date;
protected DateTimeType created;
/**
* Insurer Identifier, typical BIN number (6 digit).
@ -3396,7 +3468,7 @@ public class OralHealthClaim extends DomainResource {
@Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." )
protected List<Coding> additionalMaterials;
private static final long serialVersionUID = 1132893716L;
private static final long serialVersionUID = -748490719L;
public OralHealthClaim() {
super();
@ -3486,50 +3558,50 @@ public class OralHealthClaim extends DomainResource {
}
/**
* @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateType getDateElement() {
if (this.date == null)
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OralHealthClaim.date");
throw new Error("Attempt to auto-create OralHealthClaim.created");
else if (Configuration.doAutoCreate())
this.date = new DateType();
return this.date;
this.created = new DateTimeType();
return this.created;
}
public boolean hasDateElement() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasDate() {
return this.date != null && !this.date.isEmpty();
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
* @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public OralHealthClaim setDateElement(DateType value) {
this.date = value;
public OralHealthClaim setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when the enclosed suite of services were performed or completed.
*/
public DateAndTime getDate() {
return this.date == null ? null : this.date.getValue();
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when the enclosed suite of services were performed or completed.
*/
public OralHealthClaim setDate(DateAndTime value) {
public OralHealthClaim setCreated(Date value) {
if (value == null)
this.date = null;
this.created = null;
else {
if (this.date == null)
this.date = new DateType();
this.date.setValue(value);
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
@ -3709,7 +3781,7 @@ public class OralHealthClaim extends DomainResource {
this.use = null;
else {
if (this.use == null)
this.use = new Enumeration<UseLink>();
this.use = new Enumeration<UseLink>(UseLink.ENUM_FACTORY);
this.use.setValue(value);
}
return this;
@ -4163,14 +4235,14 @@ public class OralHealthClaim extends DomainResource {
/**
* @return Date of an accident which these services are addessing.
*/
public DateAndTime getAccident() {
public Date getAccident() {
return this.accident == null ? null : this.accident.getValue();
}
/**
* @param value Date of an accident which these services are addessing.
*/
public OralHealthClaim setAccident(DateAndTime value) {
public OralHealthClaim setAccident(Date value) {
if (value == null)
this.accident = null;
else {
@ -4354,7 +4426,7 @@ public class OralHealthClaim extends DomainResource {
childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date));
childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target));
childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider));
childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization));
@ -4390,7 +4462,7 @@ public class OralHealthClaim extends DomainResource {
};
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.date = date == null ? null : date.copy();
dst.created = created == null ? null : created.copy();
dst.target = target == null ? null : target.copy();
dst.provider = provider == null ? null : provider.copy();
dst.organization = organization == null ? null : organization.copy();
@ -4455,7 +4527,7 @@ public class OralHealthClaim extends DomainResource {
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty())
&& (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty())
&& (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty())
&& (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty())
&& (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty())
&& (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (payee == null || payee.isEmpty())

Some files were not shown because too many files have changed in this diff Show More